VCPlayerBot icon indicating copy to clipboard operation
VCPlayerBot copied to clipboard

Edited "`commands.py`" file

Open Navaneeth-Renjith opened this issue 4 years ago • 0 comments

Changes

  • Fixed typos
  • Added refresh button for logs
  • Added callback data for "refresh_log"
    • Allowed to edit document if message is log file
  • Removed "OKDa"

Fixed typos

Fixed some typos in commands.py file.

HOME_TEXT = "<b>Hey  [{}](tg://user?id={}) 🙋‍♂️\n\nI'm a Bot built to Play or Stream Videos in Telegram Video Chats.\nI can Stream any YouTube Video or a Telegram File or even a YouTube Live.</b>"

Added refresh button for logs

Just added button for refreshing logs whenever you want.

button=[
    [
        InlineKeyboardButton(text='🔁 Refresh Logs', callback_data='recheck_log'),
        InlineKeyboardButton(text='🗑️ Close', callback_data='close'),
    ]
]

Added callback data for "recheck_log"

Just added callback data for button to refresh logs.

Allowed to edit document if message is log file

Allowed to edit the file if the query message is a document.

if os.path.exists('botlog.txt'):
    if query.message.document:
        await query.message.edit_document(
            'botlog.txt',
            caption="Bot Logs",
            reply_markup=button
         )
         await delete_messages([message])
    else:
        await query.message.delete()
        await message.reply_document(
            'botlog.txt',
            caption="Bot Logs",
            reply_markup=button
        )
        await delete_messages([message])
# rest of the code...

Removed "OKDa"

Simply removed text "OKDa" because all people didn't know it's meaning. 😅

@subinps

Navaneeth-Renjith avatar Feb 02 '22 12:02 Navaneeth-Renjith