-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
deleting inventory, use own inventory implementation
- Loading branch information
Showing
2 changed files
with
75 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
use crate::all::*; | ||
|
||
struct ChangePassword; | ||
|
||
#[async_trait] | ||
impl CommandInteractionTrait for ChangePassword { | ||
fn name(&self) -> String { | ||
"change_password".to_string() | ||
} | ||
fn command(&self) -> serenity::all::CreateCommand { | ||
AppReg::normal_slash(self.name(), "change your in game account password") | ||
} | ||
async fn handle_int( | ||
&self, | ||
_app: Arc<App>, | ||
_cmd: CommandInteraction, | ||
_ctx: Context, | ||
) -> MyResult<()> { | ||
Ok(()) | ||
} | ||
} | ||
|
||
command_reg![ChangePassword]; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,52 @@ | ||
#[macro_export] | ||
macro_rules! command_reg { | ||
( $( $x:expr ),* ) => { | ||
|
||
pub fn reg_command() -> HashMap<String, Box<dyn CommandInteractionTrait>> { | ||
let mut _y = HashMap::new(); | ||
$( | ||
_y.insert($x.name(), Box::new($x) as Box<dyn CommandInteractionTrait>); | ||
)* | ||
_y | ||
} | ||
}; | ||
} | ||
#[macro_export] | ||
macro_rules! button_reg { | ||
( $( $x:expr ),* ) => { | ||
|
||
pub fn reg_button() -> HashMap<String, Box<dyn ButtonInteractionTrait>> { | ||
let mut _y = HashMap::new(); | ||
$( | ||
_y.insert($x.name(), Box::new($x) as Box<dyn ButtonInteractionTrait>); | ||
)* | ||
_y | ||
} | ||
}; | ||
} | ||
#[macro_export] | ||
macro_rules! modal_reg { | ||
( $( $x:expr ),* ) => { | ||
|
||
pub fn reg_modal() -> HashMap<String, Box<dyn ModalInteractionTrait>> { | ||
let mut _y = HashMap::new(); | ||
$( | ||
_y.insert($x.name(), Box::new($x) as Box<dyn ModalInteractionTrait>); | ||
)* | ||
_y | ||
} | ||
}; | ||
} | ||
|
||
#[macro_export] | ||
macro_rules! reg { | ||
($name:ident,$trait:ident ,$($x:expr),*) => { | ||
pub fn $name() -> HashMap<String, Box<dyn $trait>> { | ||
let mut _x = HashMap::new(); | ||
$( | ||
_x.extend($x); | ||
)* | ||
_x | ||
} | ||
}; | ||
} |