-
Notifications
You must be signed in to change notification settings - Fork 6
Group API
unreg edited this page Nov 17, 2016
·
8 revisions
from actorbot.api import groups
from actorbot.bots import Conversation
class ExampleConversation(Conversation):
def sample(self):
out_msg = groups.CreateGroup(self._get_id(), title='New group')
await self.send(out_msg)from actorbot.api import groups, Peer
from actorbot.bots import Conversation
class ExampleConversation(Conversation):
def sample(self):
member1 = Peer(peer_type='User', peer_id='2529523898',
accessHash='-3273354428490000423')
member2 = Peer(peer_type='User', peer_id='521183688',
accessHash='8939818144941245563')
out_msg = groups.CreateGroupWithOwner(self._get_id(),
title='New group',
owner=self._peer,
members=[member1.data, member2.data])
await self.send(out_msg)from actorbot.api import Peer, groups
from actorbot.bots import Conversation
class ExampleConversation(Conversation):
def sample(self):
groupPeer = Peer(peer_type='Group', peer_id='555184229',
accessHash='3301957926686839888')
userPeer = Peer(peer_type='User', peer_id='2529523898',
accessHash='-3273354428490000423')
out_msg = groups.InviteUser(self._get_id(), groupPeer, userPeer)
await self.send(out_msg)