Use classmethod for all Event.build

This commit is contained in:
Lonami Exo
2018-07-19 01:47:32 +02:00
parent 2d7c8908eb
commit 7f78d7ed2f
10 changed files with 79 additions and 79 deletions

View File

@@ -40,11 +40,11 @@ class CallbackQuery(EventBuilder):
else:
raise TypeError('Invalid data type given')
@staticmethod
def build(update):
@classmethod
def build(cls, update):
if isinstance(update, (types.UpdateBotCallbackQuery,
types.UpdateInlineBotCallbackQuery)):
event = CallbackQuery.Event(update)
event = cls.Event(update)
else:
return