python 2.7
required, as well aspip
module.- clone this repository
pip install -r requirements.txt
to fullfill dependencies.
You can find a config template here: conf/watchdog.conf.example
Following are description for each section in config file
token = 111111111:AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA name = @usernameofyourbot
token should be the token of bot you got from @botfather
name should be the username of your token, don't miss @
-1000000000001 = anotherpuzzle.json -1000000000001 = nopuzzle
If Groups doesn't have puzzle file, the following commands will use the group's name as default.
puzzle file must use json as extension
puzzle file format example: _data/11111111111111.json.example
format groupid = puzzle file path
If puzzle file path is a relative path, then the current directory is the working directory where the bot started.
Have to use UTF-8 encoding to save it
The user who has the rights to change config. Format: userid = Remark
The user who has the rights to change data. Format: userid = Remark
The users who send the following type of files will be banned automatically,
Format: .filetype = Remark
The keywords that scammers possibly use,
Format: Keywords = Remark
After set the conf file,
Please make sure the current user has the WRITE rights to the folder _data
Run the following command
python community.py [config file]
Run the log output to stderr, possibly need redirect
-
When the Community Bot detects a new user join in the group(which has correctly configured the puzzle file, and the bot has READ rights in this group). The bot will temporary ban the new user (needs BAN rights), and ask the new user to take a quiz (needs Send Message rights). The bot will allow the user to join in after he/she complete the quiz successfully. Otherwise it will ban the user if he/she has not finished the quiz in a certain time period.
-
/supervise dataadmin could reply to a user in the group(which has the Bot), and if this user is not in the 'groups' config, this user will be added to the 'groups' config.
-
/dataadmin confadmin could reply to a user in the group(which has the Bot), and this user will become dataadmin.
-
/start watchdog function, user PM the Bot in order to take a quiz.
-
/replybanall dataadmin or confadmin could use this command to ban the user(that has been replied) in ALL groups that under this admin's jurisdiction. And add this user to black list.
-
/fwdbanall
dataadmin or confadmin could use this command to ban the forwarded user in ALL groups that under this admin's jurisdiction. And add this user to black list. -
/idbanall <userid>
dataadmin or confadmin could use this command to ban the userid in ALL groups that under this admin's jurisdiction. And add this userid to black list. -
/reload
confadmin could PM the Bot to use this command to reload config files(and config the data files in the config files). -
/points
Check your self points in the current group. -
/rank
dataadmin check the top 10 ranking. -
/clearpoints
confadmin clear all points in the current group. -
/clean
confadmin clear the hidden tasks, and after that please stop the Bot immediately. -
/punish
group admin, confadmin or dataadmin could clear user's points to punish the user. -
/broadcastee <Group Name>
call this command in group to add this group as broadcastee in certain group