Operate on passed-in framework
This commit is contained in:
parent
2110f643de
commit
459bd8068e
12
src/lib.rs
12
src/lib.rs
|
|
@ -53,7 +53,7 @@ impl TypeMapKey for ManifoldConfig {
|
|||
#[commands(ping)]
|
||||
struct Core;
|
||||
|
||||
pub async fn prepare_client(arguments: ArgMatches<'_>) -> ManifoldResult<Client> {
|
||||
pub async fn prepare_client(arguments: ArgMatches<'_>, mut framework: StandardFramework) -> 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"));
|
||||
if arguments.occurrences_of("make-config") > 0 {
|
||||
|
|
@ -102,17 +102,15 @@ pub async fn prepare_client(arguments: ArgMatches<'_>) -> ManifoldResult<Client>
|
|||
Err(why) => panic!("Could not get HTTP application information - exiting: {:?}", why),
|
||||
};
|
||||
|
||||
let framework = StandardFramework::new()
|
||||
.configure(|c| c
|
||||
framework = framework.configure(|c| c
|
||||
.with_whitespace(true)
|
||||
.on_mention(Some(bot_id))
|
||||
.prefix(&prefix)
|
||||
.owners(owners)
|
||||
.case_insensitivity(true)
|
||||
)
|
||||
.before(before)
|
||||
.help(&MANIFOLD_HELP)
|
||||
.group(&CORE_GROUP);
|
||||
).before(before)
|
||||
.help(&MANIFOLD_HELP);
|
||||
framework.group_add(&CORE_GROUP);
|
||||
|
||||
let client = Client::builder(&token)
|
||||
.event_handler(Handler::new())
|
||||
|
|
|
|||
Loading…
Reference in New Issue