Elepover / pmcenter

A Telegram bot helping you process private messages.
https://pmcenter.itsmy.app
Apache License 2.0
145 stars 34 forks source link

BotId cannot exceed int32 (2147483648) #44

Open VCStardust opened 2 years ago

VCStardust commented 2 years ago

Describe the bug Cannot start when BotId exceeds int32 (2147483648).

To Reproduce Create a new bot, fill its token into the configuration file, start.

Expected behavior Just run.

Logs [CORE][ERROR] Unexpected error during startup: System.ArgumentException: Invalid format. A valid token looks like "1234567:4TT8bAc8GHUspu3ERYn-KGcvsvGB9u_n4ddy". (Parameter 'token') at Telegram.Bot.TelegramBotClient..ctor(String token, IWebProxy webProxy) at pmcenter.Program.MainAsync(String[] args) in <hidden>\pmcenter\Program.cs:line 195

Additional context In int.TryParse(string s, out int result), if the content of s exceeds int32, result will be 0

fernvenue commented 2 years ago

That's true, same thing happened when I try a new bot.

rde9 commented 2 years ago

@VCStardust @fernvenue Please refer to https://github.com/JasonKhew96/pmcenter/tree/fix which solved the problem with updated dependencies. Thanks for their work.

fernvenue commented 2 years ago

@VCStardust @fernvenue Please refer to https://github.com/JasonKhew96/pmcenter/tree/fix which solved the problem with updated dependencies. Thanks for their work.

Good to know, thank you.

VCStardust commented 2 years ago

@VCStardust @fernvenue Please refer to https://github.com/JasonKhew96/pmcenter/tree/fix which solved the problem with updated dependencies. Thanks for their work.

OK, thanks.