Operate on passed-in framework

This commit is contained in:
Lucy Bladen 2021-11-12 12:43:20 +00:00
parent 2110f643de
commit 459bd8068e
1 changed files with 5 additions and 7 deletions

View File

@ -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())