You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

43 lines
1.1 KiB
Rust

use serenity::prelude::*;
use serenity::model::prelude::*;
use serenity::model::channel::Message;
use crate::utils;
// COLOR ROLE IDS
pub async fn parse_command(ctx: Context, msg: Message, server_id: GuildId)
{
let command_lower = msg.content.to_lowercase();
let mut command_iter = command_lower.split_whitespace();
let command_start = command_iter.next();
if command_start == Some(".randomizer")
{
let item = utils::get_random_item();
utils::send_msg(ctx, msg.channel_id, &format!("You found {}!", item)).await;
return;
}
if command_start == Some(".color")
{
utils::send_msg(ctx, msg.channel_id, "Valid colors are: green blue red purple pink yellow orange").await;
return;
}
if command_start == Some(".setcolor")
{
if let Some(arg) = command_iter.next()
{
match arg
{
// TODO: add color roles
_ => utils::Logger::log_error(ctx, &format!("unknown .color argument: {}", arg)).await
};
}
}
}