Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion Pipfile
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ name = "pypi"

[[description]]
name = "vldc-bot"
version = "0.7.1"
version = "0.8"
description = "VLDC nyan bot ^_^"
authors = [
#tg
Expand Down
3 changes: 3 additions & 0 deletions bot/skills/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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"),
Expand Down Expand Up @@ -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"),
Expand Down
20 changes: 20 additions & 0 deletions bot/skills/canary.py
Original file line number Diff line number Diff line change
@@ -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"
)