diff --git a/Pipfile b/Pipfile index c057df4..300ba39 100644 --- a/Pipfile +++ b/Pipfile @@ -5,7 +5,7 @@ name = "pypi" [[description]] name = "vldc-bot" -version = "0.7.1" +version = "0.8" description = "VLDC nyan bot ^_^" authors = [ #tg diff --git a/bot/skills/__init__.py b/bot/skills/__init__.py index f0dbd06..26461d2 100644 --- a/bot/skills/__init__.py +++ b/bot/skills/__init__.py @@ -12,6 +12,7 @@ from skills.at_least_70k import add_70k from skills.ban import add_ban from skills.banme import add_banme +from skills.canary import add_canary from skills.coc import add_coc from skills.core import add_core from skills.covid_mode import add_covid_mode @@ -102,6 +103,7 @@ def _make_skill(add_handlers: Callable, name: str, hint: str) -> Dict: _make_skill(add_nya, "😺 meow", " Simon says wat?"), _make_skill(add_kozula, "💰 kozula", " Don't argue with kozula rate!"), _make_skill(add_length, "🍆 length", " length of your instrument"), + _make_skill(add_canary, "🦆 canary", " r u alive?"), # modes _make_skill(add_trusted_mode, "👁‍🗨 in god we trust", " are you worthy hah?"), _make_skill(add_aoc_mode, "🎄 AOC notifier", " kekV"), @@ -130,6 +132,7 @@ def _make_skill(add_handlers: Callable, name: str, hint: str) -> Dict: ("kozula", "💰 kozula", " Don't argue with kozula rate!"), ("still", "do u remember it?"), ("banme", "commit sudoku"), + ("chirp", "kitty kitty kitty"), ("prism", "top N PRISM words with optional predicate"), ("version", "show this message"), ("gdpr_me", "wipe all my hussar history"), diff --git a/bot/skills/canary.py b/bot/skills/canary.py new file mode 100644 index 0000000..85fe15f --- /dev/null +++ b/bot/skills/canary.py @@ -0,0 +1,20 @@ +import logging + +from telegram import Update +from telegram.ext import Updater, CommandHandler, CallbackContext + +logger = logging.getLogger(__name__) + + +def add_canary(upd: Updater, handlers_group: int): + logger.info("registering canary handlers") + dp = upd.dispatcher + dp.add_handler(CommandHandler("chirp", meow, run_async=True), handlers_group) + + +def meow(update: Update, context: CallbackContext): + # TODO: https://github.com/vldc-hq/vldc-bot/issues/247 + # I believe we could add some extra security here, like PGP sign for answer + update.effective_chat.bot.send_message( + chat_id=update.effective_chat.id, text="meow" + )