Fix possible errors

This commit is contained in:
Tulir Asokan
2018-02-21 23:35:59 +02:00
parent 03734a6745
commit 2d13c30a26
2 changed files with 11 additions and 2 deletions
+6
View File
@@ -65,6 +65,12 @@ class Bot(AbstractUser):
except (ChannelPrivateError, ChannelInvalidError):
self.remove_chat(id.channel_id)
def register_portal(self, portal):
self.add_chat(portal.tgid, portal.peer_type)
def unregister_portal(self, portal):
self.remove_chat(portal.tgid)
def add_chat(self, id, type):
if id not in self.chats:
self.chats[id] = type