use native filter from_users in event handler, no more if m.sender_id != blah...
This commit is contained in:
parent
c6ee992980
commit
ccb76a9b19
1 changed files with 11 additions and 19 deletions
30
ubot.py
30
ubot.py
|
@ -270,7 +270,9 @@ async def main():
|
|||
asyncio.ensure_future(updatenotif.git_notifications_update())
|
||||
await victimsbackup.bio_backup_stealing(client, c, conn, default_directory)
|
||||
|
||||
@client.on(events.NewMessage(pattern='.*йобнув.*|.*подверг(ла)?.*|.*infected.*|.*сикди.*|.*насрал.*|.*выебал.*|.*за допомогою довіреності.*|.*by authorization infected.*|.*при помощи анонимуса атаковала.*'))
|
||||
@client.on(events.NewMessage(
|
||||
pattern='.*йобнув.*|.*подверг(ла)?.*|.*infected.*|.*сикди.*|.*насрал.*|.*выебал.*|.*за допомогою довіреності.*|.*by authorization infected.*|.*при помощи анонимуса атаковала.*',
|
||||
from_users=(6333102398, 'me')))
|
||||
@logger.catch
|
||||
async def podverg_a(event):
|
||||
logger.debug('bio attack detected')
|
||||
|
@ -347,10 +349,7 @@ async def main():
|
|||
default_pathogen_remaining_theme),
|
||||
)
|
||||
|
||||
if m.sender_id != 6333102398:
|
||||
logger.debug('not avocado infection, skipping')
|
||||
pass
|
||||
elif len(m.entities) > 1:
|
||||
if len(m.entities) > 1:
|
||||
h = utils.sanitize_parse_mode(
|
||||
'html').unparse(t, m.entities) # HTML
|
||||
for theme in bio_attack_themes:
|
||||
|
@ -622,17 +621,14 @@ async def main():
|
|||
states.where_send_check_avocado = event.peer_id
|
||||
await event.edit('Checks will be send here')
|
||||
|
||||
@client.on(events.NewMessage(pattern='.+Служба безопасности лаборатории'))
|
||||
@client.on(events.NewMessage(pattern='.+Служба безопасности лаборатории',
|
||||
from_users=(707693258, 5137994780, 5226378684, 5443619563, 5434504334)))
|
||||
# Организатор заражения: нада биоебнуть?
|
||||
async def iris_sb(event):
|
||||
# iris off bio 31.12.24
|
||||
m = event.message
|
||||
t = m.raw_text
|
||||
irises = [707693258, 5137994780,
|
||||
5226378684, 5443619563, 5434504334]
|
||||
if m.sender_id not in irises:
|
||||
pass
|
||||
elif a_404_patient and len(m.entities) > 1 and states.where_send_check_avocado:
|
||||
if a_404_patient and len(m.entities) > 1 and states.where_send_check_avocado:
|
||||
h = utils.sanitize_parse_mode(
|
||||
'html').unparse(t, m.entities) # HTML
|
||||
r = re.findall(
|
||||
|
@ -648,12 +644,10 @@ async def main():
|
|||
|
||||
####################################################################
|
||||
|
||||
@client.on(events.NewMessage(pattern='⏱?🚫 Жертва'))
|
||||
@client.on(events.NewMessage(pattern='⏱?🚫 Жертва', from_users=(6333102398,)))
|
||||
async def infection_not_found(event):
|
||||
m = event.message
|
||||
if m.sender_id != 6333102398:
|
||||
pass
|
||||
elif a_404_patient and m.mentioned:
|
||||
if a_404_patient and m.mentioned:
|
||||
await asyncio.sleep(random.uniform(1.0001, 2.22394))
|
||||
result = await client(functions.messages.GetBotCallbackAnswerRequest( # src https://tl.telethon.dev/methods/messages/get_bot_callback_answer.html
|
||||
peer=m.peer_id,
|
||||
|
@ -665,14 +659,12 @@ async def main():
|
|||
if result.message:
|
||||
logger.info(f'avocado says: {result.message}')
|
||||
|
||||
@client.on(events.NewMessage(pattern='🌡 У вас горячка вызванная'))
|
||||
@client.on(events.NewMessage(pattern='🌡 У вас горячка вызванная', from_users=(6333102398,)))
|
||||
async def need_h(event):
|
||||
m = event.message
|
||||
# reply = await client.get_messages(m.peer_id, ids=m.reply_to.reply_to_msg_id)
|
||||
# logger.debug(reply)
|
||||
if m.sender_id != 6333102398:
|
||||
pass
|
||||
elif a_h and m.mentioned:
|
||||
if a_h and m.mentioned:
|
||||
# нада хил
|
||||
ah = await message_q( # отправляет сообщение боту
|
||||
"Хил",
|
||||
|
|
Loading…
Reference in a new issue