2023-05-09 17:27:58 +00:00
|
|
|
//! This module consists of endpoints to handle commands
|
|
|
|
|
2023-07-29 13:07:53 +00:00
|
|
|
crate::export_handlers!(
|
|
|
|
add_account,
|
|
|
|
cancel,
|
|
|
|
delete,
|
|
|
|
delete_all,
|
|
|
|
export,
|
|
|
|
gen_password,
|
|
|
|
get_account,
|
|
|
|
get_accounts,
|
|
|
|
help,
|
|
|
|
import,
|
|
|
|
menu,
|
|
|
|
set_master_pass,
|
|
|
|
start
|
|
|
|
);
|
2023-06-29 14:33:26 +00:00
|
|
|
|
2023-05-27 22:42:06 +00:00
|
|
|
use teloxide::macros::BotCommands;
|
|
|
|
|
|
|
|
#[derive(BotCommands, Clone, Copy)]
|
|
|
|
#[command(
|
|
|
|
rename_rule = "snake_case",
|
|
|
|
description = "These commands are supported:"
|
|
|
|
)]
|
|
|
|
pub enum Command {
|
|
|
|
#[command(description = "displays the welcome message")]
|
|
|
|
Start,
|
|
|
|
#[command(description = "displays this text")]
|
|
|
|
Help,
|
|
|
|
#[command(description = "sets the master password")]
|
|
|
|
SetMasterPass,
|
2023-07-29 13:00:02 +00:00
|
|
|
#[command(description = "gives you a menu to manage your accounts")]
|
|
|
|
Menu,
|
2023-05-27 22:42:06 +00:00
|
|
|
#[command(description = "adds the account")]
|
|
|
|
AddAccount,
|
|
|
|
#[command(description = "gets the account")]
|
|
|
|
GetAccount,
|
|
|
|
#[command(description = "gets a list of accounts")]
|
|
|
|
GetAccounts,
|
|
|
|
#[command(description = "deletes the account")]
|
|
|
|
Delete,
|
|
|
|
#[command(description = "deletes all the accounts and the master password")]
|
|
|
|
DeleteAll,
|
|
|
|
#[command(description = "exports all the accounts in a json file")]
|
|
|
|
Export,
|
|
|
|
#[command(description = "loads the accounts from a json file")]
|
|
|
|
Import,
|
|
|
|
#[command(description = "generates 10 secure passwords")]
|
|
|
|
GenPassword,
|
|
|
|
#[command(description = "cancels the current action")]
|
|
|
|
Cancel,
|
|
|
|
}
|