mirror of
https://github.com/PluralKit/PluralKit.git
synced 2026-02-11 16:20:13 +00:00
refactor(commands): separate commands definitions and other code into modules
This commit is contained in:
parent
405ac11d74
commit
af523a4c23
24 changed files with 293 additions and 216 deletions
|
|
@ -41,6 +41,14 @@ lazy_static::lazy_static!(
|
|||
);
|
||||
|
||||
impl Token {
|
||||
pub fn cmd(value: impl Into<SmolStr>) -> Self {
|
||||
Self::Value(vec![value.into()])
|
||||
}
|
||||
|
||||
pub fn cmd_with_alias(value: impl IntoIterator<Item = impl Into<SmolStr>>) -> Self {
|
||||
Self::Value(value.into_iter().map(Into::into).collect())
|
||||
}
|
||||
|
||||
pub fn try_match(&self, input: Option<SmolStr>) -> TokenMatchResult {
|
||||
// short circuit on empty things
|
||||
if matches!(self, Self::Empty) && input.is_none() {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue