Compare commits
No commits in common. "33c0440f13117ac2b5b83633517686b52bb9e310" and "9d14817a347c5fa82202a60371e05c42813969dd" have entirely different histories.
33c0440f13
...
9d14817a34
|
@ -2,7 +2,6 @@ import html
|
|||
from pyrogram import Client, filters
|
||||
from pyrogram.types.messages_and_media import Photo
|
||||
from pyrogram.errors.exceptions.forbidden_403 import Forbidden
|
||||
from pyrogram.errors.exceptions.bad_request_400 import ChatSendInlineForbidden
|
||||
from .. import slave, config, help_dict, log_errors, public_log_errors
|
||||
|
||||
@Client.on_message(~filters.forwarded & ~filters.sticker & ~filters.via_bot & ~filters.edited & filters.me & filters.command(['anilist', 'al', 'alc', 'alchar', 'alcharacter', 'anilistc', 'anilistchar', 'anilistcharacter'], prefixes=config['config']['prefixes']))
|
||||
|
@ -31,7 +30,7 @@ async def anilist(client, message):
|
|||
await message.reply_inline_bot_result(results.query_id, results.results[page].id)
|
||||
except IndexError:
|
||||
await message.reply_text(f'There are only {len(results.results)} results')
|
||||
except (Forbidden, ChatInlineSendForbidden):
|
||||
except Forbidden:
|
||||
text = {'message': results.results[page].send_message.message, 'entities': results.results[page].send_message.entities}
|
||||
try:
|
||||
photo = Photo._parse(client, results.results[page].photo)
|
||||
|
|
|
@ -1,5 +1,4 @@
|
|||
from pyrogram import Client, filters
|
||||
from pyrogram.types.messages_and_media import Photo
|
||||
from pyrogram.errors.exceptions.forbidden_403 import Forbidden
|
||||
from .. import slave, config, help_dict, log_errors, public_log_errors
|
||||
|
||||
|
@ -10,12 +9,10 @@ async def loli(client, message):
|
|||
bot = await slave.get_me()
|
||||
query = ' '.join(message.command)
|
||||
results = await client.get_inline_bot_results(bot.username or bot.id, query)
|
||||
result = results.results[0]
|
||||
photo = Photo._parse(client, result.photo)
|
||||
try:
|
||||
await message.reply_cached_media(photo.file_id, caption={'message': result.send_message.message, 'entities': result.send_message.entities}, parse_mode='through')
|
||||
await message.reply_inline_bot_result(results.query_id, results.results[0].id)
|
||||
except Forbidden:
|
||||
await message.reply_text({'message': result.send_message.message, 'entities': result.send_message.entities}, parse_mode='through')
|
||||
await message.reply_text({'message': results.results[0].send_message.message, 'entities': results.results[0].send_message.entities}, disable_web_page_preview=True, parse_mode='through')
|
||||
|
||||
help_dict['loli'] = ('Loli',
|
||||
'''{prefix}loli <i>[keywords]</i> - Gets a possibly nsfw image of a loli, thanks to lolicon.app
|
||||
|
|
|
@ -1,6 +1,5 @@
|
|||
from pyrogram import Client, filters
|
||||
from pyrogram.errors.exceptions.forbidden_403 import Forbidden
|
||||
from pyrogram.errors.exceptions.bad_request_400 import ChatSendInlineForbidden
|
||||
from .. import slave, config, help_dict, log_errors, public_log_errors
|
||||
|
||||
@Client.on_message(~filters.forwarded & ~filters.sticker & ~filters.via_bot & ~filters.edited & filters.me & filters.command(['ud', 'urbandictionary'], prefixes=config['config']['prefixes']))
|
||||
|
@ -29,7 +28,7 @@ async def ud(client, message):
|
|||
await message.reply_inline_bot_result(results.query_id, results.results[page].id)
|
||||
except IndexError:
|
||||
await message.reply_text(f'There are only {len(results.results)} definitions')
|
||||
except (Forbidden, ChatInlineSendForbidden):
|
||||
except Forbidden:
|
||||
await message.reply_text({'message': results.results[page].send_message.message, 'entities': results.results[page].send_message.entities}, disable_web_page_preview=True, parse_mode='through')
|
||||
|
||||
help_dict['ud'] = ('Urban Dictionary',
|
||||
|
|
|
@ -1,6 +1,5 @@
|
|||
from pyrogram import Client, filters
|
||||
from pyrogram.errors.exceptions.forbidden_403 import Forbidden
|
||||
from pyrogram.errors.exceptions.bad_request_400 import ChatSendInlineForbidden
|
||||
from .. import slave, config, help_dict, log_errors, public_log_errors
|
||||
|
||||
@Client.on_message(~filters.forwarded & ~filters.sticker & ~filters.via_bot & ~filters.edited & filters.me & filters.command(['w', 'wiki', 'wikipedia'], prefixes=config['config']['prefixes']))
|
||||
|
@ -29,7 +28,7 @@ async def wikipedia(client, message):
|
|||
await message.reply_inline_bot_result(results.query_id, results.results[page].id)
|
||||
except IndexError:
|
||||
await message.reply_text(f'There are only {len(results.results)} results')
|
||||
except (Forbidden, ChatInlineSendForbidden):
|
||||
except Forbidden:
|
||||
await message.reply_text({'message': results.results[page].send_message.message, 'entities': results.results[page].send_message.entities}, disable_web_page_preview=True, parse_mode='through')
|
||||
|
||||
help_dict['wikipedia'] = ('Wikipedia',
|
||||
|
|
Loading…
Reference in New Issue