Revert "set bot command"

This reverts commit a0c48d505e.
This commit is contained in:
BennyThink 2022-06-26 12:27:08 +08:00
parent a0c48d505e
commit 01a6a86539
No known key found for this signature in database
GPG Key ID: 6CD0DBDA5235D481
4 changed files with 4 additions and 20 deletions

View File

@ -225,7 +225,7 @@ docker-compose -f worker.yml up -d
# Command
```cmd
```
start - Let's start
about - What's this bot?
ping - Bot running status

View File

@ -19,4 +19,4 @@ requests==2.28.0
tqdm==4.64.0
requests-toolbelt==0.9.1
ffpb==0.4.1
youtube-search-python==1.6.6
youtube-search-python==1.6.6

View File

@ -8,8 +8,6 @@
__author__ = "Benny <benny.think@gmail.com>"
import os
import pathlib
import re
import time
from config import (AFD_LINK, COFFEE_LINK, ENABLE_CELERY, ENABLE_VIP, EX,
@ -151,7 +149,3 @@ Sending format: **{1}**
text += f"{status}{hostname} **{active}** {load} {rev}\n"
return text
with open(pathlib.Path(__file__).parent.parent.joinpath("README.md"), encoding="u8") as f:
COMMANDS = re.findall(r"```cmd([\s|\S]*)```", f.read())[0].strip()

View File

@ -15,19 +15,18 @@ import time
import traceback
import typing
from io import BytesIO
from youtubesearchpython import VideosSearch
import pyrogram.errors
from apscheduler.schedulers.background import BackgroundScheduler
from pyrogram import Client, filters, types
from pyrogram.errors.exceptions.bad_request_400 import UserNotParticipant
from pyrogram.types import InlineKeyboardButton, InlineKeyboardMarkup
from tgbot_ping import get_runtime
from youtubesearchpython import VideosSearch
from client_init import create_app
from config import (AUTHORIZED_USER, ENABLE_CELERY, ENABLE_VIP, OWNER,
REQUIRED_MEMBERSHIP)
from constant import COMMANDS, BotText
from constant import BotText
from db import InfluxDB, MySQL, Redis
from limit import VIP, verify_payment
from tasks import app as celery_app
@ -388,13 +387,4 @@ By @BennyThink, VIP mode: {ENABLE_VIP}, Distribution: {ENABLE_CELERY}
Version: {get_revision()}
"""
print(banner)
with app:
commands = [i for i in COMMANDS.split("\n") if i]
command_list = []
for cmd in commands:
split = cmd.split("-")
command_list.append(pyrogram.types.BotCommand(split[0].strip(), split[1].strip()))
app.set_bot_commands(command_list)
app.run()