Random Coffee alternative - random meetings for Telegram chats https://t.me/ranteabot
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

35 lines
1.0 KiB

2 years ago
from bot import Bot
def views(bot: Bot):
@bot.handle_commands(['/start'])
def handle_start(msg, _user, _args):
bot.reply_with_template(msg, 'start')
@bot.handle_commands(['/help', ' About', ' О боте'])
def handle_help(msg, _user, _args):
bot.reply_with_template(msg, 'help')
@bot.handle_commands(['/send_all'])
def send_spam(msg, user, _args):
if not user.is_admin():
return
def handler(msg_1):
bot.send_all_copy(msg_1)
bot.send_message(msg.chat.id, 'Send the message')
bot.register_next_step_handler(msg, handler)
@bot.handle_commands(['/all_stats'])
def all_stats(msg, user, _args):
if not user.is_admin():
return
stats = bot.stats()
bot.reply_with_template(msg, 'admin_stats', stats=stats)
@bot.handle_commands(['🛑 Cancel', '🛑 Отменить'])
def cancel_creation(msg, _user, _args):
bot.clear_step_handler_by_chat_id(msg.chat.id)
bot.reply_with_template(msg, 'canceled')