-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathstickerHandler.py
31 lines (28 loc) · 1.69 KB
/
stickerHandler.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
# -*- coding: utf-8 -*-
import configuration
import common
groupID = configuration.adminGroup
admin = configuration.admin
botID = configuration.botID
def privateSticker(bot, message):
if (common.chechStatus(message.from_user.id) == False):
try:
bot.send_message(chat_id=groupID, text='>>> private sticker send by ' + str(common.getName(message.from_user)))
bot.forward_message(chat_id=groupID, from_chat_id=message.chat.id, message_id=message.message_id)
bot.send_message(chat_id=message.chat.id,
text='<b>Your Submission has Successfully Submitted</b> ' + str(
common.getName(message.from_user)),
parse_mode='HTML')
except:
bot.send_message(chat_id=admin, text='Private Sticker Forward Failed from agent ' + str(common.getName(message.from_user)), parse_mode='HTML')
def replyToUser(bot, message):
if(message.reply_to_message.from_user.id == botID):
for chatAdmin in bot.get_chat_administrators(chat_id=groupID):
if(message.from_user.id==chatAdmin.user.id and chatAdmin.user.is_bot==False):
try:
bot.send_sticker(chat_id=message.reply_to_message.forward_from.id, data=message.sticker.file_id)
except:
try:
bot.send_message(chat_id=admin, text='Reply Sticker Send Failed to agent ' + str(common.getName(message.reply_to_message.forward_from)), parse_mode='HTML')
except:
bot.send_message(chat_id=admin, text='Trying to reply as a Sticker to the BOT message by ' + str(common.getName(message.from_user)))