Skip to content

Commit 3042947

Browse files
authored
Merge branch 'master' into dev
2 parents e9b6b30 + acd1197 commit 3042947

File tree

4 files changed

+60
-3
lines changed

4 files changed

+60
-3
lines changed
Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
name: Deploy Discord Bot to Development
2+
3+
on:
4+
push:
5+
branches:
6+
- dev
7+
paths:
8+
- "apps/discord-bot/**"
9+
- "infra/docker-compose.dev.yml"
10+
workflow_dispatch:
11+
12+
permissions:
13+
contents: read
14+
packages: write
15+
16+
jobs:
17+
build-and-push:
18+
name: Build and Push Docker Image to GHCR
19+
runs-on: ubuntu-latest
20+
21+
steps:
22+
- name: Checkout repository
23+
uses: actions/checkout@v4
24+
25+
- name: Set up QEMU for cross-platform builds
26+
uses: docker/setup-qemu-action@v2
27+
28+
- name: Set up Docker Buildx
29+
uses: docker/setup-buildx-action@v2
30+
31+
- name: Log in to GitHub Container Registry
32+
uses: docker/login-action@v2
33+
with:
34+
registry: ghcr.io
35+
username: ${{ github.actor }}
36+
password: ${{ secrets.GITHUB_TOKEN }}
37+
38+
- name: Build and push multi-arch image
39+
run: |
40+
docker buildx build \
41+
--platform linux/amd64,linux/arm64 \
42+
--push \
43+
-t ghcr.io/${{ github.repository_owner }}/core-discord-bot:dev \
44+
./apps/discord-bot

.gitignore

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -41,5 +41,3 @@ venv
4141

4242
.env.dev.discord
4343
uv.lock
44-
45-
uv.lock

apps/discord-bot/.env.example

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,4 +5,4 @@ API_URL=https://api.swamphacks.com
55
SESSION_COOKIE=
66
WEBHOOK_URL=
77
WEBHOOK_PORT=
8-
EVENT_ID=
8+
EVENT_ID=

apps/discord-bot/components/support_thread_buttons.py

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -294,6 +294,21 @@ async def callback(self, interaction: Interaction):
294294
except Exception as e:
295295
await interaction.response.send_message(f"❌ Error joining thread: {str(e)}", ephemeral=True)
296296

297+
class JoinThreadButton(Button):
298+
"""Button to join a claimed support thread for additional mentor assistance."""
299+
def __init__(self, thread: discord.Thread):
300+
super().__init__(label="Join Thread", style=ButtonStyle.primary, custom_id="join_thread", emoji="➡️")
301+
self.thread = thread
302+
303+
async def callback(self, interaction: Interaction):
304+
try:
305+
await self.thread.add_user(interaction.user)
306+
await interaction.response.send_message(f"You've joined the thread {self.thread.mention}", ephemeral=True)
307+
except NotFound:
308+
await interaction.response.send_message("❌ This thread no longer exists.", ephemeral=True)
309+
except Exception as e:
310+
await interaction.response.send_message(f"❌ Error joining thread: {str(e)}", ephemeral=True)
311+
297312
class ClaimThreadButton(Button):
298313
"""Button to claim a support thread and add the mentor to it."""
299314
def __init__(self, thread: discord.Thread, description_input: discord.ui.TextInput):

0 commit comments

Comments
 (0)