multibotkit 0.1.26__tar.gz → 0.1.28__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {multibotkit-0.1.26 → multibotkit-0.1.28}/PKG-INFO +1 -1
- {multibotkit-0.1.26 → multibotkit-0.1.28}/multibotkit/dispatchers/telegram.py +10 -2
- {multibotkit-0.1.26 → multibotkit-0.1.28}/multibotkit/helpers/telegram.py +100 -0
- {multibotkit-0.1.26 → multibotkit-0.1.28}/multibotkit.egg-info/PKG-INFO +1 -1
- {multibotkit-0.1.26 → multibotkit-0.1.28}/setup.py +1 -1
- {multibotkit-0.1.26 → multibotkit-0.1.28}/LICENSE +0 -0
- {multibotkit-0.1.26 → multibotkit-0.1.28}/README.md +0 -0
- {multibotkit-0.1.26 → multibotkit-0.1.28}/multibotkit/__init__.py +0 -0
- {multibotkit-0.1.26 → multibotkit-0.1.28}/multibotkit/dispatchers/__init__.py +0 -0
- {multibotkit-0.1.26 → multibotkit-0.1.28}/multibotkit/dispatchers/base_dispatcher.py +0 -0
- {multibotkit-0.1.26 → multibotkit-0.1.28}/multibotkit/dispatchers/fb.py +0 -0
- {multibotkit-0.1.26 → multibotkit-0.1.28}/multibotkit/dispatchers/viber.py +0 -0
- {multibotkit-0.1.26 → multibotkit-0.1.28}/multibotkit/dispatchers/vk.py +0 -0
- {multibotkit-0.1.26 → multibotkit-0.1.28}/multibotkit/helpers/__init__.py +0 -0
- {multibotkit-0.1.26 → multibotkit-0.1.28}/multibotkit/helpers/base_helper.py +0 -0
- {multibotkit-0.1.26 → multibotkit-0.1.28}/multibotkit/helpers/fb.py +0 -0
- {multibotkit-0.1.26 → multibotkit-0.1.28}/multibotkit/helpers/viber.py +0 -0
- {multibotkit-0.1.26 → multibotkit-0.1.28}/multibotkit/helpers/vk.py +0 -0
- {multibotkit-0.1.26 → multibotkit-0.1.28}/multibotkit/schemas/__init__.py +0 -0
- {multibotkit-0.1.26 → multibotkit-0.1.28}/multibotkit/schemas/fb/__init__.py +0 -0
- {multibotkit-0.1.26 → multibotkit-0.1.28}/multibotkit/schemas/fb/incoming.py +0 -0
- {multibotkit-0.1.26 → multibotkit-0.1.28}/multibotkit/schemas/fb/outgoing.py +0 -0
- {multibotkit-0.1.26 → multibotkit-0.1.28}/multibotkit/schemas/telegram/__init__.py +0 -0
- {multibotkit-0.1.26 → multibotkit-0.1.28}/multibotkit/schemas/telegram/incoming.py +0 -0
- {multibotkit-0.1.26 → multibotkit-0.1.28}/multibotkit/schemas/telegram/outgoing.py +0 -0
- {multibotkit-0.1.26 → multibotkit-0.1.28}/multibotkit/schemas/viber/__init__.py +0 -0
- {multibotkit-0.1.26 → multibotkit-0.1.28}/multibotkit/schemas/viber/incoming.py +0 -0
- {multibotkit-0.1.26 → multibotkit-0.1.28}/multibotkit/schemas/viber/outgoing.py +0 -0
- {multibotkit-0.1.26 → multibotkit-0.1.28}/multibotkit/schemas/vk/__init__.py +0 -0
- {multibotkit-0.1.26 → multibotkit-0.1.28}/multibotkit/schemas/vk/incoming.py +0 -0
- {multibotkit-0.1.26 → multibotkit-0.1.28}/multibotkit/schemas/vk/outgoing.py +0 -0
- {multibotkit-0.1.26 → multibotkit-0.1.28}/multibotkit/states/__init__.py +0 -0
- {multibotkit-0.1.26 → multibotkit-0.1.28}/multibotkit/states/managers/__init__.py +0 -0
- {multibotkit-0.1.26 → multibotkit-0.1.28}/multibotkit/states/managers/base.py +0 -0
- {multibotkit-0.1.26 → multibotkit-0.1.28}/multibotkit/states/managers/memory.py +0 -0
- {multibotkit-0.1.26 → multibotkit-0.1.28}/multibotkit/states/managers/mongo.py +0 -0
- {multibotkit-0.1.26 → multibotkit-0.1.28}/multibotkit/states/managers/redis.py +0 -0
- {multibotkit-0.1.26 → multibotkit-0.1.28}/multibotkit/states/state.py +0 -0
- {multibotkit-0.1.26 → multibotkit-0.1.28}/multibotkit.egg-info/SOURCES.txt +0 -0
- {multibotkit-0.1.26 → multibotkit-0.1.28}/multibotkit.egg-info/dependency_links.txt +0 -0
- {multibotkit-0.1.26 → multibotkit-0.1.28}/multibotkit.egg-info/requires.txt +0 -0
- {multibotkit-0.1.26 → multibotkit-0.1.28}/multibotkit.egg-info/top_level.txt +0 -0
- {multibotkit-0.1.26 → multibotkit-0.1.28}/pyproject.toml +0 -0
- {multibotkit-0.1.26 → multibotkit-0.1.28}/setup.cfg +0 -0
|
@@ -11,9 +11,17 @@ class TelegramDispatcher(BaseDispatcher):
|
|
|
11
11
|
):
|
|
12
12
|
if event.message is not None:
|
|
13
13
|
sender_id = event.message.from_.id
|
|
14
|
-
|
|
14
|
+
elif event.callback_query is not None:
|
|
15
15
|
sender_id = event.callback_query.from_.id
|
|
16
|
-
|
|
16
|
+
elif event.chat_member is not None:
|
|
17
|
+
sender_id = event.chat_member.from_.id
|
|
18
|
+
elif event.chat_join_request is not None:
|
|
19
|
+
sender_id = event.chat_join_request.from_.id
|
|
20
|
+
elif event.my_chat_member is not None:
|
|
21
|
+
sender_id = event.my_chat_member.from_.id
|
|
22
|
+
else:
|
|
23
|
+
sender_id = None
|
|
24
|
+
|
|
17
25
|
state_id = f"telegram_{sender_id}"
|
|
18
26
|
state_object = await self.state_manager.get_state(state_id)
|
|
19
27
|
|
|
@@ -228,6 +228,26 @@ class TelegramHelper(BaseHelper):
|
|
|
228
228
|
r = await self._perform_async_request(url, data)
|
|
229
229
|
return r
|
|
230
230
|
|
|
231
|
+
def sync_revoke_chat_invite_link(
|
|
232
|
+
self,
|
|
233
|
+
chat_id: int,
|
|
234
|
+
invite_link: str,
|
|
235
|
+
):
|
|
236
|
+
url = self.tg_base_url + "revokeChatInviteLink"
|
|
237
|
+
data = {"chat_id": chat_id, "invite_link": invite_link}
|
|
238
|
+
r = self._perform_sync_request(url, data)
|
|
239
|
+
return r
|
|
240
|
+
|
|
241
|
+
async def async_revoke_chat_invite_link(
|
|
242
|
+
self,
|
|
243
|
+
chat_id: int,
|
|
244
|
+
invite_link: str,
|
|
245
|
+
):
|
|
246
|
+
url = self.tg_base_url + "revokeChatInviteLink"
|
|
247
|
+
data = {"chat_id": chat_id, "invite_link": invite_link}
|
|
248
|
+
r = await self._perform_async_request(url, data)
|
|
249
|
+
return r
|
|
250
|
+
|
|
231
251
|
def sync_approve_chat_join_request(
|
|
232
252
|
self,
|
|
233
253
|
chat_id: int,
|
|
@@ -258,6 +278,86 @@ class TelegramHelper(BaseHelper):
|
|
|
258
278
|
r = self._perform_sync_request(url, data)
|
|
259
279
|
return r
|
|
260
280
|
|
|
281
|
+
async def async_unban_chat_member(
|
|
282
|
+
self,
|
|
283
|
+
chat_id: int,
|
|
284
|
+
user_id: int,
|
|
285
|
+
):
|
|
286
|
+
url = self.tg_base_url + "unbanChatMember"
|
|
287
|
+
data = {"chat_id": chat_id, "user_id": user_id}
|
|
288
|
+
r = await self._perform_async_request(url, data)
|
|
289
|
+
return r
|
|
290
|
+
|
|
291
|
+
def sync_unban_chat_member(
|
|
292
|
+
self,
|
|
293
|
+
chat_id: int,
|
|
294
|
+
user_id: int,
|
|
295
|
+
):
|
|
296
|
+
url = self.tg_base_url + "unbanChatMember"
|
|
297
|
+
data = {"chat_id": chat_id, "user_id": user_id}
|
|
298
|
+
r = self._perform_sync_request(url, data)
|
|
299
|
+
return r
|
|
300
|
+
|
|
301
|
+
async def async_get_chat_member(
|
|
302
|
+
self,
|
|
303
|
+
chat_id: int,
|
|
304
|
+
user_id: int,
|
|
305
|
+
):
|
|
306
|
+
url = self.tg_base_url + "getChatMember"
|
|
307
|
+
data = {"chat_id": chat_id, "user_id": user_id}
|
|
308
|
+
r = await self._perform_async_request(url, data)
|
|
309
|
+
return r
|
|
310
|
+
|
|
311
|
+
def sync_get_chat_member(
|
|
312
|
+
self,
|
|
313
|
+
chat_id: int,
|
|
314
|
+
user_id: int,
|
|
315
|
+
):
|
|
316
|
+
url = self.tg_base_url + "getChatMember"
|
|
317
|
+
data = {"chat_id": chat_id, "user_id": user_id}
|
|
318
|
+
r = self._perform_sync_request(url, data)
|
|
319
|
+
return r
|
|
320
|
+
|
|
321
|
+
async def async_set_chat_title(
|
|
322
|
+
self,
|
|
323
|
+
chat_id: int,
|
|
324
|
+
title: str,
|
|
325
|
+
):
|
|
326
|
+
url = self.tg_base_url + "setChatTitle"
|
|
327
|
+
data = {"chat_id": chat_id, "title": title}
|
|
328
|
+
r = await self._perform_async_request(url, data)
|
|
329
|
+
return r
|
|
330
|
+
|
|
331
|
+
def sync_set_chat_title(
|
|
332
|
+
self,
|
|
333
|
+
chat_id: int,
|
|
334
|
+
title: str,
|
|
335
|
+
):
|
|
336
|
+
url = self.tg_base_url + "setChatTitle"
|
|
337
|
+
data = {"chat_id": chat_id, "title": title}
|
|
338
|
+
r = self._perform_sync_request(url, data)
|
|
339
|
+
return r
|
|
340
|
+
|
|
341
|
+
async def async_set_chat_description(
|
|
342
|
+
self,
|
|
343
|
+
chat_id: int,
|
|
344
|
+
description: str,
|
|
345
|
+
):
|
|
346
|
+
url = self.tg_base_url + "setChatDescription"
|
|
347
|
+
data = {"chat_id": chat_id, "description": description}
|
|
348
|
+
r = await self._perform_async_request(url, data)
|
|
349
|
+
return r
|
|
350
|
+
|
|
351
|
+
def sync_set_chat_description(
|
|
352
|
+
self,
|
|
353
|
+
chat_id: int,
|
|
354
|
+
description: str,
|
|
355
|
+
):
|
|
356
|
+
url = self.tg_base_url + "setChatDescription"
|
|
357
|
+
data = {"chat_id": chat_id, "description": description}
|
|
358
|
+
r = self._perform_sync_request(url, data)
|
|
359
|
+
return r
|
|
360
|
+
|
|
261
361
|
async def async_decline_chat_join_request(
|
|
262
362
|
self,
|
|
263
363
|
chat_id: int,
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|