mirror of
https://github.com/TheFunny/TelegramTwitterMediaBot.git
synced 2026-09-23 23:32:05 +00:00
fix deal with invalid url
This commit is contained in:
@@ -41,6 +41,8 @@ async def inline_query(update: Update, context: ContextTypes.DEFAULT_TYPE) -> No
|
|||||||
return
|
return
|
||||||
logger.info(f"Query: {query}")
|
logger.info(f"Query: {query}")
|
||||||
async with Telegram(query) as tweet:
|
async with Telegram(query) as tweet:
|
||||||
|
if not tweet:
|
||||||
|
return
|
||||||
await update.inline_query.answer(tweet.inline_query_result())
|
await update.inline_query.answer(tweet.inline_query_result())
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -17,6 +17,8 @@ class Telegram:
|
|||||||
elif PIXIV_REFRESH_TOKEN and pixiv_url.match(self._url):
|
elif PIXIV_REFRESH_TOKEN and pixiv_url.match(self._url):
|
||||||
async with TelegramPixiv(self._url) as pixiv:
|
async with TelegramPixiv(self._url) as pixiv:
|
||||||
return pixiv
|
return pixiv
|
||||||
|
else:
|
||||||
|
return None
|
||||||
|
|
||||||
async def __aexit__(self, exc_type, exc_val, exc_tb):
|
async def __aexit__(self, exc_type, exc_val, exc_tb):
|
||||||
pass
|
pass
|
||||||
|
|||||||
Reference in New Issue
Block a user