2022-11-01 18:52:08 +10:00
|
|
|
|
from cgitb import text
|
2022-11-03 01:01:08 +10:00
|
|
|
|
import datetime
|
2022-10-18 19:17:36 +10:00
|
|
|
|
import logging
|
2022-10-29 14:04:56 +10:00
|
|
|
|
|
2022-10-18 19:17:36 +10:00
|
|
|
|
from aiogram import Bot, Dispatcher, executor, types
|
2022-10-18 20:22:30 +10:00
|
|
|
|
from aiogram.types import ReplyKeyboardRemove, ReplyKeyboardMarkup, KeyboardButton
|
2022-10-30 20:49:19 +10:00
|
|
|
|
|
2022-10-18 19:17:36 +10:00
|
|
|
|
API_TOKEN = '5724991559:AAEuLvpLsgP6LHRGMSyFtQLlR5qPQUO4b_w'
|
|
|
|
|
|
|
|
|
|
logging.basicConfig(level=logging.DEBUG)
|
|
|
|
|
|
|
|
|
|
bot = Bot(token=API_TOKEN)
|
|
|
|
|
dp = Dispatcher(bot)
|
2022-10-29 14:04:56 +10:00
|
|
|
|
|
2022-11-03 16:28:19 +10:00
|
|
|
|
|
2022-11-03 00:39:03 +10:00
|
|
|
|
|
2022-11-03 01:01:08 +10:00
|
|
|
|
@dp.message_handler(commands=["time"])
|
2022-11-03 00:39:03 +10:00
|
|
|
|
async def send_time(message: types.Message):
|
2022-11-03 18:32:22 +10:00
|
|
|
|
cd = datetime.datetime.now().strftime("%d/%m/%Y") #дата
|
|
|
|
|
ct = datetime.datetime.now() #датавремя
|
|
|
|
|
ct = ct+datetime.timedelta(hours=14) # +14 часов от сервера
|
|
|
|
|
ct2 = ct.strftime('%H:%M') # форматирует датувремя просто во время
|
|
|
|
|
new_year = datetime.date(2022, 12, 31).strftime("%d/%m/%Y")
|
2022-11-03 18:34:45 +10:00
|
|
|
|
differ = (new_year - ct2).days
|
2022-11-03 18:34:10 +10:00
|
|
|
|
await message.reply(f'Сегодня {cd} \nВремя: {ct2} \nДо Нового Года осталось {differ} дней(-я)')
|
2022-11-03 16:28:19 +10:00
|
|
|
|
|
2022-11-03 01:01:08 +10:00
|
|
|
|
|
2022-11-03 00:39:03 +10:00
|
|
|
|
|
|
|
|
|
""""async def set_default_commands(dp):
|
2022-11-02 23:10:27 +10:00
|
|
|
|
await dp.bot.set_my_commands([
|
|
|
|
|
types.BotCommand("start", "Запустить бота"),
|
|
|
|
|
types.BotCommand("photo", "рандомная пикча"),
|
2022-11-03 00:39:03 +10:00
|
|
|
|
]) # отображает cписок команд но через бот фазер это проще"""
|
2022-11-02 23:10:27 +10:00
|
|
|
|
|
2022-10-29 14:04:56 +10:00
|
|
|
|
@dp.message_handler(commands=['start'])
|
2022-10-29 14:26:58 +10:00
|
|
|
|
async def start_func(message: types.Message):
|
2022-10-30 21:23:07 +10:00
|
|
|
|
# user_id = message.from_user.id
|
|
|
|
|
# user_full_name = message.from_user.full_name
|
|
|
|
|
# logging.INFO(f'{user_id=} {user_full_name=}', {time.asctime()})
|
2022-11-02 23:10:27 +10:00
|
|
|
|
await message.reply('похуй')
|
2022-10-30 20:49:19 +10:00
|
|
|
|
|
|
|
|
|
@dp.message_handler(commands=['photo'])
|
2022-10-30 21:17:21 +10:00
|
|
|
|
async def send_image(message: types.Message):
|
2022-11-02 23:10:27 +10:00
|
|
|
|
await bot.send_photo(message.chat.id, photo='https://memepedia.ru/wp-content/uploads/2018/08/ya-pidoras.jpg', reply_to_message_id=message.message_id)
|
2022-10-30 20:49:19 +10:00
|
|
|
|
|
2022-11-01 20:22:58 +10:00
|
|
|
|
@dp.message_handler(content_types=types.ContentTypes.TEXT)
|
2022-11-01 19:40:45 +10:00
|
|
|
|
async def send_faggot(message: types.Message):
|
2022-11-01 20:14:33 +10:00
|
|
|
|
print(message.text)
|
|
|
|
|
if message.text == 'хто я':
|
|
|
|
|
await bot.send_photo(message.chat.id, photo='https://www.meme-arsenal.com/memes/ecebd2339c7eab40e09874bd86a38a09.jpg')
|
2022-11-01 18:52:08 +10:00
|
|
|
|
|
2022-10-30 21:20:49 +10:00
|
|
|
|
#хуй
|
2022-10-29 14:04:56 +10:00
|
|
|
|
|
2022-10-18 19:17:36 +10:00
|
|
|
|
if __name__ == '__main__':
|
|
|
|
|
executor.start_polling(dp, skip_updates=True)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|