Update support message

This commit is contained in:
2023-05-22 01:45:22 +02:00
parent b60005329f
commit 681bd6724a
2 changed files with 19 additions and 20 deletions

View File

@@ -89,19 +89,19 @@ pub fn get_approved_handler() -> (BotHandler, BotCommands) {
Some(vec![ Some(vec![
BotCommand { BotCommand {
command: String::from("random"), command: String::from("random"),
description: String::from("Попытать удачу"), description: String::from("🎲 Попытать удачу"),
}, },
BotCommand { BotCommand {
command: String::from("update_log"), command: String::from("update_log"),
description: String::from("Обновления каталога"), description: String::from("🔄 Обновления каталога"),
}, },
BotCommand { BotCommand {
command: String::from("settings"), command: String::from("settings"),
description: String::from("Настройки"), description: String::from("⚙️ Настройки"),
}, },
BotCommand { BotCommand {
command: String::from("support"), command: String::from("donate"),
description: String::from("Поддержать разработчика"), description: String::from("☕️ Поддержать разработчика"),
}, },
]), ]),
) )

View File

@@ -2,7 +2,6 @@ use crate::bots::BotHandlerInternal;
use teloxide::{ use teloxide::{
prelude::*, prelude::*,
types::{InlineKeyboardButton, InlineKeyboardMarkup},
utils::command::BotCommands, adaptors::{Throttle, CacheMe}, utils::command::BotCommands, adaptors::{Throttle, CacheMe},
}; };
@@ -10,28 +9,28 @@ use teloxide::{
#[command(rename_rule = "lowercase")] #[command(rename_rule = "lowercase")]
enum SupportCommand { enum SupportCommand {
Support, Support,
Donate
} }
pub async fn support_command_handler(message: Message, bot: CacheMe<Throttle<Bot>>) -> BotHandlerInternal { pub async fn support_command_handler(message: Message, bot: CacheMe<Throttle<Bot>>) -> BotHandlerInternal {
const MESSAGE_TEXT: &str = " let username = &message.from().unwrap().first_name;
[Лицензии](https://github.com/flibusta-apps/book_bot/blob/main/LICENSE.md)
[Исходный код](https://github.com/flibusta-apps) let message_text = format!("
"; Привет, {:?}!
let keyboard = InlineKeyboardMarkup { Этот бот существует благодаря пожертвованиям от наших пользователей.
inline_keyboard: vec![vec![InlineKeyboardButton { Однако, для его дальнейшего развития и поддержки серверов требуются финансовые средства.
kind: teloxide::types::InlineKeyboardButtonKind::Url( Мы будем очень благодарны за любую сумму пожертвования!
url::Url::parse("https://kurbezz.github.io/Kurbezz/").unwrap(),
), Спасибо!
text: String::from("☕️ Поддержать разработчика"),
}]], Тинькофф/Сбербанк:
}; `+79534966556`
", username);
bot bot
.send_message(message.chat.id, MESSAGE_TEXT) .send_message(message.chat.id, message_text)
.parse_mode(teloxide::types::ParseMode::MarkdownV2) .parse_mode(teloxide::types::ParseMode::MarkdownV2)
.reply_markup(keyboard)
.await?; .await?;
Ok(()) Ok(())