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.
|
|
|
|
// 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;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if server_id == utils::SM_SERVER_ID
|
|
|
|
|
{
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
utils::Logger::log_message(ctx, &format!("DM Received from {}: {}", msg.author.name, msg.content)).await;
|
|
|
|
|
}
|
|
|
|
|
}
|