Skip to content

Commit

Permalink
refactor: Remove requirement of explicit application_id
Browse files Browse the repository at this point in the history
  • Loading branch information
axonasif committed Apr 20, 2023
1 parent 0e61d00 commit 8c49097
Show file tree
Hide file tree
Showing 4 changed files with 3 additions and 6 deletions.
1 change: 0 additions & 1 deletion ExampleBotConfig.toml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
## Do not commit in git.

[discord]
application_id = 12345678901234567890
bot_token = "QWERTYUIOP.ASDFGHJKL.123456789"

# optional, uncomment block to use.
Expand Down
4 changes: 1 addition & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -28,11 +28,9 @@ You wanna contribute!? That sounds awesome! Thank you for taking the step to con

- If you don't have `./BotConfig.toml` file, create it by copying [./ExampleBotConfig.toml](./ExampleBotConfig.toml). So, you could run: `cp ExampleBotConfig.toml BotConfig.toml`

- Update/fill-up `./BotConfig.toml` with:
- The token from your 🧩 `Bot` page on discord dev portal. You might need to reset it to see.
- Update/fill-up `./BotConfig.toml` with the token from your 🧩 `Bot` page on discord dev portal. You might need to reset it to see.
![bot token](https://user-images.githubusercontent.com/39482679/232367937-8767dbb4-d11e-4de0-ba6a-d8dbdd01c422.png)

- The **Application ID** from the `General Information` section in your left sidebar
- To persist the config changes accross development Gitpod workspaces:

```bash
Expand Down
2 changes: 1 addition & 1 deletion src/config.rs
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ pub struct GithubConfig {

#[derive(Debug, Deserialize)]
pub struct DiscordConfig {
pub application_id: u64,
// pub application_id: u64,
pub bot_token: String,
pub channels: Option<DiscordChannels>,
}
Expand Down
2 changes: 1 addition & 1 deletion src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -134,7 +134,7 @@ async fn main() -> Result<()> {
// .group(&OWNER_GROUP)

let mut client = Client::builder(&config.discord.bot_token, GatewayIntents::default())
.application_id(config.discord.application_id)
// .application_id(config.discord.application_id)
.event_handler(event::Listener {
is_loop_running: AtomicBool::new(false),
})
Expand Down

0 comments on commit 8c49097

Please sign in to comment.