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
|
@ -1,50 +0,0 @@
|
|||
import { ComponentTypes, InteractionTypes, MessageFlags } from "oceanic.js";
|
||||
import { client } from ".";
|
||||
import { db } from "./database";
|
||||
import { PendingApplicationMessage } from "./components/PendingApplicationMessage";
|
||||
import { canUser } from "./utils";
|
||||
|
||||
client.on("interactionCreate", async (interaction) => {
|
||||
if (interaction.type === InteractionTypes.MESSAGE_COMPONENT)
|
||||
if (interaction.data.componentType === ComponentTypes.BUTTON) {
|
||||
if (!canUser(interaction.member!, "owner"))
|
||||
return await interaction.createMessage({
|
||||
flags: MessageFlags.EPHEMERAL,
|
||||
content: "💢 nop"
|
||||
});
|
||||
|
||||
const application = await db.get(
|
||||
"SELECT * FROM applications WHERE message_id=?",
|
||||
interaction.message.id
|
||||
);
|
||||
|
||||
switch (interaction.data.customID.split("-")[0]) {
|
||||
case "lock": {
|
||||
await interaction.editParent(
|
||||
<PendingApplicationMessage
|
||||
id={application.id}
|
||||
response={JSON.parse(application.responses)}
|
||||
user={await client.rest.users.get(
|
||||
application.user_id
|
||||
)}
|
||||
locked={true}
|
||||
/>
|
||||
);
|
||||
break;
|
||||
}
|
||||
case "unlock": {
|
||||
await interaction.editParent(
|
||||
<PendingApplicationMessage
|
||||
id={application.id}
|
||||
response={JSON.parse(application.responses)}
|
||||
user={await client.rest.users.get(
|
||||
application.user_id
|
||||
)}
|
||||
locked={false}
|
||||
/>
|
||||
);
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
});
|
Loading…
Add table
Add a link
Reference in a new issue