-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
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
- Loading branch information
Showing
4 changed files
with
48 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -20,3 +20,4 @@ | |
/kills.txt | ||
*.mypy_cache | ||
*.coverage | ||
/run.sh |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
.venv | ||
.mypy_cache | ||
token.txt |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
# coding: utf-8 | ||
|
||
from telepot import Bot | ||
from pprint import pprint | ||
|
||
bot = Bot(open("token.txt").read().strip()) | ||
|
||
|
||
def get_chat_debug(): | ||
users = { | ||
"lerax": 336558555, | ||
"tretanews": 430571154, | ||
} | ||
|
||
chats = { | ||
"commonlispbr": -1001280636766, | ||
"commonlisphq": -1001493125566, | ||
} | ||
|
||
chat_member = bot.getChatMember(chats["commonlisphq"], | ||
users["tretanews"]) | ||
print() | ||
pprint(chat_member) | ||
|
||
|
||
def set_bot_commands(): | ||
commands = [ | ||
{ | ||
"command": "kills", | ||
"description": "Retorna a quantidade de trolls decapitados." | ||
}, | ||
{ | ||
"command": "ping", | ||
"description": "Verifica se estou vivo. Se eu não responder já sabe." | ||
}, | ||
{ | ||
"command": "pass", | ||
"description": "Commando de passe /pass <@username>. Exclusivo para admins do @commonlispbr." | ||
} | ||
] | ||
|
||
bot.setMyCommands(commands) | ||
pprint(bot.getMyCommands()) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
telepot @ git+https://github.com/ryukinix/telepot.git#egg=telepot |