Skip to content

Commit 5679cc0

Browse files
authored
Add scripts/ folder with debug scripts (Python) (#12)
* Add debug scripts in Python to help bot development * Add scheme to set bot commands via API * Update lelerax commands * Rename debug to scripts: makes more sense
1 parent fbab488 commit 5679cc0

File tree

4 files changed

+48
-0
lines changed

4 files changed

+48
-0
lines changed

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,3 +20,4 @@
2020
/kills.txt
2121
*.mypy_cache
2222
*.coverage
23+
/run.sh

scripts/.gitignore

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
.venv
2+
.mypy_cache
3+
token.txt

scripts/debug.py

Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
# coding: utf-8
2+
3+
from telepot import Bot
4+
from pprint import pprint
5+
6+
bot = Bot(open("token.txt").read().strip())
7+
8+
9+
def get_chat_debug():
10+
users = {
11+
"lerax": 336558555,
12+
"tretanews": 430571154,
13+
}
14+
15+
chats = {
16+
"commonlispbr": -1001280636766,
17+
"commonlisphq": -1001493125566,
18+
}
19+
20+
chat_member = bot.getChatMember(chats["commonlisphq"],
21+
users["tretanews"])
22+
print()
23+
pprint(chat_member)
24+
25+
26+
def set_bot_commands():
27+
commands = [
28+
{
29+
"command": "kills",
30+
"description": "Retorna a quantidade de trolls decapitados."
31+
},
32+
{
33+
"command": "ping",
34+
"description": "Verifica se estou vivo. Se eu não responder já sabe."
35+
},
36+
{
37+
"command": "pass",
38+
"description": "Commando de passe /pass <@username>. Exclusivo para admins do @commonlispbr."
39+
}
40+
]
41+
42+
bot.setMyCommands(commands)
43+
pprint(bot.getMyCommands())

scripts/requirements.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
telepot @ git+https://github.com/ryukinix/telepot.git#egg=telepot

0 commit comments

Comments
 (0)