mirror of
https://github.com/PluralKit/PluralKit.git
synced 2026-02-13 09:10:14 +00:00
refactor(commands): ToToken trait for easier conversion into tokens
This commit is contained in:
parent
e70d69e45c
commit
ff121ecc51
6 changed files with 49 additions and 23 deletions
|
|
@ -20,7 +20,10 @@ pub mod system;
|
|||
|
||||
use smol_str::SmolStr;
|
||||
|
||||
use crate::{command, token::Token};
|
||||
use crate::{
|
||||
command,
|
||||
token::{ToToken, Token},
|
||||
};
|
||||
|
||||
#[derive(Clone, Debug)]
|
||||
pub struct Command {
|
||||
|
|
@ -47,7 +50,7 @@ impl Command {
|
|||
#[macro_export]
|
||||
macro_rules! command {
|
||||
([$($v:expr),+], $cb:expr, $help:expr) => {
|
||||
$crate::commands::Command::new([$($v.clone()),*], $help, $cb)
|
||||
$crate::commands::Command::new([$($v.to_token()),*], $help, $cb)
|
||||
};
|
||||
}
|
||||
|
||||
|
|
@ -55,5 +58,6 @@ pub fn all() -> Vec<Command> {
|
|||
(help::cmds())
|
||||
.chain(system::cmds())
|
||||
.chain(member::cmds())
|
||||
.chain(fun::cmds())
|
||||
.collect()
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue