Allow bots to specify their own gateway intents

This commit is contained in:
Lucy Bladen 2022-07-13 16:45:28 +01:00
parent 478951b986
commit 33a66e3cff
Signed by untrusted user who does not match committer: xyon
GPG Key ID: DD18155D6B18078D
1 changed files with 2 additions and 2 deletions

View File

@ -61,7 +61,7 @@ impl TypeMapKey for ManifoldConfig {
#[commands(ping, set_config, get_config, version, set_activity, get_environment)]
struct Core;
pub async fn prepare_client<T: 'static + EventHandler>(arguments: ArgMatches, mut framework: StandardFramework, event_handler: T) -> ManifoldResult<Client> {
pub async fn prepare_client<T: 'static + EventHandler>(arguments: ArgMatches, mut framework: StandardFramework, event_handler: T, intents: GatewayIntents) -> 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 {
@ -124,7 +124,7 @@ pub async fn prepare_client<T: 'static + EventHandler>(arguments: ArgMatches, mu
.help(&MANIFOLD_HELP);
framework.group_add(&CORE_GROUP);
let client = Client::builder(&token, GatewayIntents::default())
let client = Client::builder(&token, intents)
.event_handler(event_handler)
.application_id(application_id)
.framework(framework)