Removed deprecations and new event system, improved other things

Removed deprecations
Removed new event system
Added documentation for all events
Added FAQ
Changed Client.uid to Client.id
Improved User model
Prepared for support of pages
This commit is contained in:
Mads Marquart
2017-06-20 14:57:23 +02:00
parent 0885796fa8
commit c81d7d2bfb
15 changed files with 768 additions and 700 deletions

View File

@@ -7,10 +7,11 @@ class RemoveBot(Client):
def onMessage(self, author_id, message, thread_id, thread_type, **kwargs):
# We can only kick people from group chats, so no need to try if it's a user chat
if message == 'Remove me!' and thread_type == ThreadType.GROUP:
log.info("{} will be removed from {}".format(author_id, thread_id))
log.info('{} will be removed from {}'.format(author_id, thread_id))
self.removeUserFromGroup(author_id, thread_id=thread_id)
else:
log.info("Message from {} in {} ({}): {}".format(author_id, thread_id, thread_type.name, message))
# Sends the data to the inherited onMessage, so that we can still see when a message is recieved
super(type(self), self).onMessage(author_id=author_id, message=message, thread_id=thread_id, thread_type=thread_type, **kwargs)
client = RemoveBot("<email>", "<password>")
client.listen()