mirror of
https://github.com/Nick80835/microbot
synced 2025-08-31 22:46:01 +00:00
add a function to loader for checking if a sticker is a sticker
This commit is contained in:
@@ -4,8 +4,8 @@ from importlib import import_module, reload
|
||||
from os.path import basename, dirname, isfile
|
||||
|
||||
from aiohttp import ClientSession
|
||||
|
||||
from telethon.tl.types import DocumentAttributeFilename
|
||||
from telethon.tl.types import (DocumentAttributeFilename,
|
||||
DocumentAttributeSticker)
|
||||
|
||||
from .cache import Cache
|
||||
from .command import (CallbackQueryCommand, Command, InlineArticleCommand,
|
||||
@@ -171,6 +171,15 @@ class Loader():
|
||||
else:
|
||||
return
|
||||
|
||||
async def is_sticker(self, event) -> bool:
|
||||
if event and event.sticker:
|
||||
attrs = [i.alt for i in event.sticker.attributes if isinstance(i, DocumentAttributeSticker)]
|
||||
|
||||
if attrs and attrs[0]:
|
||||
return True
|
||||
|
||||
return False
|
||||
|
||||
def prefix(self):
|
||||
return (self.settings.get_list('cmd_prefix') or ['.'])[0]
|
||||
|
||||
|
Reference in New Issue
Block a user