Skip to content

Commit 72815e6

Browse files
authored
Merge pull request #78 from Tibo-Ulens/hotfix
General maintenance fixes
2 parents bdc7dc9 + 0d9a9bf commit 72815e6

30 files changed

+785
-2012
lines changed

CONTRIBUTING.md

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ intended to be used in context managers.
1616
## Getting started
1717

1818
You will need to be on a *nix operating system, with docker, docker compose,
19-
make, and python installed.
19+
make, python, and poetry installed.
2020

2121
You can set up the project locally by running `make setup`.
2222

@@ -29,10 +29,14 @@ container, run the migrations, and then stop the container again.
2929

3030
### Utilities
3131

32-
- `make setup` will create/download the stuff needed to work on the project
32+
- `make` will pull the latest docker image from GHCR and run it
33+
- `make dev` will build a docker image from the local code and run it
34+
- `make down` will stop all running containers
3335
- `make dbd` will spin up a headless instance of the database container
36+
- `make chd` will spin up a headless instance of the cache container
3437
- `make psql` will start a psql instance in the database container
35-
- `make down` will stop all running containers
38+
- `make redis` will start a redis CLI instance in the cache container
39+
- `make setup` will create/download the stuff needed to work on the project
3640

3741
### Issues
3842

Dockerfile.bot

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ FROM python:3.11.5-slim
22

33
ENV DEBIAN_FRONTEND=noninteractive
44
RUN apt update \
5-
&& apt install -y libpq5 libpq-dev python3-dev gcc wget firefox-esr \
5+
&& apt install -y libpq5 libpq-dev python3-dev gcc \
66
&& rm -rf /var/lib/apt/lists/*
77

88
# Disable pip cache and poetry venvs
@@ -12,13 +12,6 @@ ENV PIP_NO_CACHE_DIR=false \
1212
# Get poetry
1313
RUN pip install -U poetry
1414

15-
# Get selenium webdriver
16-
RUN wget \
17-
https://github.com/mozilla/geckodriver/releases/download/v0.31.0/geckodriver-v0.31.0-linux64.tar.gz
18-
RUN tar xvzf geckodriver-v0.31.0-linux64.tar.gz
19-
RUN rm -rf geckodriver-v0.31.0-linux64.tar.gz
20-
RUN mv geckodriver /usr/bin && chmod +x /usr/bin/geckodriver
21-
2215
WORKDIR /freud_bot
2316

2417
# Install deps

Dockerfile.webconfig

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ FROM python:3.11.5-slim
22

33
ENV DEBIAN_FRONTEND=noninteractive
44
RUN apt update \
5-
&& apt install -y libpq5 libpq-dev python3-dev gcc wget firefox-esr \
5+
&& apt install -y libpq5 libpq-dev python3-dev gcc \
66
&& rm -rf /var/lib/apt/lists/*
77

88
# Disable pip cache and poetry venvs

README.md

Lines changed: 112 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# FreudBot
22

3-
UGent Psychology Discord server bot
3+
UGent Discord verification and shenanigans bot
44

55
## Contributing
66

@@ -10,47 +10,134 @@ See [the contributing guide](CONTRIBUTING.md) for instructions on how to contrib
1010

1111
Unless stated otherwise all commands are slash commands
1212

13+
### Hooks
14+
15+
- bot mentioned: Responds to the message with a random Freud quote
16+
17+
- new member joins: Sends the member a DM with verification instructions or verifies them
18+
automatically if they are already verified in another Freud-enabled server
19+
20+
- 📌 emoji reaction: If enough people react to a message with this emoji it will be pinned
21+
automatically.
22+
The amount of reactions needed for this is configurable on the website.
23+
1324
### Commands
1425

1526
#### Configuration
1627

17-
- `$freud_sync` (MESSAGE COMMAND) (OWNER ONLY) - force-syncs the bot's slash commands to
18-
whatever guild it's connected to
19-
- `/config admin_role` (OWNER ONLY) - Set the role that 'admin' members will have
20-
- `/config verified_role` (ADMIN ONLY) - Set the role that's given to verified members
21-
- `/config verification_channel` (ADMIN ONLY) - Set the channel in which the `/verify`
22-
command may be used
23-
- `/config logging_channel` (ADMIN ONLY) - Set the channel into which log messages will be
28+
***The configuration commands are largely deprecated and have been replaced by the config website
29+
https://freudbot.org***
30+
31+
- `$freud_sync` \
32+
(MESSAGE COMMAND) \
33+
(MANAGE GUILD) \
34+
force-syncs the bot's slash commands to
35+
whatever guild it's connected to. This can be used after a new version of the bot goes live to
36+
ensure all commands are up to date, however just waiting for around an hour will achieve the same
37+
goal.
38+
39+
- `/config admin_role` \
40+
(MANAGE GUILD) \
41+
Set the role that 'admin' members will have, this is used to check permissions for the other
42+
`/config` commands
43+
44+
- `/config verified_role` \
45+
(ADMIN) \
46+
Set the role that's given to verified members
47+
48+
- `/config logging_channel` \
49+
(ADMIN) \
50+
Set the channel into which log messages will be
2451
posted
2552

26-
#### Calendar
53+
- `/config confession_channel` \
54+
(ADMIN) \
55+
Set the channel where approved confessions will be posted
2756

28-
- `/calendar` - Build an image to show your calendar for this week
29-
- `/course enroll` - Set yourself as enrolled in a course
30-
- `/course drop` - Unset yourself as enrolled in a course
31-
- `/course overview` - Send a list of all courses you are enrolled in
32-
- `/course add` (ADMIN ONLY) - Add an available course and scrape its lecture dates
33-
- `/course remove` (ADMIN ONLY) - Remove an available course
34-
- `/course list` (ADMIN ONLY) - List all available Courses
57+
- `/config confession_approval_channel` \
58+
(ADMIN) \
59+
Set the channel where confessions awaiting approval will be posted (this should be a channel only
60+
admins can access)
3561

3662
#### Verification
3763

38-
- `/verify <email>` - Sends an email to `<email>` containing a verification
39-
code the user can then use in the `/verify <code>` command
40-
- `/verify <code>` - Checks if the supplied code is valid for a given user
41-
and gives them the 'Verified' role if it is.
64+
- `/verify` - Sends a DM to the user with verification instructions, this can be used in case the
65+
user didn't receive a DM or if the previous messsages buttons have expired.
66+
67+
#### Confessions
68+
69+
Confessions can be sent as replies to other confessions by adding the confession ID as an optional
70+
argument.
71+
72+
eg.
73+
You can reply to "Anonymous Confession (#14) - I like ducks"
74+
with `/confess normal "So do I" "14"`
75+
76+
Note: this is a bit scuffed at the moment and might not work exceptionally well, bugfixes pending.
77+
78+
- `/confess normal <confession> [<reply>]` - Sends a normal, anonymous confession.
79+
80+
- `/confess russian <confession> [<reply>]` - Sends a russian roulette confession with a 1/6
81+
chance of exposing the user who sent it
82+
83+
- `/confess extreme <confession> [<reply>]` - Sends an extreme roulette confession with a 1/2
84+
chance of exposing the user who sent it
85+
86+
#### Message Scheduling
87+
88+
Working with time in python is pain, so this command is also pain.
89+
Use at your own risk.
90+
91+
- `/schedule <channel> <time> [<timezone>] [<message>]` - Schedules a message to be sent in
92+
`<channel>` at a given `<time>` \
93+
- `<time>` is a string in the format "%Y/%m/%d %H:%M"
94+
- `<timezone>` is the timezone of your timestamp (default UTC)
95+
(UTC = 0000, CET = 0100, CEST = 0200)
96+
- `<message>` can be given inline or left empty, if left empty a popup will appear with more
97+
space to type your message.
98+
99+
#### FreudPoints
100+
101+
FreudPoints aren't exceptionally useful at this point, but hopefully they will eventually have
102+
some purpose like a shop mechanic.
103+
104+
- `/freudpoint award <user> [<amount>]` - Awards `<user>` `<amount>` (default 1) FreudPoint(s)
105+
106+
#### Freudr
107+
108+
Freudr Dating Service, because discord users are too afraid of actual social interaction.
109+
When 2 users match, FreudBot will send them both a DM to congratulate them on their newfound
110+
love.
111+
112+
- `/freudr like <user>` - Adds a user to your likes (you can only like the same user once every
113+
24 hours)
114+
115+
- `/freudr unlike <user>` - Removes a user from your likes
116+
117+
- `/freudr list` - See a list of your likes and matches
118+
119+
#### Statistics
120+
121+
At the moment FreudBot doesn't keep track of a whole lot of statistics, but this should change in
122+
the "near" future.
123+
124+
- `/freudstat me` - See an overview of the statistics FreudBot tracks about you
125+
126+
- `/freudstat profile <user>` - See an overview of the statistics FreudBot tracks about another
127+
user
128+
129+
- `/freudstat leaderboard` - See the leaderboards for the stats FreudBot tracks, selectable with a
130+
dropdown menu
42131

43132
#### Random
44133

45134
- `/mommy` - You can figure this one out for yourself
46135

47136
#### Link Shortcuts (DEPRECATED)
48137

49-
- `/drive <course>` - Send a link to a google drive for that course
50-
51-
### Hooks
52-
53-
- on mention: Responds to the message with a random Freud quote
138+
- `/drive <shortcut>` - Send a link to a hardcoded google drive folder
139+
At the moment this is only useful for the psychology discord, so other servers should disable this
140+
command
54141

55142
## Running
56143

alembic.ini

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ script_location = alembic
66

77
# template used to generate migration file names; The default value is %%(rev)s_%%(slug)s
88
# Uncomment the line below if you want the files to be prepended with date and time
9-
# file_template = %%(year)d_%%(month).2d_%%(day).2d_%%(hour).2d%%(minute).2d-%%(rev)s_%%(slug)s
9+
file_template = %%(year)d-%%(month).2d-%%(day).2d_%%(hour).2d:%%(minute).2d_%%(rev)s_%%(slug)s
1010

1111
# sys.path path, will be prepended to sys.path if present.
1212
# defaults to the current working directory.

alembic/versions/8b81404b70b3_create_profile_table.py renamed to alembic/versions/2022-09-03_00:22_8b81404b70b3_create_profile_table.py

File renamed without changes.

alembic/versions/a2bd79234f94_create_course_table.py renamed to alembic/versions/2022-09-28_17:37_a2bd79234f94_create_course_table.py

File renamed without changes.

alembic/versions/6f04bc4e4691_create_enrollment_table.py renamed to alembic/versions/2022-10-01_18:00_6f04bc4e4691_create_enrollment_table.py

File renamed without changes.

alembic/versions/ce233a03ec25_create_config_table.py renamed to alembic/versions/2022-12-22_04:10_ce233a03ec25_create_config_table.py

File renamed without changes.

alembic/versions/30892f96f367_create_lecture_table.py renamed to alembic/versions/2022-12-25_21:12_30892f96f367_create_lecture_table.py

File renamed without changes.

0 commit comments

Comments
 (0)