Allow bots to specify their own gateway intents
This commit is contained in:
parent
478951b986
commit
33a66e3cff
|
|
@ -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)
|
||||
|
|
|
|||
Loading…
Reference in New Issue