Skip to content

Instantly share code, notes, and snippets.

@adeonhy
Last active Feb 22, 2021
Embed
What would you like to do?
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