|
|
|
|
// use serenity::async_trait;
|
|
|
|
|
use serenity::prelude::*;
|
|
|
|
|
use serenity::model::channel::Message;
|
|
|
|
|
// use serenity::model::gateway::Ready;
|
|
|
|
|
// use serenity::model::prelude::*;
|
|
|
|
|
|
|
|
|
|
pub mod test;
|
|
|
|
|
pub mod admin;
|
|
|
|
|
pub mod sm_server;
|
|
|
|
|
|
|
|
|
|
use crate::utils;
|
|
|
|
|
|
|
|
|
|
pub async fn parse(ctx: Context, msg: Message)
|
|
|
|
|
{
|
|
|
|
|
if let Some(server_id) = msg.guild_id
|
|
|
|
|
{
|
|
|
|
|
// This is not a command
|
|
|
|
|
if msg.content.len() == 0 || msg.content.chars().nth(0) != Some('.')
|
|
|
|
|
{
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if server_id == utils::ADMIN_SERVER_ID && msg.channel_id == utils::ADMIN_COMMAND_CHANNEL_ID
|
|
|
|
|
{
|
|
|
|
|
test::parse_command(ctx, msg, server_id).await;
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if server_id == utils::SM_SERVER_ID
|
|
|
|
|
{
|
|
|
|
|
sm_server::parse_command(ctx, msg, server_id).await;
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
utils::Logger::log_message(ctx, &format!("DM Received from {}: {}", msg.author.name, msg.content)).await;
|
|
|
|
|
}
|
|
|
|
|
}
|