Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions internal/standup-bot/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,10 @@ Codebloom Standup Bot is an internal application written in [Rust](https://rust-
1. Fill out your `.env` file
1. Simply run `cargo run` to compile & run the binary.

`DISCORD_ROLE_ID` is required and must be an unsigned 64-bit integer. It selects
the role mentioned in standup messages and the members eligible for end-of-day
reminders. Set it in `.env` locally and in the deployed service's environment.

### Deployment

_Last updated: 02/15/2026_
Expand Down
2 changes: 2 additions & 0 deletions internal/standup-bot/example.env
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@ DISCORD_TOKEN=
# Point to guild and channel to send standup messages.
DISCORD_GUILD_ID=
DISCORD_CHANNEL_ID=
# Role to mention and select for end-of-day reminders.
DISCORD_ROLE_ID=

REDIS_URI=

Expand Down
2 changes: 2 additions & 0 deletions internal/standup-bot/example.env.production
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@ DISCORD_TOKEN=
# Point to guild and channel to send standup messages.
DISCORD_GUILD_ID=
DISCORD_CHANNEL_ID=
# Role to mention and select for end-of-day reminders.
DISCORD_ROLE_ID=

REDIS_URI=

Expand Down
7 changes: 4 additions & 3 deletions internal/standup-bot/src/discord/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -40,13 +40,13 @@ use crate::{
};

const INTENTS: GatewayIntents = GatewayIntents::GUILD_MEMBERS.union(GatewayIntents::GUILD_MESSAGES);
const ROLE_ID: u64 = 1534007500121313341;

pub struct DiscordClient {
http: Arc<Http>,
cache: Arc<Cache>,
guild_id: u64,
channel_id: u64,
role_id: u64,
}

impl DiscordClient {
Expand Down Expand Up @@ -79,6 +79,7 @@ impl DiscordClient {
cache,
guild_id: creds.guild_id,
channel_id: creds.channel_id,
role_id: creds.role_id,
})
}

Expand All @@ -96,7 +97,7 @@ impl DiscordClient {
)
.colour(Colour::from_rgb(69, 129, 103));
let create_msg = CreateMessage::new()
.content(format!("<@&{ROLE_ID}>"))
.content(format!("<@&{}>", self.role_id))
.embed(embed);
let channel = ChannelId::new(self.channel_id);

Expand All @@ -117,7 +118,7 @@ impl DiscordClient {

pub async fn get_standup_role_members(&self) -> Result<Vec<Member>, DiscordClientError> {
let guild = GuildId::new(self.guild_id);
let role = RoleId::new(ROLE_ID);
let role = RoleId::new(self.role_id);

let members = self
.cache
Expand Down
5 changes: 5 additions & 0 deletions internal/standup-bot/src/env.rs
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ pub struct DiscordCredentials {
pub token: String,
pub guild_id: u64,
pub channel_id: u64,
pub role_id: u64,
}

impl DiscordCredentials {
Expand All @@ -35,6 +36,10 @@ impl DiscordCredentials {
.context("DISCORD_CHANNEL_ID is missing from environment")?
.parse()
.context("DISCORD_CHANNEL_ID is not an integer type")?,
role_id: env::var("DISCORD_ROLE_ID")
.context("DISCORD_ROLE_ID is missing from environment")?
.parse()
.context("DISCORD_ROLE_ID is not an integer type")?,
})
}
}
Expand Down
Loading