From 8676f069d3f331d5c5176dfe3956371a8c0771a6 Mon Sep 17 00:00:00 2001 From: Frost Ming Date: Tue, 12 Dec 2023 14:43:09 +0800 Subject: [PATCH] fix: command list Signed-off-by: Frost Ming --- hy_tg.py | 14 +++++--------- 1 file changed, 5 insertions(+), 9 deletions(-) diff --git a/hy_tg.py b/hy_tg.py index 4d28a13..8bb95d1 100644 --- a/hy_tg.py +++ b/hy_tg.py @@ -15,7 +15,7 @@ from prettymapp.osm import get_osm_geometries from prettymapp.plotting import Plot as PrettyPlot from prettymapp.settings import STYLES from telebot import TeleBot # type: ignore -from telebot.types import Message # type: ignore +from telebot.types import BotCommand, Message # type: ignore PIL.Image.MAX_IMAGE_PIXELS = 933120000 MAX_IN_MEMORY = 10 * 1024 * 1024 # 10MiB @@ -98,14 +98,10 @@ def main(): bot = TeleBot(options.tg_token) bot.set_my_commands( [ - { - "command": "github", - "description": "github poster: /github [-]", - }, - { - "command": "map", - "description": "pretty map: /map
", - }, + BotCommand( + "github", "github poster: /github [-]" + ), + BotCommand("map", "pretty map: /map
"), ] ) print("Bot init done.")