Added support for multiple languages
This commit is contained in:
@@ -1,19 +1,24 @@
|
||||
use crate::prelude::*;
|
||||
|
||||
#[inline]
|
||||
pub async fn menu(bot: Throttle<Bot>, msg: Message, db: Pool) -> crate::Result<()> {
|
||||
pub async fn menu(
|
||||
bot: Throttle<Bot>,
|
||||
msg: Message,
|
||||
db: Pool,
|
||||
locale: LocaleRef,
|
||||
) -> crate::Result<()> {
|
||||
let user_id = msg.from().ok_or(NoUserInfo)?.id.0;
|
||||
|
||||
let markup = menu_markup("get", user_id, &db).await?;
|
||||
|
||||
if markup.inline_keyboard.is_empty() {
|
||||
bot.send_message(msg.chat.id, "You don't have any accounts")
|
||||
.reply_markup(deletion_markup())
|
||||
bot.send_message(msg.chat.id, locale.no_accounts_found.as_ref())
|
||||
.reply_markup(deletion_markup(locale))
|
||||
.await?;
|
||||
return Ok(());
|
||||
}
|
||||
|
||||
bot.send_message(msg.chat.id, "Choose your account")
|
||||
bot.send_message(msg.chat.id, locale.choose_account.as_ref())
|
||||
.reply_markup(markup)
|
||||
.await?;
|
||||
Ok(())
|
||||
|
Reference in New Issue
Block a user