-
Notifications
You must be signed in to change notification settings - Fork 0
/
messages.py
32 lines (22 loc) · 869 Bytes
/
messages.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
import json
import requests
def getVkUser(uid, api, token):
return api.users.get(access_token=token, user_ids=uid)
class Messages:
def __init__(self, token,keyboard,api):
self.token = token
self.keyboard = keyboard
self.api = api
def sendPdfToUser(self, attach, uid ):
try:
self.api.messages.send(access_token=self.token, user_id=uid, attachment=attach,keyboard=self.keyboard)
except:
return False
def sendMessage(self,message,uid):
self.api.messages.send(access_token=self.token, user_id=uid,message=message, keyboard=self.keyboard)
def sendmsg(self, msg):
pass
def sendSuccess(self):
pass
def sendError(self,uid):
self.api.messages.send(access_token=self.token, user_id=uid, message="я не понимаю", keyboard=self.keyboard)