Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add "Forbidden: bot was kicked from the group chat" exception #2

Open
karb0f0s opened this issue May 11, 2018 · 7 comments
Open

Add "Forbidden: bot was kicked from the group chat" exception #2

karb0f0s opened this issue May 11, 2018 · 7 comments
Assignees

Comments

@karb0f0s
Copy link
Member

From @karb0f0s on April 4, 2018 11:32

HTTP code: 403
Error message:

  • Forbidden: bot was kicked from the group chat exception
  • Forbidden: bot was kicked from the group channel exception
  • Forbidden: bot was kicked from the group supergroup exception

You receive this error if you add bot to group, remove it, and try to send message to that group afterwards

Copied from original issue: TelegramBots/Telegram.Bot#662

@karb0f0s
Copy link
Member Author

I see two possible test runs for this exception:

  • user should remove bot from test chat before excecution (and add back after)
  • create some BotBlockedChat and add/remove bot from there (i created two chats, deleted them, but I still receive this error when send messages)

@karb0f0s
Copy link
Member Author

For my test case I created 3 groups in which I added and then removed my testbot:

long[] groups =
{
  -1001100532129, // BotBlockedSupergroup
  -1001298749133, // BotBlockedGroup
  -262679471, // BotBlockedChannel
};

after upgrading BotBlockedSupergroup from regular group to supergroup I caught a Bad Request: group chat was upgraded to a supergroup chat error

@karb0f0s
Copy link
Member Author

I'd like to commit the tests with fixed chatIds, and maybe move them to settings/class fixture later. Is this appropriate?

@karb0f0s
Copy link
Member Author

From @tuscen on April 4, 2018 13:55

I'm okay with more interactivity during integ tests because some of them couldn't really be done either without more configs (several group chats and channels for different tests, etc) or without user interaction. But @pouladpld have different opinion on this.

@karb0f0s
Copy link
Member Author

@tuscen Sergey Khabibullin unofficially created a wrapper classes for TDLib and published them as NuGet package TDLib.
I'm planning to add Telegram client features to tests, so we do not have to wait for user interactions, but send actions through TDLib.

@karb0f0s
Copy link
Member Author

From @tuscen on April 4, 2018 14:48

@karb0f0s Nice. It would be super helpful 👍

@mihailmariusiondev
Copy link

Any news for this?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants