feat: improve transparency of the join command
This commit is contained in:
16
src/main.rs
16
src/main.rs
@@ -132,7 +132,7 @@ async fn main() -> Result<(), MainError> {
|
||||
.await
|
||||
.expect("couldn't get current Discord application"); // TODO
|
||||
|
||||
let application_id = current_application.id;
|
||||
let discord_application_id = current_application.id;
|
||||
|
||||
let shard_id = ShardId::new(0, 1);
|
||||
let intents = Intents::GUILD_VOICE_STATES;
|
||||
@@ -150,7 +150,7 @@ async fn main() -> Result<(), MainError> {
|
||||
let event_types = EventTypeFlags::GUILD_VOICE_STATES | EventTypeFlags::INTERACTION_CREATE;
|
||||
let mut next_event = shard.next_event(event_types);
|
||||
|
||||
let interaction_client = discord_client.interaction(application_id);
|
||||
let interaction_client = discord_client.interaction(discord_application_id);
|
||||
|
||||
let commands = all_commands();
|
||||
|
||||
@@ -172,11 +172,17 @@ async fn main() -> Result<(), MainError> {
|
||||
let command_router = CommandRouter::from_iter(commands);
|
||||
|
||||
let vcs = initialize_vcs(&discord_client).await;
|
||||
|
||||
let discord_client = Arc::new(discord_client);
|
||||
let songbird = Arc::new(songbird);
|
||||
let vcs = Arc::new(vcs);
|
||||
|
||||
let songbird = Arc::new(songbird);
|
||||
|
||||
let state = State { vcs, songbird };
|
||||
let state = State {
|
||||
discord_application_id,
|
||||
discord_client,
|
||||
songbird,
|
||||
vcs,
|
||||
};
|
||||
|
||||
while let Some(event_res) = next_event.await {
|
||||
match event_res {
|
||||
|
||||
Reference in New Issue
Block a user