add set commands,refactor service.py

This commit is contained in:
Rykov7
2023-04-12 19:11:03 +03:00
parent 19395e4e37
commit b7ed7bc45d
3 changed files with 33 additions and 7 deletions
+25
View File
@@ -1,6 +1,8 @@
import os
import re
import logging
import telebot.types
from flask import Flask
from telebot import TeleBot, logger, types
from dotenv import load_dotenv
@@ -97,3 +99,26 @@ ZEN = [
"If the implementation is easy to explain, it may be a good idea.",
"Namespaces are one honking great idea — let's do more of those!",
]
for white_id in WHITEIDS:
bot.set_my_commands(
commands=[
telebot.types.BotCommand("nobot", "/нобот Телебот не должен быть первым проектом"),
telebot.types.BotCommand("nogui", "/ногуи GUI приложение не должно быть первым проектом"),
telebot.types.BotCommand("nojob", "/ноджоб, Мы здесь не для того чтобы за тебя решать задачи"),
telebot.types.BotCommand("nometa", "/номета Не задавайте мета-вопросов"),
telebot.types.BotCommand("neprivet", "/непривет"),
telebot.types.BotCommand("quote", "/цитата Случайная цитата"),
telebot.types.BotCommand("lutz", "/лутц Прислать книгу Learning Python"),
telebot.types.BotCommand("bdmtss", "/бдмтсс Римшот"),
telebot.types.BotCommand("g", "/г Загуглить (аргументы или цитируемое)"),
telebot.types.BotCommand("rules", "/правила чата (работает с аргументом-номером пункта)"),
telebot.types.BotCommand("faq", "/чзв Частые вопросы"),
telebot.types.BotCommand("books", "/библиотека питониста"),
telebot.types.BotCommand("links", "/ссылки на правила, чзв и библиотеку"),
telebot.types.BotCommand("tsya", "/тся и /ться"),
telebot.types.BotCommand("add", "добавить цитату [Whitelist]"),
telebot.types.BotCommand("remove", "удалить цитату [Whitelist]"),
],
scope=telebot.types.BotCommandScopeChatMember(PYTHONCHATRU, white_id)
)