1

I'm using .NET 5.0, and have installed a pack of Telegram.Bot v17.0.0-alpha.3.

When I tried to write an argument as MessageEventArgs type I couldn't find this class. There're only two classes in the namespace Telegram.Bot.Args, like ApiRequestEventArgs and ApiResponseEventArgs.

What can I do to fix this issue?

Roman Marusyk
  • 23,328
  • 24
  • 73
  • 116

2 Answers2

1

The MessageEventArgs was marked as obsolete since v16.0.0 with the following message:

This class will be removed in the next major version. Please consider using Telegram.Bot.Extensions.Polling instead.

So, the MessageEventArgs has been removed in the release of version 17.0.0-alpha.1

Roman Marusyk
  • 23,328
  • 24
  • 73
  • 116
0

After their update to 17.0.0, there are some changes. For your issue, do the following: Instead of using:

MessageEventArgs e

Use with:

Update update

Just do not forget to add using of:

using Telegram.Bot.Types;

And of course wherever you have for example:

e.Message.Chat.Id

Change it to:

update.Message.Chat.Id

Good luck