mirror of
https://github.com/PluralKit/PluralKit.git
synced 2026-02-12 16:50:10 +00:00
refactor: start to stop using ctx.Match
This commit is contained in:
parent
b89bc44a27
commit
e70d69e45c
6 changed files with 56 additions and 35 deletions
|
|
@ -22,7 +22,7 @@ use smol_str::SmolStr;
|
|||
|
||||
use crate::{command, token::Token};
|
||||
|
||||
#[derive(Clone)]
|
||||
#[derive(Clone, Debug)]
|
||||
pub struct Command {
|
||||
// TODO: fix hygiene
|
||||
pub tokens: Vec<Token>,
|
||||
|
|
|
|||
|
|
@ -1 +1,10 @@
|
|||
use super::*;
|
||||
|
||||
pub fn cmds() -> impl Iterator<Item = Command> {
|
||||
[command!(
|
||||
[Token::cmd("thunder")],
|
||||
"fun_thunder",
|
||||
"Shows the help command"
|
||||
)]
|
||||
.into_iter()
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
#![feature(let_chains)]
|
||||
|
||||
mod commands;
|
||||
pub mod commands;
|
||||
mod string;
|
||||
mod token;
|
||||
mod tree;
|
||||
|
|
@ -17,7 +17,7 @@ pub use commands::Command;
|
|||
pub use token::*;
|
||||
|
||||
lazy_static::lazy_static! {
|
||||
static ref COMMAND_TREE: TreeBranch = {
|
||||
pub static ref COMMAND_TREE: TreeBranch = {
|
||||
let mut tree = TreeBranch {
|
||||
current_command_key: None,
|
||||
possible_tokens: vec![],
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue