-
Notifications
You must be signed in to change notification settings - Fork 6
File API
unreg edited this page Oct 29, 2016
·
3 revisions
from actorbot.api import files
from actorbot.bots import Conversation
class ExampleConversation(Conversation):
def sample(self):
with open(path_to_file, 'rb') as f:
data = f.read()
out_msg = files.UploadFile(self._get_id(), bytes=list(data))
self.send(out_msg)from actorbot.api import files, FileLocation
from actorbot.bots import Conversation
class ExampleConversation(Conversation):
def sample(self):
fl = FileLocation(fileId='-7247132302682398484',
accessHash='-3538373762880660987')
out_msg = files.DownloadFile(self._get_id(), fileLocation=fl)
self.send(out_msg)