Skip to content

Commit acd1197

Browse files
h1divpSobaSkeeAlexanderWangYStanley KeStanleyKeUF
authored
feat: check-in, redeemables, welcome email, discord updates (#294)
* feat: complete webhook and add auto assign commands * feat: create endpoint for discord bot and event listener to add auto add role * actual update * refactor: old implementation reworked to use endpoints from api * chore: remove old db file * chore: remove gemini api key requirement * fix: revert accounts go sqlc version * fix: rename hacker_role to role * fix: refactor code to get event role by discord and event id * Check in scanner (#284) * feat: qr code generation for frontend * temp: adding api for checkin * temp: some frontend changes * fix: remove useless intents * temp: get user with event info * temp: modal for checking in and rfid hidden text input * temp: check in modal; * feat: check in scanner * fix: remove event id tests from intents (#285) * fix/parse intents tests (#286) * fix: remove event id tests from intents * fix: remove dangling component * chore: change to to be announced (#287) * feat: add event id when calling endpoint * fix: sqlc generate, deleted large bin file * Stanley/basic bot structure (#216) * chore(env): setup development and production python venvs * feat: add message trigger command for bot * Create readme.md (#3) * chore: complete merge conflict and rebase * chore: rewrite readme * feat: add regex to identify potential scam/spam messages in antiSpam cog * refactor: organize and break up functions, add detailed comments, add remove role command * refactor: include direction in readme to select interpreter and add any pycache or venvs file types to gitignore * feat: create panel command and reusable buttons added * feat: update anti_spam to have new spam detection, add support cog with request features * add mentor role functions and rework ticket panel * feat: implement round-robin for pinging available mentors * feat: make threads archived, add limits to user inputs, clear selection options * feat: add mod command to grant user access to private vcs * feat: add command to create a support vc * fix: create the logs folder if it does not exist * feat: add command to prompt gemini and integrate uv as new package manager * chore: add llm command since it did not add in merge * feat: update readme with new uv commands * feat: add structured output for llm * feat: make mod role based on perms and not rely on config * chore: add docstrings for each function describing their purposes * feat: create first iteration of workflow for discord bot * feat: push workflow file * fix: update dev yml file for discord * feat: add join button to reports embed * feat: create fastapi backend to add check user in server api * refactor: abstract role names to roles_config file * feat: update round robin logic and renew api token * feat: create announcement command * fix: update announcemnet command to allow mentions * refactor: rename support vcs category * fix: add is mod slash function back * Update .gitignore * Delete apps/discord-bot/uv.lock --------- Co-authored-by: Phoenix <71522316+h1divp@users.noreply.github.com> Co-authored-by: Stanley Ke <stanleyke@Mac.lan> Co-authored-by: Stanley <ke.st@ufl.edu> * Redemptions (#288) * Table Migration * SQLC Go functions * Backend Scaffolding * Basic CRUD operations + Refactor API * Fixed repo level issue + finished logic * Small Push * Remigrate Deleted and remigrated a migration to avoid bugs from merging dev * Redeemables UI * Update Modal + QR Code QR is untested currently * Slight UI Adjustment + Deletion * UI Adjustment * Clarified Redemption Info * Documentation * UpdateRedemption missing body fix * 1 line bug fix * Cleaner handlers uuid parsing + qr throttling * feat: resume downloader script; fix: add to gitignore (#289) * fix: injected services (#290) * feat: welcome email release (#291) * feat: QueueWelcomeEmail api route, handler and service * refactor: pass template data in struct * fix: property names * feat: qr image generation, upload, link generation, and welcome email queue * feat: get slice of attendee userIds, added route to send all welcome emails; fixes: various * qr code fixes (#293) * feat: QueueWelcomeEmail api route, handler and service * refactor: pass template data in struct * fix: property names * feat: qr image generation, upload, link generation, and welcome email queue * feat: get slice of attendee userIds, added route to send all welcome emails; fixes: various * fix: error msg, email template * feat: err log on empty contact email and continue loop * fix: dont break loop --------- Co-authored-by: Stanley Ke <kestanley101@gmail.com> Co-authored-by: Alexander Wang <98280966+AlexanderWangY@users.noreply.github.com> Co-authored-by: Stanley Ke <117794857+SobaSkee@users.noreply.github.com> Co-authored-by: Stanley Ke <stanleyke@Mac.lan> Co-authored-by: Stanley <ke.st@ufl.edu> Co-authored-by: Hugo Liu <98724522+hugoliu-code@users.noreply.github.com>
1 parent fb1aa73 commit acd1197

File tree

97 files changed

+6305
-434
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

97 files changed

+6305
-434
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: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,3 +38,6 @@ coverage/
3838
venv
3939

4040
**/.pnpm-store/
41+
42+
.env.dev.discord
43+
uv.lock

apps/api/.env.dev.example

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,9 @@ AUTH_DISCORD_CLIENT_ID=
1313
AUTH_DISCORD_CLIENT_SECRET=
1414
AUTH_DISCORD_REDIRECT_URI="http://localhost:8080/auth/callback"
1515

16+
# CF
17+
CORE_BUCKETS_USER_QRCODES_BASE_URL=
18+
1619
# For cookies
1720
COOKIE_DOMAIN=localhost
1821
COOKIE_SECURE=false

apps/api/cmd/BAT_worker/main.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,7 @@ func main() {
8282
batRunsRepo := repository.NewBatRunsRepository(database)
8383

8484
sesClient := email.NewSESClient(cfg.AWS.AccessKey, cfg.AWS.AccessKeySecret, cfg.AWS.Region, logger)
85-
emailService := services.NewEmailService(taskQueueClient, sesClient, logger)
85+
emailService := services.NewEmailService(taskQueueClient, sesClient, nil, logger)
8686
batService := services.NewBatService(applicationRepo, eventRepo, userRepo, batRunsRepo, emailService, txm, nil, scheduler, logger)
8787
applicationService := services.NewApplicationService(applicationRepo, userRepo, eventService, emailService, txm, nil, nil, scheduler, logger)
8888

apps/api/cmd/api/main.go

Lines changed: 18 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -82,19 +82,35 @@ func main() {
8282
teamMemberRepo := repository.NewTeamMemberRespository(database)
8383
teamJoinRequestRepo := repository.NewTeamJoinRequestRepository(database)
8484
batRunsRepo := repository.NewBatRunsRepository(database)
85+
redeemablesRepo := repository.NewRedeemablesRepository(database)
8586

8687
// Injections into services
8788
authService := services.NewAuthService(userRepo, accountRepo, sessionRepo, txm, client, logger, &cfg.Auth)
8889
userService := services.NewUserService(userRepo, logger)
8990
eventInterestService := services.NewEventInterestService(eventInterestRepo, logger)
9091
eventService := services.NewEventService(eventRepo, userRepo, r2Client, &cfg.CoreBuckets, logger)
91-
emailService := services.NewEmailService(taskQueueClient, sesClient, logger)
92+
emailService := services.NewEmailService(taskQueueClient, sesClient, r2Client, logger)
9293
applicationService := services.NewApplicationService(applicationRepo, userRepo, eventService, emailService, txm, r2Client, &cfg.CoreBuckets, nil, logger)
9394
teamService := services.NewTeamService(teamRepo, teamMemberRepo, teamJoinRequestRepo, eventRepo, txm, logger)
9495
batService := services.NewBatService(applicationRepo, eventRepo, userRepo, batRunsRepo, emailService, txm, taskQueueClient, nil, logger)
96+
redeemablesService := services.NewRedeemablesService(redeemablesRepo, logger)
97+
discordService := services.NewDiscordService(eventRepo, logger)
9598

9699
// Injections into handlers
97-
apiHandlers := handlers.NewHandlers(authService, userService, eventInterestService, eventService, emailService, applicationService, teamService, batService, cfg, logger)
100+
apiHandlers := handlers.NewHandlers(
101+
authService,
102+
userService,
103+
eventInterestService,
104+
eventService,
105+
emailService,
106+
applicationService,
107+
teamService,
108+
batService,
109+
redeemablesService,
110+
discordService,
111+
cfg,
112+
logger,
113+
)
98114

99115
api := api.NewAPI(&logger, apiHandlers, mw)
100116

apps/api/cmd/email_worker/main.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ func main() {
4141
// Create ses client
4242
sesClient := email.NewSESClient(cfg.AWS.AccessKey, cfg.AWS.AccessKeySecret, cfg.AWS.Region, logger)
4343

44-
emailService := services.NewEmailService(nil, sesClient, logger)
44+
emailService := services.NewEmailService(nil, sesClient, nil, logger)
4545
emailWorker := workers.NewEmailWorker(emailService, logger)
4646

4747
mux := asynq.NewServeMux()

0 commit comments

Comments
 (0)