mirror of
https://github.com/roleypoly/roleypoly.git
synced 2025-06-16 17:49:09 +00:00
feat: Slash Commands (#337)
* feat: add discord interactions worker * feat(interactions): update CI/CD and terraform to add interactions * chore: fix lint issues * chore: fix build & emulation * fix(interactions): deployment + handler * chore: remove worker-dist via gitignore * feat: add /pickable-roles and /pick-role basis * feat: add pick, remove, and update the general /roleypoly command * fix: lint missing Member import
This commit is contained in:
parent
dde05c402e
commit
066f68ffef
59 changed files with 1219 additions and 248 deletions
|
@ -1,35 +1,21 @@
|
|||
import { userAgent } from '@roleypoly/api/utils/api-tools';
|
||||
import { uiPublicURI } from '@roleypoly/api/utils/config';
|
||||
import {
|
||||
Category,
|
||||
DiscordUser,
|
||||
Embed,
|
||||
GuildData,
|
||||
GuildDataUpdate,
|
||||
GuildSlug,
|
||||
WebhookValidationStatus,
|
||||
} from '@roleypoly/types';
|
||||
import { userAgent } from '@roleypoly/worker-utils';
|
||||
import deepEqual from 'deep-equal';
|
||||
import { sortBy, uniq } from 'lodash';
|
||||
|
||||
type WebhookEmbed = {
|
||||
fields: {
|
||||
name: string;
|
||||
value: string;
|
||||
inline: boolean;
|
||||
}[];
|
||||
timestamp: string;
|
||||
title: string;
|
||||
color: number;
|
||||
author?: {
|
||||
name: string;
|
||||
icon_url: string;
|
||||
};
|
||||
};
|
||||
|
||||
type WebhookPayload = {
|
||||
username: string;
|
||||
avatar_url: string;
|
||||
embeds: WebhookEmbed[];
|
||||
embeds: Embed[];
|
||||
provider: {
|
||||
name: string;
|
||||
url: string;
|
||||
|
@ -39,7 +25,7 @@ type WebhookPayload = {
|
|||
type ChangeHandler = (
|
||||
oldValue: GuildDataUpdate[keyof GuildDataUpdate],
|
||||
newValue: GuildData[keyof GuildDataUpdate]
|
||||
) => WebhookEmbed[];
|
||||
) => Embed[];
|
||||
|
||||
const changeHandlers: Record<keyof GuildDataUpdate, ChangeHandler> = {
|
||||
message: (oldValue, newValue) => [
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue