Skip to content

Commit

Permalink
Replaced filters.chat by filters.user for admin
Browse files Browse the repository at this point in the history
  • Loading branch information
Mahesh0253 committed Sep 14, 2020
1 parent ac2679f commit 5f5e947
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions plugins/commands.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,10 +15,10 @@ async def start(bot, message):
await message.reply(START_MSG, reply_markup=reply_markup)


@Client.on_message(filters.command('channel') & filters.chat(ADMINS))
@Client.on_message(filters.command('channel') & filters.user(ADMINS))
async def channel_info(bot, message):
"""Send basic information of channel"""

if isinstance(CHANNELS, (int, str)):
channels = [CHANNELS]
elif isinstance(CHANNELS, list):
Expand All @@ -34,15 +34,15 @@ async def channel_info(bot, message):
await message.reply(f'Error: {e}')


@Client.on_message(filters.command('total') & filters.chat(ADMINS))
@Client.on_message(filters.command('total') & filters.user(ADMINS))
async def total(bot, message):
"""Show total files in database"""
msg = await message.reply("Processing...⏳", quote=True)
total = await Media.count_documents()
await msg.edit(f'📁 Saved files: {total}')


@Client.on_message(filters.command('logger') & filters.chat(ADMINS))
@Client.on_message(filters.command('logger') & filters.user(ADMINS))
async def log_file(bot, message):
"""Send log file"""
try:
Expand All @@ -51,7 +51,7 @@ async def log_file(bot, message):
await message.reply(str(e))


@Client.on_message(filters.command('delete') & filters.chat(ADMINS))
@Client.on_message(filters.command('delete') & filters.user(ADMINS))
async def delete(bot, message):
"""Delete file from database"""

Expand Down

0 comments on commit 5f5e947

Please sign in to comment.