Skip to content

Commit

Permalink
Add scripts/ folder with debug scripts (Python) (#12)
Browse files Browse the repository at this point in the history
* 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
ryukinix committed Aug 13, 2020
1 parent fbab488 commit 5679cc0
Show file tree
Hide file tree
Showing 4 changed files with 48 additions and 0 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -20,3 +20,4 @@
/kills.txt
*.mypy_cache
*.coverage
/run.sh
3 changes: 3 additions & 0 deletions scripts/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
.venv
.mypy_cache
token.txt
43 changes: 43 additions & 0 deletions scripts/debug.py
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())
1 change: 1 addition & 0 deletions scripts/requirements.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
telepot @ git+https://github.com/ryukinix/telepot.git#egg=telepot

0 comments on commit 5679cc0

Please sign in to comment.