Skip to content

Commit baf1ba4

Browse files
committed
modules.komaru: komaru: Reply to replied msg when possible
1 parent d297f3a commit baf1ba4

File tree

1 file changed

+8
-3
lines changed

1 file changed

+8
-3
lines changed

modules/komaru.py

+8-3
Original file line numberDiff line numberDiff line change
@@ -265,9 +265,14 @@ async def trigger_handler(update: Update, context: ContextTypes.DEFAULT_TYPE):
265265

266266

267267
async def komaru_random(update: Update, context: ContextTypes.DEFAULT_TYPE):
268-
await update.message.reply_animation(
269-
config_db.config[random.choice(tuple(config_db.config.keys()))]["file_id"]
270-
)
268+
if update.message.reply_to_message:
269+
await update.message.reply_animation(
270+
config_db.config[random.choice(tuple(config_db.config.keys()))]["file_id"]
271+
)
272+
else:
273+
await update.message.reply_animation(
274+
config_db.config[random.choice(tuple(config_db.config.keys()))]["file_id"]
275+
)
271276

272277
Help.register_help("toggleupdatekomaru", "Toggle Komaru updater listener")
273278
Help.register_help("countkomarugifs", "Count number of komaru gifs in database")

0 commit comments

Comments
 (0)