-
Notifications
You must be signed in to change notification settings - Fork 0
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
Feature: troll shield anti ban system #2
Conversation
This is important because if the targer trollHouse banned this bot, it will fail to find troll with this error: { "description": "Forbidden: bot was kicked from the supergroup chat", "error_code": 403, "ok": false } However, if we use a hidden bot (unknown from trolls) to only make this request, it works pretty fine. After all, they never will know which bot to ban to stop the troll-shield.
Codecov Report
@@ Coverage Diff @@
## master #2 +/- ##
===========================================
+ Coverage 60.00% 78.98% +18.98%
===========================================
Files 1 1
Lines 110 138 +28
===========================================
+ Hits 66 109 +43
+ Misses 44 29 -15
Flags with carried forward coverage won't be shown. Click here to find out more.
Continue to review full report at Codecov.
|
Although this works as expected, this MR do not have yet proper unit tests. For that reason, I'll not merge a ready and I'll launch only a release-candidate version. |
5c9972b
to
a1d451e
Compare
} | ||
|
||
func leaveChat(bot TrollShieldBot, update *telegram.Update, trollGroup string) { | ||
reply(bot, update, "Nesse grupo há trolls. Dou-me a liberdade de ir embora. Adeus.") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I like this message. Nice
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
Changelog
Add secondary bot setup to only make findTrollHouses request
This is important because if the target trollHouse banned this bot, it
will fail to find troll with this error:
However, if we use a hidden bot (unknown from trolls) to only make
this request, it works pretty fine. After all, they never will know
which bot to ban to stop the troll-shield.
This feature is optional and it's enabled automatically when the env var
TELEGRAM_BOT_HIDDEN_TOKEN
is available.Add leaveChat events when troll-shield is on trollGroups
Now the bot will leaves the chat when happens this events: