mirror of
https://github.com/ION606/custom_discordjs.git
synced 2026-05-14 22:26:54 +00:00
Added base modals and 'finished' menus
This commit is contained in:
@@ -0,0 +1,9 @@
|
||||
import { Interaction } from "./interaction.js";
|
||||
|
||||
|
||||
export class Modal extends Interaction {
|
||||
constructor(intRaw, client) {
|
||||
super(intRaw, client);
|
||||
console.log(intRaw);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,28 @@
|
||||
import { Modal } from "./Modal.js";
|
||||
import { Interaction } from "./interaction.js";
|
||||
import { interactionTypes } from "./interactionTypes.js";
|
||||
|
||||
|
||||
function selectMenuTypes(inp) {
|
||||
|
||||
}
|
||||
|
||||
export function createInteraction(intRaw, client) {
|
||||
switch (intRaw.type) {
|
||||
case interactionTypes.ApplicationCommand:
|
||||
return new Interaction(intRaw, client);
|
||||
|
||||
case interactionTypes.MessageComponent:
|
||||
console.log(intRaw.message.components);
|
||||
return null;
|
||||
|
||||
case interactionTypes.ModalSubmit:
|
||||
return new Modal(intRaw, client);
|
||||
|
||||
case interactionTypes.Ping:
|
||||
console.log("pong");
|
||||
return null;
|
||||
|
||||
default: console.log(`UNKNOWN INTERACTION:\n`, intRaw);
|
||||
}
|
||||
}
|
||||
@@ -21,6 +21,7 @@ class interactionOptions {
|
||||
focused;
|
||||
|
||||
constructor(o) {
|
||||
console.log(o);
|
||||
for (const k in this) {
|
||||
if (o[k]) this[k] = o[k];
|
||||
}
|
||||
|
||||
@@ -0,0 +1,8 @@
|
||||
export const interactionTypes = Object.freeze({
|
||||
Ping: 1,
|
||||
ApplicationCommand: 2,
|
||||
MessageComponent: 3,
|
||||
ApplicationCommandAutocomplete: 4,
|
||||
ModalSubmit: 5
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user