Skip to content

Instantly share code, notes, and snippets.

@adeonhy
Last active February 22, 2021 15:37
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save adeonhy/7120256f829a6cc70a6488d0c353b771 to your computer and use it in GitHub Desktop.
Save adeonhy/7120256f829a6cc70a6488d0c353b771 to your computer and use it in GitHub Desktop.
async fn get_command_type(msg: &Message) -> (CommandTypeId,u8){
let command_str = &msg.content;
if let Ok(n) = scan_fmt(command_str, "!ひよこスロット*{d}", u8) {
if n >= 10 {
return (CommandTypeId::HiyokoSlot,1);
} else {
return (CommandTypeId::HiyokoSlot,n);
}
} else if command_str.starts_with("!ひよこスロット") {
return (CommandTypeId::HiyokoSlot,1);
} else {
return (CommandTypeId::UnknownCommand,0);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment