internal corporate restructuring (90% of our engineer team has been laid off and replaced by Grok)
This commit is contained in:
parent
e377117d33
commit
7dcc0c2cc4
11 changed files with 184 additions and 96 deletions
37
src/joinRequestActions/interview.ts
Normal file
37
src/joinRequestActions/interview.ts
Normal file
|
@ -0,0 +1,37 @@
|
|||
import { ComponentTypes, InteractionTypes, MessageFlags } from "oceanic.js";
|
||||
import { client } from "..";
|
||||
import { canUser } from "../utils/utils";
|
||||
import { selfappReq } from "../utils/selfappReq";
|
||||
|
||||
client.on("interactionCreate", async (interaction) => {
|
||||
if (interaction.type === InteractionTypes.MESSAGE_COMPONENT)
|
||||
if (interaction.data.componentType === ComponentTypes.BUTTON) {
|
||||
if (interaction.data.customID.split("-")[0] === "interview") {
|
||||
await interaction.defer(MessageFlags.EPHEMERAL);
|
||||
if (!canUser(interaction.member!, "review"))
|
||||
return await interaction.createFollowup({
|
||||
flags: MessageFlags.EPHEMERAL,
|
||||
content: "💢 nop"
|
||||
});
|
||||
const gdmID = (
|
||||
(await selfappReq(
|
||||
`/join-requests/${
|
||||
interaction.data.customID.split("-")[1]
|
||||
}/interview`,
|
||||
"POST"
|
||||
)) as any
|
||||
).id;
|
||||
const gdmInvite = (
|
||||
(await selfappReq(
|
||||
`/channels/${gdmID}/invites`,
|
||||
"POST"
|
||||
)) as any
|
||||
).code;
|
||||
|
||||
return await interaction.createFollowup({
|
||||
flags: MessageFlags.EPHEMERAL,
|
||||
content: `https://discord.gg/${gdmInvite}`
|
||||
});
|
||||
}
|
||||
}
|
||||
});
|
Loading…
Add table
Add a link
Reference in a new issue