import datetime as datetime
from aiogram import Bot, types, Dispatcher, executor
from aiogram.dispatcher import Dispatcher
from aiogram.utils import executor
from aiogram.dispatcher.filters import Command
from datetime import datetime
from aiogram.utils.markdown import hide_link
import asyncio
import aioschedule
import logging
from contextlib import suppress
logging.basicConfig(level=logging.INFO)
#рабочее имя NIGGER_bot
#ИМЯ В ТГ NIGGER_bot
channel_id=-848649806
channel_tec_task=-822057952
TOKEN = "5674389953:AAEc4i6iVlgho3e0sNMADU2hHCI07VkZyik"
bot=Bot(token=TOKEN, parse_mode="HTML")
dp = Dispatcher(bot)
@dp.message_handler(commands=['start'])
async def process_start_command(message: types.message):
await message.answer("напиши /help")
userids.append(message.from_user.id)
userids=[]
usernames=[]
saved_messages=[]
splitted_mes=[]
@dp.message_handler(commands=['name'])
async def cmd_name(message: types.message, command: Command):
if command.args:
time_now = datetime.now().strftime('%H:%M')
added_text= f"Создано в {time_now}"
await message.answer(f"Привет, {command.args}\n {added_text}")
usernames.append(command.args)
else:
await message.answer("напиши имя наприме /name негр")
@dp.message_handler(commands=["image"])
async def cmd_image(message: types.message):
photo = open('Без названия.jpg', 'rb')
f"ЭПИЧЕСКИЙ БОЕЦ- ШЛЕПА В ТАЗИКЕ"
@dp.message_handler(commands=['save'])
async def save_mes(message: types.message, command: Command):
await message.answer("запомню чо напишешь")
saved_messages=command.args
await message.answer(f"{command.args}")
@dp.message_handler(commands = ['aboba'])
async def messss(message: types.Message, command: Command):
if command.args:
await bot.send_message(-848649806,f"{command.args}")
else:
await message.answer('напиши что надо в чат')
# строка, чтобы отправить что-нибудь в группу
#await bot.send_message(-848649806, 'кто двинется тот натурал')
async def choose_your_dinner(text,id):
await bot.send_message(chat_id = id, text = str(ext)t)
async def scheduler():
#установка времени #выполнение функции
aioschedule.every().day.at("17:45").do(choose_your_dinner)
while True:
await aioschedule.run_pending()
await asyncio.sleep(1)
# подлючаемся к диспетчеру и создаем таск , о ожидании времени
async def on_startup(dp):
asyncio.create_task(scheduler())
#data = splited_mes[1].split('.').split(':').split('-')
# data[0] - day
# data[1] - месяц
#data[2] - year
#data[3] - hour
#data[4] - minuts
# НАВЗАНИЕ 21.10.2022:15-00 ЧАТА 2 текст
@dp.message_handler(commands = ['split'])
async def spliter(message: types.Message, command: Command):
if command.args:
await bot.send_message(-848649806, f"{command.args}")
splitted_mes=command.args.split()
if splitted_mes[0]=="test":
await bot.send_message(-848649806, splitted_mes[1])
elif splitted_mes[0]=="test2":
await bot.send_message(-822057952 , splitted_mes[1])
else:
await bot.send_message(f"фигню сморозил")
else:
await message.answer('напиши что надо в чат так: /split test(или test2) * чо хочш отправить *')
#запуск бота (в самый низ)
async def main():
await dp.start_polling(bot)
if name == "main":
asyncio.run(main())
if
executor.start_polling(on_startup=on_startup)
from aiogram import Bot, types, Dispatcher, executor
from aiogram.dispatcher import Dispatcher
from aiogram.utils import executor
from aiogram.dispatcher.filters import Command
from datetime import datetime
from aiogram.utils.markdown import hide_link
import asyncio
import aioschedule
import logging
from contextlib import suppress
logging.basicConfig(level=logging.INFO)
#рабочее имя NIGGER_bot
#ИМЯ В ТГ NIGGER_bot
channel_id=-848649806
channel_tec_task=-822057952
TOKEN = "5674389953:AAEc4i6iVlgho3e0sNMADU2hHCI07VkZyik"
bot=Bot(token=TOKEN, parse_mode="HTML")
dp = Dispatcher(bot)
@dp.message_handler(commands=['start'])
async def process_start_command(message: types.message):
await message.answer("напиши /help")
userids.append(message.from_user.id)
userids=[]
usernames=[]
saved_messages=[]
splitted_mes=[]
@dp.message_handler(commands=['name'])
async def cmd_name(message: types.message, command: Command):
if command.args:
time_now = datetime.now().strftime('%H:%M')
added_text= f"Создано в {time_now}"
await message.answer(f"Привет, {command.args}\n {added_text}")
usernames.append(command.args)
else:
await message.answer("напиши имя наприме /name негр")
@dp.message_handler(commands=["image"])
async def cmd_image(message: types.message):
photo = open('Без названия.jpg', 'rb')
f"ЭПИЧЕСКИЙ БОЕЦ- ШЛЕПА В ТАЗИКЕ"
@dp.message_handler(commands=['save'])
async def save_mes(message: types.message, command: Command):
await message.answer("запомню чо напишешь")
saved_messages=command.args
await message.answer(f"{command.args}")
@dp.message_handler(commands = ['aboba'])
async def messss(message: types.Message, command: Command):
if command.args:
await bot.send_message(-848649806,f"{command.args}")
else:
await message.answer('напиши что надо в чат')
# строка, чтобы отправить что-нибудь в группу
#await bot.send_message(-848649806, 'кто двинется тот натурал')
async def choose_your_dinner(text,id):
await bot.send_message(chat_id = id, text = str(ext)t)
async def scheduler():
#установка времени #выполнение функции
aioschedule.every().day.at("17:45").do(choose_your_dinner)
while True:
await aioschedule.run_pending()
await asyncio.sleep(1)
# подлючаемся к диспетчеру и создаем таск , о ожидании времени
async def on_startup(dp):
asyncio.create_task(scheduler())
#data = splited_mes[1].split('.').split(':').split('-')
# data[0] - day
# data[1] - месяц
#data[2] - year
#data[3] - hour
#data[4] - minuts
# НАВЗАНИЕ 21.10.2022:15-00 ЧАТА 2 текст
@dp.message_handler(commands = ['split'])
async def spliter(message: types.Message, command: Command):
if command.args:
await bot.send_message(-848649806, f"{command.args}")
splitted_mes=command.args.split()
if splitted_mes[0]=="test":
await bot.send_message(-848649806, splitted_mes[1])
elif splitted_mes[0]=="test2":
await bot.send_message(-822057952 , splitted_mes[1])
else:
await bot.send_message(f"фигню сморозил")
else:
await message.answer('напиши что надо в чат так: /split test(или test2) * чо хочш отправить *')
#запуск бота (в самый низ)
async def main():
await dp.start_polling(bot)
if name == "main":
asyncio.run(main())
if
executor.start_polling(on_startup=on_startup)