API usage overhaul #27
@ -38,7 +38,9 @@ async def callback_query_yes(app: PyroClient, clb: CallbackQuery):
|
|||||||
return
|
return
|
||||||
except SubmissionUnsupportedError:
|
except SubmissionUnsupportedError:
|
||||||
await clb.answer(
|
await clb.answer(
|
||||||
text="Unsupported.",
|
text=app._("mime_not_allowed", "message", locale=user_locale).format(
|
||||||
|
", ".join(app.config["submission"]["mime_types"]), quote=True
|
||||||
|
),
|
||||||
show_alert=True,
|
show_alert=True,
|
||||||
)
|
)
|
||||||
return
|
return
|
||||||
|
@ -227,7 +227,9 @@ async def get_submission(app: PyroClient, msg: Message):
|
|||||||
return
|
return
|
||||||
except SubmissionUnsupportedError:
|
except SubmissionUnsupportedError:
|
||||||
await msg.reply_text(
|
await msg.reply_text(
|
||||||
"Unsupported.",
|
app._("mime_not_allowed", "message", locale=user_locale).format(
|
||||||
|
", ".join(app.config["submission"]["mime_types"]), quote=True
|
||||||
|
),
|
||||||
quote=True,
|
quote=True,
|
||||||
)
|
)
|
||||||
return
|
return
|
||||||
@ -258,7 +260,11 @@ async def get_submission(app: PyroClient, msg: Message):
|
|||||||
await msg.copy(app.owner, caption=caption)
|
await msg.copy(app.owner, caption=caption)
|
||||||
return
|
return
|
||||||
except SubmissionUnsupportedError:
|
except SubmissionUnsupportedError:
|
||||||
await msg.reply_text("Unsupported.", quote=True)
|
await msg.reply_text(
|
||||||
|
app._("mime_not_allowed", "message", locale=user_locale).format(
|
||||||
|
", ".join(app.config["submission"]["mime_types"]), quote=True
|
||||||
|
)
|
||||||
|
)
|
||||||
return
|
return
|
||||||
except SubmissionDuplicatesError as exp:
|
except SubmissionDuplicatesError as exp:
|
||||||
await msg.reply_text(
|
await msg.reply_text(
|
||||||
|
Reference in New Issue
Block a user