You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
WORK IN PROGRESS, DO NOT CLOSE! Once I am finished the details here, you can comment. I am done editing stuff and feel free to review it.
About the Issue
Integrating it with SpamWatch on joins is good, but can we extend SpamWatch on the following suggestions:
Checking the SpamWatch banlist status for user XXYYZZAABBCC when triggered the /user.
Adding a way for admins to interact with the SpamWatch API without ever add extra code on their forks (adding a new /spamwatch command).
First Suggestion: Manually checking status of a user when admins triggered /user
When an admin triggers the /user command for user XXYYZZAABBCC, the server/machine where the bot is hosted should contact the SpamWatch API (defaults to api.spamwat.ch if undefined in config.js/config.json) for the status of the user if he/she is banned.
When checking for the ban status using this method, use the defined API token in the config as SPAMWATCH_API_TOKEN.
Second Suggestion: Adding new way of interacting the API without extra lines of code
This suggestion will add a new command for that, /spamwatch. The usage of that command describes below as it says. See the SpamWatch API docs for details.
Due to some restrictions and feedback from @SitiSchu, I removed and excluded some stuff that requires token management or editing the banlist.
Command
Fields
Description
Example
/spamwatch banlist
n/a
Get the full banlist, requires the Root permission.
spamwatch banlist
/spamwatch query
<uid or username>
Checks whatever the user is banned. Can be used in replies and use user <uid, username or reply> as shortcut
/spamwatch query 777000
/spamwatch about
<token>
Get API version of SpamWatch an number of active bans.
/spamwatch about
/spamwatch docs
n/a
Get the SpamWatch documentation link.
No usage example, because there's no fields needed.
Legends:
< > = Required
[ ] = optional
Notes
XXYYZZAABBCC represents a Telegram user's unique ID, generated after signup per user.
SPAMWATCH_API_TOKEN represents a valid, working SpamWatch API token. The API token should be there in the config file instead of manually sending it to the bot.
Because the ban list is SOOO LARGE and CONSTANTLY UPDATED, the bot server should cache the API response once every 6 hours unless --force flag is used and send the response as a JSON file.
The text was updated successfully, but these errors were encountered:
Having a command for the API documentation still doesn't make sense
The query command is kinda superfluous if /user shows the status anyway
No real reason to get the entire banlist with a bot command either
About the Issue
Integrating it with SpamWatch on joins is good, but can we extend SpamWatch on the following suggestions:
XXYYZZAABBCC
when triggered the/user
./spamwatch
command).First Suggestion: Manually checking status of a user when admins triggered
/user
When an admin triggers the
/user
command for userXXYYZZAABBCC
, the server/machine where the bot is hosted should contact the SpamWatch API (defaults toapi.spamwat.ch
if undefined inconfig.js
/config.json
) for the status of the user if he/she is banned.When checking for the ban status using this method, use the defined API token in the config as
SPAMWATCH_API_TOKEN
.Second Suggestion: Adding new way of interacting the API without extra lines of code
This suggestion will add a new command for that,
/spamwatch
. The usage of that command describes below as it says. See the SpamWatch API docs for details./spamwatch banlist
spamwatch banlist
/spamwatch query
<uid or username>
user <uid, username or reply>
as shortcut/spamwatch query 777000
/spamwatch about
<token>
/spamwatch about
/spamwatch docs
Legends:
< >
= Required[ ]
= optionalNotes
XXYYZZAABBCC
represents a Telegram user's unique ID, generated after signup per user.The API token should be there in the config file instead of manually sending it to the bot.SPAMWATCH_API_TOKEN
represents a valid, working SpamWatch API token.--force
flag is used and send the response as a JSON file.The text was updated successfully, but these errors were encountered: