This commit is contained in:
@@ -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_
|
||||||
|
|
||||||
|
|||||||
@@ -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
|
||||||
|
|||||||
+2
-11
@@ -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,15 +34,7 @@ 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")
|
|
||||||
.expect("Expected GUILD_ID in environment")
|
|
||||||
.parse()
|
|
||||||
.expect("GUILD_ID must be an integer"),
|
|
||||||
);
|
|
||||||
|
|
||||||
let cmds = guild_id
|
|
||||||
.set_commands(
|
|
||||||
&ctx.http,
|
&ctx.http,
|
||||||
vec![
|
vec![
|
||||||
commands::roll::register(),
|
commands::roll::register(),
|
||||||
|
|||||||
Reference in New Issue
Block a user