Add ping command to core group

This commit is contained in:
Lucy Bladen 2021-11-12 12:15:59 +00:00
parent 00f6e2164e
commit 23985ec044
2 changed files with 8 additions and 4 deletions

View File

@ -11,7 +11,7 @@ use crate::config::{Config, ManifoldConfig};
use crate::responses::Responses; use crate::responses::Responses;
pub struct Handler { pub struct Handler {
timer_running: AtomicBool, pub timer_running: AtomicBool,
} }
impl Handler { impl Handler {

View File

@ -3,7 +3,6 @@
use std::collections::HashSet; use std::collections::HashSet;
use std::env; use std::env;
use std::fs::File; use std::fs::File;
use std::io::stdout;
use std::ops::Deref; use std::ops::Deref;
use std::path::PathBuf; use std::path::PathBuf;
use std::sync::Arc; use std::sync::Arc;
@ -50,6 +49,10 @@ impl TypeMapKey for ManifoldConfig {
type Value = Arc<Mutex<ManifoldConfig>>; type Value = Arc<Mutex<ManifoldConfig>>;
} }
#[group]
#[commands(ping)]
struct Core;
pub async fn prepare_client(arguments: ArgMatches<'_>) -> ManifoldResult<Client> { pub async fn prepare_client(arguments: ArgMatches<'_>) -> ManifoldResult<Client> {
let bot_environment = arguments.value_of("environment").unwrap_or("Production").to_string(); let bot_environment = arguments.value_of("environment").unwrap_or("Production").to_string();
let config_file = format!("config/{}", arguments.value_of("config-file").unwrap_or("manifold.json")); let config_file = format!("config/{}", arguments.value_of("config-file").unwrap_or("manifold.json"));
@ -107,9 +110,10 @@ pub async fn prepare_client(arguments: ArgMatches<'_>) -> ManifoldResult<Client>
.owners(owners) .owners(owners)
.case_insensitivity(true) .case_insensitivity(true)
) )
.before(before); .before(before)
.group(&CORE_GROUP);
let mut client = Client::builder(&token) let client = Client::builder(&token)
.event_handler(Handler::new()) .event_handler(Handler::new())
.framework(framework) .framework(framework)
.await .await