mirror of
https://github.com/MuRuLOSE/limoka.git
synced 2026-06-18 07:04:19 +02:00
Commited backup
This commit is contained in:
16
MuRuLOSE/HikkaModulesRepo/libaries/common.py
Normal file
16
MuRuLOSE/HikkaModulesRepo/libaries/common.py
Normal file
@@ -0,0 +1,16 @@
|
||||
from .. import loader
|
||||
from telethon.types import Message
|
||||
|
||||
|
||||
class CommonLib(loader.Library):
|
||||
'''Lib for modules with common items, like topic resolver.'''
|
||||
developer = "@MuRuLOSE"
|
||||
|
||||
async def _topic_resolver(self, message: Message) -> int:
|
||||
if message.reply_to.forum_topic:
|
||||
topic_id = message.reply_to.reply_to_top_id
|
||||
return topic_id
|
||||
|
||||
async def _resolve_username_id(self, username: str) -> int:
|
||||
data = await self.client.get_entity(username)
|
||||
return data.id
|
||||
Reference in New Issue
Block a user