Add ping command to core group
This commit is contained in:
parent
00f6e2164e
commit
23985ec044
|
|
@ -11,7 +11,7 @@ use crate::config::{Config, ManifoldConfig};
|
|||
use crate::responses::Responses;
|
||||
|
||||
pub struct Handler {
|
||||
timer_running: AtomicBool,
|
||||
pub timer_running: AtomicBool,
|
||||
}
|
||||
|
||||
impl Handler {
|
||||
|
|
|
|||
10
src/lib.rs
10
src/lib.rs
|
|
@ -3,7 +3,6 @@
|
|||
use std::collections::HashSet;
|
||||
use std::env;
|
||||
use std::fs::File;
|
||||
use std::io::stdout;
|
||||
use std::ops::Deref;
|
||||
use std::path::PathBuf;
|
||||
use std::sync::Arc;
|
||||
|
|
@ -50,6 +49,10 @@ impl TypeMapKey for ManifoldConfig {
|
|||
type Value = Arc<Mutex<ManifoldConfig>>;
|
||||
}
|
||||
|
||||
#[group]
|
||||
#[commands(ping)]
|
||||
struct Core;
|
||||
|
||||
pub async fn prepare_client(arguments: ArgMatches<'_>) -> ManifoldResult<Client> {
|
||||
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"));
|
||||
|
|
@ -107,9 +110,10 @@ pub async fn prepare_client(arguments: ArgMatches<'_>) -> ManifoldResult<Client>
|
|||
.owners(owners)
|
||||
.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())
|
||||
.framework(framework)
|
||||
.await
|
||||
|
|
|
|||
Loading…
Reference in New Issue