Skip to content

Commit

Permalink
Implement: /sticker
Browse files Browse the repository at this point in the history
/sticker display sticker ID and stickerset on reply.
  • Loading branch information
Happy-Ferret committed Jan 4, 2022
1 parent e15c9cf commit bf84218
Showing 1 changed file with 21 additions and 0 deletions.
21 changes: 21 additions & 0 deletions main.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
from telegram import Update, ForceReply, ChatPermissions, Bot, BotCommand, BotCommandScope
from telegram.ext import Updater, CommandHandler, MessageHandler, Filters, CallbackContext
from commands import Commands, AdminCommands
from utils import escape_md
import dogpic
import catpic

Expand Down Expand Up @@ -109,6 +110,25 @@ def user_info_command(update: Update, context: CallbackContext) -> None:
# update.message.reply_markdown_v2(
# fr'{context.args}\'s\ ID is {context.args}\.')

def sticker_info_command(update: Update, context: CallbackContext) -> None:
#Need the error handling still. This command should return a text whenever we don't respond to another user.
if not context.args:
reply = update.message.reply_to_message
if reply.sticker:
update.message.reply_markdown_v2(
f'\n'
f'Sticker ID: `{escape_md(reply.sticker.file_id)}`\n'
f'\n'
f'Stickerset: `{escape_md(reply.sticker.set_name)}`')
else:
update.message.reply_text(
f'Not a sticker!')
else:
raise NotImplemented()
# reply = update.message.
# update.message.reply_markdown_v2(
# fr'{context.args}\'s\ ID is {context.args}\.')

def pin_message_command(update: Update, context: CallbackContext) -> None:
#Need the error handling still. This command should return a text whenever we don't respond to another message.
# Inline pinning a possibility
Expand Down Expand Up @@ -230,6 +250,7 @@ def main() -> None:

# User info
dispatcher.add_handler(CommandHandler("id", user_info_command))
dispatcher.add_handler(CommandHandler("sticker", sticker_info_command))

# User management
dispatcher.add_handler(CommandHandler("mute", mute_command))
Expand Down

0 comments on commit bf84218

Please sign in to comment.