|
| 1 | +# How to use |
| 2 | + |
| 3 | +**Home page**: [Home page](./home.md) |
| 4 | + |
| 5 | +**Previous**: [Quick start](./quickstart.md) |
| 6 | + |
| 7 | +## Setup |
| 8 | + |
| 9 | +You will need to edit the [config.py](../bot/config.py) file |
| 10 | +```python |
| 11 | +# Bot configuration file |
| 12 | +# ====================== |
| 13 | +bot_token = 'TOKEN' |
| 14 | +bot_username = 'username' |
| 15 | +bot_id = '0000000' |
| 16 | +log_channel = -123456789 |
| 17 | +language = 'it' #check 'strings.ini' file |
| 18 | +OWNER_LIST= [123456,3456789] |
| 19 | +LIST_OF_ADMINS = [12345, 111111, 22222] |
| 20 | +COLLABORATORS = [12345667] |
| 21 | +TITLES = ['creator', 'administrator'] #do not change |
| 22 | +# ======================= |
| 23 | + |
| 24 | + |
| 25 | +# Chat controls |
| 26 | +# ======================= |
| 27 | +bad_words = ['word1', 'word2'] # messages with this words will be deleted |
| 28 | +# ======================= |
| 29 | + |
| 30 | + |
| 31 | +# URL Filter |
| 32 | +# ======================= |
| 33 | +url_denylist = ["t.me"] |
| 34 | +url_whitelist = ["t.me/googlepixelit", "t.me/aospitalia", "t.me/aospitaliashop", "t.me/pixelwatchitalia", "t.me/googlepixelitchannel"] |
| 35 | + |
| 36 | +# Market id |
| 37 | +mercatino = -12345678 |
| 38 | + |
| 39 | + |
| 40 | +admin_group = -1234567 |
| 41 | + |
| 42 | +``` |
| 43 | + |
| 44 | +Then edit your [string.ini](../bot/strings.ini) and [settings.ini](../bot/settings.ini) |
| 45 | + |
| 46 | +## Commands |
| 47 | +This is the complete list of available commands and functions. |
| 48 | + |
| 49 | +### Banning and kicking users (and unban) |
| 50 | + |
| 51 | +<i>For both ban and kick command you can also pass the "ban reason" as argument</i> |
| 52 | + |
| 53 | +- Reply to a message with [/ban]() to ban the user who sent the message. It **doesn't work** with usernames or user_id ("/ban @username") |
| 54 | + |
| 55 | +- If you want to ban with style, you can [/nuke]() a user! (Reply to a message with this command). Authorization will be requested via a button and after a countdown a nuke will be dropped. |
| 56 | + |
| 57 | +- To unban a user just reply to a message with [/unban](). |
| 58 | + |
| 59 | +- To kick a user reply to a message (from that user) with [/kick]() |
| 60 | + |
| 61 | +- To kick or ban an user with a delay of 60 seconds to let him/her know the ban/kick reason you can reply to a message using: |
| 62 | + - [/autokick]() [reason] |
| 63 | + - [/autoban]() [reason] |
| 64 | + |
| 65 | + |
| 66 | +### Mute users (and unmute) |
| 67 | +<i>For every command you can also pass telegram_id as argument without replying to a message.</i> |
| 68 | + |
| 69 | +- Reply to a message with [/mute]() to mute the user who sent the message. |
| 70 | +- To unmute a user just reply to a message with [/unmute](). |
| 71 | + |
| 72 | +### Pin a message |
| 73 | + |
| 74 | +- Reply to a message with [/pin]() |
| 75 | +- Use "[/saypin]() _[text]_" to let the bot write and pin the "_[text]_" message |
| 76 | + |
| 77 | +### Delete a message |
| 78 | + |
| 79 | +- Reply to a message with [/del]() to delete it. |
| 80 | + |
| 81 | +### Night mode |
| 82 | + |
| 83 | +- Use [/night]() or [/silence]() command to update users settings (can't send messages and media). It will also appear a button to disable the night/silence mode. |
| 84 | + |
| 85 | +### Slow mode (custom, not like Telegram) |
| 86 | + |
| 87 | +Slow mode is a custom rule that let users send only a certain number of consecutive messages, after that the user who sent too many messages will be muted for a certain amounth of time. |
| 88 | + |
| 89 | +To activate it use |
| 90 | +```[/slow]() [messages] [time]``` |
| 91 | + |
| 92 | +<i>[/slow]() 3 30: after 4 consecutive messages the user will be muted for 30 seconds</i> |
| 93 | + |
| 94 | + |
| 95 | +- [/slow]() 1 5 60 |
| 96 | + - activate slow mode |
| 97 | + - msg_num=5 |
| 98 | + - seconds=60 |
| 99 | + |
| 100 | +- [/slow]() 1 5 |
| 101 | + - equivalent to [/slow]() 1 5 30 |
| 102 | + |
| 103 | +- [/slow]() 0 |
| 104 | + - equivalent to [/slow]() 0 3 30 (here 3 and 30 are meaningless, whatever value is ok for both) |
| 105 | + |
| 106 | +- [/slow]() |
| 107 | + - equivalent to [/slow]() 1 3 30 |
| 108 | + |
| 109 | +- [/slow]() -ls |
| 110 | + - shows settings applied in a group |
| 111 | + |
| 112 | +### Get |
| 113 | + |
| 114 | +Reply to a message with [/get]() to obtain detailed information about the message, like telegram_id and message_id. |
| 115 | + |
| 116 | +### Check permission |
| 117 | +To check if the bot has the correct permissions on your group use [/check]() command. |
| 118 | +The correct output is: |
| 119 | + |
| 120 | +``` |
| 121 | +Check permissions |
| 122 | +
|
| 123 | +can_restrict_members: ✅ |
| 124 | +can_delete_messages: ✅ |
| 125 | +can_pin_messages: ✅ |
| 126 | +``` |
| 127 | + |
| 128 | +### Start |
| 129 | +[/start]() command will display a default start message. |
| 130 | + |
| 131 | +### Help |
| 132 | +[/help]() command will show this documentation about the bot. |
| 133 | + |
| 134 | +### Rules |
| 135 | +[/rules]() command will display the group rules. |
| 136 | + |
| 137 | +### Me |
| 138 | +[/me]() command will show detailed info about the user who typed the command. |
| 139 | + |
| 140 | +### Source |
| 141 | +[/source]() command will show the GitHub link of the bot repository. |
| 142 | + |
| 143 | + |
| 144 | +## Functions |
| 145 | + |
| 146 | +### Welcome |
| 147 | +The bot will display a welcome message to new users who join the group. (currently not working with Telegram topics) |
| 148 | + |
| 149 | +#### New user filters |
| 150 | +The bot will automatically check if the new user ```first_name``` contains Chinese, Japanese, Russian or Arabs characters and if the user has no ```username``` it will be automatically blocked. |
| 151 | + |
| 152 | +**⚠️ Not Racism! ⚠️**<br> |
| 153 | +In several non-global groups a lot of userbots join with chinese/arabic names (and no username) only for **spamming/scamming** |
| 154 | + |
| 155 | +#### Different welcome |
| 156 | +You can set different welcomes based on ```telegram_chat_id```, see ```dialogs/welcome.py``` |
| 157 | + |
| 158 | +### Custom chat filters |
| 159 | +Our bot can also block banned words, banned links and banned characters or languages (also on images). See ```settings.ini``` file. |
| 160 | + |
| 161 | +### Admin tag |
| 162 | +You can use @admin tag to send a report to the admin group (you can set it in the config file) |
| 163 | + |
| 164 | +### Misc |
| 165 | + |
| 166 | +#### Custom answers |
| 167 | +You can set custom question and answers, check ```dialogs/misc``` folder. (text is currently in italian) |
| 168 | + |
| 169 | +#### Wikipedia search |
| 170 | +In italian "Google cerca [something]" that stands for "Google search [something]" will provide Wikipedia information about [something] |
| 171 | + |
| 172 | + |
| 173 | + |
| 174 | + |
| 175 | + |
| 176 | +**Next**: [Code](./code.md) |
0 commit comments