Open palashjhabak opened 3 years ago
I can't understand the SetMyCommandsAsync method can you show me one example, I'll try to register if not registered already.
@disha-2401 I just did a public search on github and got following example usages,
https://github.com/djohsson/Lastgram/blob/5e998265b01382e924b559034d19ae65d0a1f0b6/Lastgram/Bot.cs
I think its is pretty straightforward, try if its working.
It basically takes List
we can set command using this code
IEnumerable<BotCommand> commandsToBeSet = new BotCommand[]
{
new BotCommand{Command="week_profit",Description="get weekly profit"},
new BotCommand{Command="todays_profit",Description="get today's profit"},
new BotCommand{Command="remaining_limit",Description="get remaining limit"},
new BotCommand{Command="set_limit",Description="set limit of a user"},
};
botClient.SetMyCommandsAsync(commandsToBeSet);
as I mentioned earlier we can not use the pascal case in command naming. so we can use underscore instead
the SetMyCommandsAsync() method does not append commands in existing commands, it only updates the commands list. so whenever we call SetMyCommandsAsync() method we need to give a full list of BotCommands as a parameter.
the SetMyCommandsAsync() method does not append commands in existing commands, it only updates the commands list. so whenever we call SetMyCommandsAsync() method we need to give a full list of BotCommands as a parameter.
ohh ok. Still works for us.
when service starts and we find that some commands are not yet registered we should register it
7
have this and #9 in a separate feature branch and start a pull request when you are done @disha-2401