Skip to content

Commit 865f82d

Browse files
committed
Docs update
1 parent 8ea92d5 commit 865f82d

File tree

5 files changed

+271
-20
lines changed

5 files changed

+271
-20
lines changed

.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -126,3 +126,5 @@ dmypy.json
126126
# app
127127
.vsls.json
128128
.vscode
129+
130+
# custom file

bot/config.py

Lines changed: 10 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1,37 +1,30 @@
11
# Bot configuration file
22
# ======================
3-
bot_token = '621843590:AAGURba__YpuximGPR0a5_x3-DwFph14-Io'
4-
bot_username = 'pythonandroidbot'
5-
bot_id = '621843590'
6-
log_channel = -1001323415459 #38201859 me
3+
bot_token = 'TOKEN'
4+
bot_username = 'username'
5+
bot_id = '0000000'
6+
log_channel = -123456789
77
language = 'it' #check 'strings.ini' file
8-
OWNER_LIST= [38201859,605363037]
9-
LIST_OF_ADMINS = [38201859, 77420618, 147276542, 400836959, 880456922]
10-
COLLABORATORS = [69991922]
8+
OWNER_LIST= [123456,3456789]
9+
LIST_OF_ADMINS = [12345, 111111, 22222]
10+
COLLABORATORS = [12345667]
1111
TITLES = ['creator', 'administrator'] #do not change
1212
# =======================
1313

14-
# Plugins
15-
# =======================
16-
covid_19_report = [-1001264240585, 38201859]
17-
weather_report = [-1001264240585, 38201859]
18-
weather_api = '772340c8970fe60a021d5608462b2ec9'
19-
# =======================
2014

2115
# Chat controls
2216
# =======================
23-
bad_words = ['porco dio', 'porca madonna'] #messages with this words will be deleted
17+
bad_words = ['word1', 'word2'] # messages with this words will be deleted
2418
# =======================
2519

2620

2721
# URL Filter
2822
# =======================
29-
#url_denylist = ["amzn.to", "t.me"]
3023
url_denylist = ["t.me"]
3124
url_whitelist = ["t.me/googlepixelit", "t.me/aospitalia", "t.me/aospitaliashop", "t.me/pixelwatchitalia", "t.me/googlepixelitchannel"]
3225

3326
# Market id
34-
mercatino = -1001160935294
27+
mercatino = -12345678
3528

3629

37-
admin_group = -1001323415459
30+
admin_group = -1234567

docs/code.md

Lines changed: 81 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,81 @@
1+
# Code
2+
3+
4+
## Structure overview
5+
6+
```shell
7+
.
8+
├── bot.py
9+
├── commands
10+
│   ├── __init__.py
11+
│   ├── admin
12+
│   │   ├── __init__.py
13+
│   │   ├── annuncio.py
14+
│   │   ├── autoban.py
15+
│   │   ├── autokick.py
16+
│   │   ├── ban.py
17+
│   │   ├── check.py
18+
│   │   ├── delete.py
19+
│   │   ├── get.py
20+
│   │   ├── kick.py
21+
│   │   ├── leave.py
22+
│   │   ├── mute.py
23+
│   │   ├── night.py
24+
│   │   ├── nuke.py
25+
│   │   ├── pin.py
26+
│   │   ├── say.py
27+
│   │   ├── slow.py
28+
│   │   ├── unban.py
29+
│   │   └── unmute.py
30+
│   ├── index.py
31+
│   └── user
32+
│   ├── __init__.py
33+
│   ├── help.py
34+
│   ├── me.py
35+
│   ├── rules.py
36+
│   ├── source.py
37+
│   └── start.py
38+
├── config.py
39+
├── dialogs
40+
│   ├── __init__.py
41+
│   ├── images.py
42+
│   ├── main.py
43+
│   ├── misc
44+
│   │   ├── __init__.py
45+
│   │   ├── answers.py
46+
│   │   ├── definisci.py
47+
│   │   ├── handler.py
48+
│   │   └── random_answer.py
49+
│   ├── rules
50+
│   │   ├── __init__.py
51+
│   │   ├── admin_tag.py
52+
│   │   ├── bad_words.py
53+
│   │   ├── main.py
54+
│   │   ├── market.py
55+
│   │   ├── non_latin_filter.py
56+
│   │   └── urlfilter.py
57+
│   └── welcome.py
58+
├── errors
59+
│   ├── __init__.py
60+
│   ├── callback_error.py
61+
│   └── log.py
62+
├── functions
63+
│   ├── __init__.py
64+
│   ├── arabic_characters.py
65+
│   ├── chinese_characters.py
66+
│   ├── custom_spam.py
67+
│   ├── general.py
68+
│   └── russian_characters.py
69+
├── plugins
70+
│   ├── __init__.py
71+
│   └── weather.py
72+
├── settings.ini
73+
├── slowmode.ini
74+
├── strings.ini
75+
└── utils
76+
├── __init__.py
77+
└── decorator.py
78+
79+
10 directories, 60 files
80+
81+
```

docs/home.md

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,9 +10,8 @@
1010
- [Start the bot](./quickstart.md#first-start)
1111
- [Hosting](./quickstart.md#hosting)
1212
- [How to use]()
13-
- [Initial setup]()
14-
- [Commands]()
15-
- [Other handlers]()
13+
- [Initial setup](./howtouse.md#setup)
14+
- [Commands](./howtouse.md#commands)
1615
- [Code]()
1716
- [Organization]()
1817
- [Add functions and commands]()

docs/howtouse.md

Lines changed: 176 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,176 @@
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

Comments
 (0)