-
Notifications
You must be signed in to change notification settings - Fork 6
Messaging API
unreg edited this page Oct 29, 2016
·
9 revisions
from actorbot.api import Peer, messaging
from actorbot.bots import Conversation
class ExampleConversation(Conversation):
def sample(self):
dest = Peer(peer_type='User', peer_id='2529523898',
accessHash='-3273354428490000423')
out_text = messaging.TextMessage(text='Sample text')
out_msg = messaging.SendMessage(self._get_id(),
peer=dest, message=out_text)
self.send(out_msg)from actorbot.api import Peer, messaging
from actorbot.bots import Conversation
class ExampleConversation(Conversation):
def sample(self):
dest = Peer(peer_type='User', peer_id='2529523898',
accessHash='-3273354428490000423')
out_text = messaging.TextMessage(text='Sample text')
out_msg = messaging.SendMessage(self._get_id(),
peer=dest, message=out_text)
randId = out_msg.body.randomId
self.send(out_msg)
out_text = messaging.TextMessage(text='Simple sample text')
out_msg = messaging.UpdateMessageContent(
self._get_id(), peer=dest, randomId=randId, message=out_text)
self.send(out_msg)