mod: remove guild identifier limitation
build / docker (push) Failing after 4m48s

This commit is contained in:
2026-08-11 14:28:54 -04:00
parent 8a53715149
commit a4da7263c5
3 changed files with 10 additions and 21 deletions
-1
View File
@@ -30,7 +30,6 @@ If you are running `nix` or NixOS, you should probably run the provided `flake.n
Running the binary by itself won't do anything. In fact, the bot will just quit if you don't have the needed information. You will need to have the following: Running the binary by itself won't do anything. In fact, the bot will just quit if you don't have the needed information. You will need to have the following:
- A Discord token - `DISCORD_TOKEN` - A Discord token - `DISCORD_TOKEN`
- A guild ID - `GUILD_ID`
_OR_ _OR_
-1
View File
@@ -8,7 +8,6 @@ services:
LETSENCRYPT_HOST: LETSENCRYPT_HOST:
LETSENCRYPT_EMAIL: LETSENCRYPT_EMAIL:
## Fill these in when you deploy ## Fill these in when you deploy
# GUILD_ID:
# DISCORD_TOKEN: # DISCORD_TOKEN:
# #
# OR FILL THESE IN INSTEAD # OR FILL THESE IN INSTEAD
+10 -19
View File
@@ -2,9 +2,8 @@ use std::env;
use serenity::async_trait; use serenity::async_trait;
use serenity::builder::{CreateInteractionResponse, CreateInteractionResponseMessage}; use serenity::builder::{CreateInteractionResponse, CreateInteractionResponseMessage};
use serenity::model::application::Interaction; use serenity::model::application::{Command, Interaction};
use serenity::model::gateway::Ready; use serenity::model::gateway::Ready;
use serenity::model::id::GuildId;
use serenity::prelude::*; use serenity::prelude::*;
use crate::commands; use crate::commands;
@@ -35,23 +34,15 @@ impl EventHandler for Handler {
async fn ready(&self, ctx: Context, ready: Ready) { async fn ready(&self, ctx: Context, ready: Ready) {
println!("{} is connected!", ready.user.name); println!("{} is connected!", ready.user.name);
let guild_id = GuildId::new( let cmds = Command::set_global_commands(
env::var("GUILD_ID") &ctx.http,
.expect("Expected GUILD_ID in environment") vec![
.parse() commands::roll::register(),
.expect("GUILD_ID must be an integer"), commands::random::register(),
); commands::about::register(),
],
let cmds = guild_id )
.set_commands( .await;
&ctx.http,
vec![
commands::roll::register(),
commands::random::register(),
commands::about::register(),
],
)
.await;
match cmds { match cmds {
Ok(c) => println!("Registered {} commands!", c.len()), Ok(c) => println!("Registered {} commands!", c.len()),