add delete button to images uploaded via rpc
This commit is contained in:
@@ -3,7 +3,7 @@ import logging
|
||||
import os
|
||||
import traceback
|
||||
|
||||
from telegram import Bot
|
||||
from telegram import Bot, InlineKeyboardMarkup, InlineKeyboardButton
|
||||
from telegram.error import RetryAfter
|
||||
|
||||
from config.celery import app
|
||||
@@ -22,6 +22,9 @@ def upload_image_rpc(self, queued_image_pk, fpath, caption):
|
||||
config.tmp_uploads_chat_id,
|
||||
open(fpath, 'rb'),
|
||||
caption=caption,
|
||||
reply_markup=InlineKeyboardMarkup([[
|
||||
InlineKeyboardButton('Delete', callback_data=f'del {queued_image_pk}')
|
||||
]]),
|
||||
)
|
||||
qi.message_id = m.message_id
|
||||
qi.args = json.dumps([m.photo[-1].file_id])
|
||||
@@ -54,6 +57,9 @@ def upload_animation_rpc(self, queued_image_pk, fpath, caption):
|
||||
config.tmp_uploads_chat_id,
|
||||
open(fpath, 'rb'),
|
||||
caption=caption,
|
||||
reply_markup=InlineKeyboardMarkup([[
|
||||
InlineKeyboardButton('Delete', callback_data=f'del {queued_image_pk}')
|
||||
]]),
|
||||
)
|
||||
qi.message_id = m.message_id
|
||||
qi.args = json.dumps([m.animation.file_id])
|
||||
|
Reference in New Issue
Block a user