man balls man balls man balls
This commit is contained in:
parent
339ebff931
commit
ec664162f6
2 changed files with 28 additions and 1 deletions
12
bot.py
12
bot.py
|
@ -7,7 +7,7 @@ from tgbot.shit.fed import build_fediverse_inline_results, extract_content
|
|||
from tgbot.config import TOKEN, PROMPTING_USERS
|
||||
from tgbot.shit.handlers import handle_xitter, handle_red_ebalo, handle_hentai, handle_cute_button
|
||||
from tgbot.shit.prompting import gen_image
|
||||
from tgbot.shit.render import render_text_on_image, image_to_string
|
||||
from tgbot.shit.render import render_text_on_image, image_to_string, encode_text, decode_text
|
||||
from io import BytesIO
|
||||
|
||||
logging.basicConfig(format='%(asctime)s - %(name)s - %(levelname)s - %(message)s',
|
||||
|
@ -24,6 +24,16 @@ async def start(update: Update, context: ContextTypes.DEFAULT_TYPE):
|
|||
|
||||
async def handle_text(update: Update, context: ContextTypes.DEFAULT_TYPE):
|
||||
|
||||
if update.message.text.startswith("encode"):
|
||||
text = update.message.text.replace("encode", "")
|
||||
await context.bot.send_message(chat_id=update.effective_chat.id, text=encode_text(text))
|
||||
return
|
||||
|
||||
if update.message.text.startswith("decode"):
|
||||
text = update.message.text.replace("decode", "")
|
||||
await context.bot.send_message(chat_id=update.effective_chat.id, text=decode_text(text))
|
||||
return
|
||||
|
||||
if not update.message.text.startswith("prompting") or update.message.from_user["username"] not in PROMPTING_USERS:
|
||||
file = render_text_on_image("tgbot/assets/red_ebalo.png", update.message.text)
|
||||
await context.bot.send_sticker(chat_id=update.effective_chat.id, sticker=file)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue