461 Commits

Author SHA1 Message Date
Rory&
09147ae51c Update copyright date in pin endpoints 2025-09-29 18:38:06 +02:00
CyberL1
3e93ad8a87 fix: don't set order for counting queries 2025-09-29 18:32:21 +02:00
CyberL1
6bf4109465 fix: set DESC order 2025-09-29 18:32:21 +02:00
CyberL1
8e18a642fe refactor: don't use query builder 2025-09-29 18:32:21 +02:00
CyberL1
29c4a6695c refactor: don't use query builder 2025-09-29 18:32:21 +02:00
CyberL1
5c332ae763 refactor: add pinned getter to Message entity 2025-09-29 18:32:21 +02:00
CyberL1
dc3a85f078 refactor: use pinned_at to check if message is pinnned 2025-09-29 18:32:21 +02:00
CyberL1
b8b461f0db fix: getting message pinss 2025-09-29 18:32:21 +02:00
MathMan05
b461da9b8f fix stupid bug 2025-09-29 00:08:23 +02:00
Puyodead1
6ff8eec722
prevent re-verifying email 2025-09-05 18:35:50 -04:00
Puyodead1
b8b9b038cf
fixes and minor changes for email stuff 2025-09-05 18:03:59 -04:00
Puyodead1
5fafb6d156
fix an issue with NO_AUTHENTICATE routes 2025-09-05 17:47:42 -04:00
Rory&
9d314cd995 More cleanup 2025-07-27 15:49:37 +02:00
Emma [it/its]@Rory&
bd81cde977 WIP logo/terminal stuff 2025-07-27 15:49:37 +02:00
Emma [it/its]@Rory&
3f7d26118d Implement CRUD for automod 2025-07-27 15:49:37 +02:00
dank074
7261766459 add types to the ban api response objects 2025-07-21 16:05:14 -05:00
dank074
3c0efd17bc update guild bans api 2025-07-21 00:46:14 -05:00
Puyodead1
9347a3ec6f
Merge pull request #1305 from ZaneH/feat/handle-github-webhook
Implement GitHub-compatible webhook
2025-07-12 12:56:00 -04:00
Rory&
d58414c9c5 Modern pins endpoints 2025-07-08 22:45:57 +02:00
Rory&
cb0443821e Add emoji source endpoint 2025-07-07 21:59:25 +02:00
Rory&
5205ccecd5 Add endpoint to get account standing 2025-07-07 20:40:38 +02:00
Rory&
b590482bfb Prettier 2025-07-06 18:03:17 +02:00
Rory&
9e4a769d69 Fix forgotten function signature changes 2025-07-06 18:03:17 +02:00
Rory&
2e196573ea Make IP/user-agent validation in CDN work 2025-07-06 18:03:17 +02:00
Emma [it/its]@Rory&
0fcdbd2831 sign attachment on sending message 2025-07-06 18:03:17 +02:00
Emma [it/its]@Rory&
387cef269a Sign media per user 2025-07-06 18:03:17 +02:00
Emma [it/its]@Rory&
0e0da6d722 Add options to erquire IP or User Agent to access CDN 2025-07-06 18:03:17 +02:00
Emma [it/its]@Rory&
3e549dae28 Fix typeorm queries no longer allowing empty where clauses 2025-07-06 09:18:22 +02:00
Emma [it/its]@Rory&
fca7953a51 Update some dependencies, fix nix 2025-07-02 15:54:23 +02:00
MathMan05
6ab26cb3ff Fix the fix
this should actually be what's intended
2025-07-02 09:21:24 +10:00
MathMan05
76857bdcfb Check for old password when setting new
Checks for password
2025-07-02 09:21:24 +10:00
Zane Helton
ed85ba3dc2 Proxy avatar URL + adjust event logic
I've proxied the URLs with `getProxyUrl` specifying the size as 80x80.

I've also adjusted the event logic so that unstarring doesn't trigger an
alert and I've disabled the 'watch' event because Discord doesn't use
it either.
2025-06-29 12:17:24 -04:00
Zane Helton
590331518c Make tsc happy when using strings as Date in embed
Validation on embeds has interesting behavior. Embeds have a `timestamp`
property that is of type `Date`. However when providing a Date,
`WebhookExecuteSchema` silently ends the operation.

The resolution was to use strings and to annotate them with `//
@ts-expect-error`. This was not my first choice, but it was the best
option I saw.

The other option is to allow `Embeds` to pass strings as a timestamp but
I'd want a second opinion before making that change.
2025-06-29 11:34:57 -04:00
Zane Helton
9143c1d408 Refactor /github endpoint into it's own file 2025-06-29 10:46:16 -04:00
Zane Helton
82642d0e97 Capitalize ref_type when using in embed
The GitHub API provides `ref_type` as lowercase. For consistency, this
adds a utility function and makes use of it when formatting the `create`
event from GitHub.

