vova-lantsov-dev / telegram-bot-helper

.NET library to reduce development time of telegram bots.
MIT License
15 stars 1 forks source link

Callback queries with unknown parameters #1

Closed soend closed 5 years ago

soend commented 5 years ago

Hei, im having trouble getting this to work. Maybe you can point me to right direction. I have callback query datepicker~{year}~{month}~{day}. So i followed the example and have it set up:

i["datepicker~ "] = async (q, c, _) =>
{
     ... do something.
};

What could i be doing wrong?

soend commented 5 years ago

I think i figured out the issue. When registering inline action with 3 unknown parameters it should look like this:

i["datepicker~ ~ ~ "] = async (q, c, _) =>
{
     ... do something.
};

And also there is bug here: https://github.com/vova-lantsov-dev/telegram-bot-helper/blob/7bb6eb3924aad9dbcbac86ed18d230e590d07dcc/InlineCommand.cs#L32

Correct should be like this: if (string.IsNullOrWhiteSpace(valueToCompareWith.Commands[commandIndex]))

vova-lantsov-dev commented 5 years ago

@soend yes, you are right, this bug is already fixed and will be resolved in next release