add update bot's commands on every start and added only for creator mode

This commit is contained in:
2026-01-18 17:39:30 +03:00
parent 2362b9dba1
commit c31345a3eb
3 changed files with 17 additions and 1 deletions
+11 -1
View File
@@ -170,11 +170,21 @@ async function main() {
`MAX_PHOTO_SIZE: ${Environment.MAX_PHOTO_SIZE}`
);
const commands = chatCommands.filter(cmd => {
return cmd.title && cmd.title.startsWith("/") && cmd.title.split(" ").length === 1 && cmd.description;
}).map(cmd => {
return {
command: cmd.title.toLowerCase(),
description: cmd.description,
};
});
try {
const results = await Promise.all(
[
initSystemSpecs(), readData(), retrieveAnswers(),
bot.getMe()
bot.getMe(),
bot.setMyCommands({commands: commands, scope: {type: "default"}})
]
);
botUser = results[3];