tag => Tag
branch => Branch
2025-06-29 03:56:01 -04:00
Zane Helton
77dd481742 Implement webhook handler for GitHub
I've created a middleware that runs when `/github` is appended to the
webhook URL. The middleware parses the GitHub webhook and turns it into
usable embeds.
2025-06-29 03:18:43 -04:00
Zane Helton
33fde3bc4a Fix the creation of guilds from templates
The biggest hold-up was missing fields (`premium_tier`,
`welcome_screen`, etc.) but it looks like someone has provided a
helpful function called `createGuild(...)` to provide sensible default
values.

This commit fixes the errors related to creating a guild from a
template. I've also refactored the code to include roles and channels in
the template.

To make sure that the @everyone role is cloned correctly, when
creating the guild from a template, we check if the role's ID
matches the template's `source_guild_id`. If it does, we set the
@everyone role to the new guild's ID.
2025-06-29 13:27:14 +10:00
Zane Helton
eec2a8ba85 Set premium_tier to 0 when creating guild from template
I think we'll need to discuss the proper way to provide default values
here. `premium_tier` for example should never be provided from the
template so it's fine going after the spread operator.

This commit still doesn't allow guilds to be created from template
because the next error is that `welcome_screen` doesn't exist. Our
options:

1. Provide default values in the ORM
2. Provide default values in the guild creation process
3. Throw an error if the template is missing values

Resolves: #1283 but creates a new issue
2025-06-29 13:27:14 +10:00
Zane Helton
ff692c19b7 Await guild creation to fix a race condition
`Promise.all(...)` runs these simultaneously, yet role depends on the
guild to be created first. This can lead to a race condition. I've
awaited role creation too because the call to `Member.addToGuild(...)`
relies on the role to be created.
2025-06-29 13:27:14 +10:00
Zane Helton
4772731a17 Fix PATCH Template route implementation
The previous PATCH implementation was creating a new template rather
than editing the existing template. This resulted in all requests
failing because it was missing more than one required field.

Resolves: #1281
2025-06-29 13:25:22 +10:00
Zane Helton
4f75919651 Add OP to message.mentions when replied to
The `message.message_reference` stores:

1. `message_id`
2. `channel_id`
3. `guild_id`

We use the `message_id` and `channel_id` to `.findOne(...)` Message, and
find the author. If the author is the same as OP, we skip (so replying
to yourself doesn't add you to the mentions array) otherwise, it adds
the author_id to the mentions array.

Resolves: #1247
2025-06-29 09:14:58 +10:00
Zane Helton
e8d3f655a3 Preserve reactions when a message is edited
Resolves #1241
2025-06-29 08:44:47 +10:00
Zane Helton
81d4313631 Properly filter existing embed links
In a previous PR, I was checking if the `.url` property existed, the
correct fix is to remove any embed that isn't a rich embed
type (non-link).

See also: #1296
2025-06-29 08:39:42 +10:00
Zane Helton
184433b078 Start fresh when updating embeds for links
In a previous commit I was attempting to be clever by only
replacing/removing embeds if necessary. This not only made the logic
more confusing but introduced a bug that would allow for orphaned
embeds when updating the search params of a URL.

This commit will remove all embeds that have a `.url` property and start
fresh. This simplifies the code and eliminates the aforementioned bug.
2025-06-28 18:30:52 +10:00
Zane Helton
f9cfb46e73 Fix various issues with embeds on message updates
The `postHandleMessage` function is parsing links and adding them to the
EmbedCache table if necessary. In the previous implementation, message
updates would push to the embeds unconditionally.

This commit parses links from the message and:

1. Normalizes the URLs
  - Useful for deduplicating similar URLs
2. Remove embeds with matching normalized URLs
  - Leaves all embeds except for ones with a `.url` property matching
  the updated message
  - This allows embeds to be re-ordered if the URL is moved
3. If no normalized URLs are found, remove all embeds
4. Take the deduplicated + normalized URLs and add an embed to the message and
insert into the EmbedCache table (if necessary)

This enables:

1. Embeds to be re-ordered by re-ordering links
2. Embeds to be removed by removing links

and fixes:

1. Duplicate embeds being attached to a message when edited
2025-06-28 18:30:52 +10:00
Zane Helton
c0f9c22e67 Add validation to date_of_birth registration field
Resolves: #1020
2025-06-28 17:08:00 +10:00
dank074
526a8da8f5
add webrtc support (#1284)
Co-authored-by: MaddyUnderStars <46743919+MaddyUnderStars@users.noreply.github.com>
2025-06-22 12:41:13 +10:00
MathMan05
f03c6209a4 send the real index 2025-05-28 08:46:35 +02:00
MathMan05
e219c1a33a code relies on things done in a certain order
This makes sure that the code gets done in the order that is expected
2025-05-28 08:46:35 +02:00
MathMan05
4f6211ce50 remove missed log 2025-05-28 08:46:35 +02:00