It's version 0.6.2 I clear code
This commit is contained in:
+22
-12
@@ -1,7 +1,7 @@
|
||||
from config import Config
|
||||
from utils.antispam import admin_required
|
||||
from aiogram import Dispatcher, Bot
|
||||
from aiogram.types import Message
|
||||
from aiogram.types import Message, FSInputFile
|
||||
from models.state import BotState
|
||||
from aiogram.filters import Command
|
||||
from logging import getLogger
|
||||
@@ -20,7 +20,7 @@ def register_handlers(dp: Dispatcher, state: BotState, bot: Bot):
|
||||
poll_msg = await bot.send_poll(
|
||||
chat_id=chat_id,
|
||||
question="Кто опоздает?",
|
||||
options=["Я", "Я очень сильно опоздаю", "Я пиздец как опоздаю", "Наверное", "Не опоздаю"],
|
||||
options=["Я", "Я очень сильно опоздаю", "Я пиздец как опоздаю", "Наверное", "я ДОЛБОЯЩЕР и я к 2 паре", "Не опоздаю"],
|
||||
is_anonymous=False,
|
||||
allows_multiple_answers=False,
|
||||
)
|
||||
@@ -44,39 +44,49 @@ def register_handlers(dp: Dispatcher, state: BotState, bot: Bot):
|
||||
|
||||
# всегда пишем в первый чат из Config.CHAT_IDS
|
||||
# 6394047531
|
||||
#850906163
|
||||
STARAST = 6394047531
|
||||
|
||||
if option_ids and option_ids[0] == 0:
|
||||
if not option_ids:
|
||||
msg = await bot.send_message(
|
||||
chat_id=6394047531, text=f"{username} опоздает"
|
||||
chat_id=STARAST, text=f"{username} Отменил свой голос"
|
||||
)
|
||||
save_message(msg.chat.id, msg.message_id)
|
||||
elif option_ids and option_ids[0] == 0:
|
||||
msg = await bot.send_message(
|
||||
chat_id=STARAST, text=f"{username} опоздает"
|
||||
)
|
||||
save_message(msg.chat.id, msg.message_id)
|
||||
elif option_ids and option_ids[0] == 1:
|
||||
msg = await bot.send_message(
|
||||
chat_id=6394047531, text=f"{username} сильно опоздает"
|
||||
chat_id=STARAST, text=f"{username} сильно опоздает"
|
||||
)
|
||||
save_message(msg.chat.id, msg.message_id)
|
||||
elif option_ids and option_ids[0] == 2:
|
||||
msg = await bot.send_message(
|
||||
chat_id=6394047531, text=f"{username} Пиздец опоздает"
|
||||
chat_id=STARAST, text=f"{username} Пиздец опоздает"
|
||||
)
|
||||
save_message(msg.chat.id, msg.message_id)
|
||||
elif option_ids[0] == 3:
|
||||
msg = await bot.send_message(
|
||||
chat_id=6394047531, text=f"{username} возможно опоздает"
|
||||
chat_id=STARAST, text=f"{username} возможно опоздает"
|
||||
)
|
||||
save_message(msg.chat.id, msg.message_id)
|
||||
|
||||
elif option_ids[0] == 4:
|
||||
msg = await bot.send_message(
|
||||
chat_id=6394047531, text=f"{username} возможно опоздает"
|
||||
photo = FSInputFile("/Users/mac/myfirstprogramm/addons/poll/img.png")
|
||||
msg = await bot.send_photo(
|
||||
chat_id=STARAST, photo=photo, caption=f"{username} ДОЛБОЯЩЕР"
|
||||
)
|
||||
save_message(msg.chat.id, msg.message_id)
|
||||
elif not option_ids:
|
||||
|
||||
elif option_ids[0] == 5:
|
||||
msg = await bot.send_message(
|
||||
chat_id=6394047531, text=f"{username} Отменил свой голос"
|
||||
chat_id=STARAST, text=f"{username} не опоздает"
|
||||
)
|
||||
save_message(msg.chat.id, msg.message_id)
|
||||
else:
|
||||
msg = await bot.send_message(
|
||||
chat_id=6394047531, text=f"{username} выбрал вариант {option_ids}"
|
||||
chat_id=STARAST, text=f"{username} выбрал вариант {option_ids}"
|
||||
)
|
||||
save_message(msg.chat.id, msg.message_id)
|
||||
|
||||
Reference in New Issue
Block a user