mirror of
https://github.com/ION606/custom_discordjs.git
synced 2026-05-14 22:26:54 +00:00
Added message select menues (mentionable not available)
This commit is contained in:
+29
-16
@@ -10,25 +10,38 @@ import { ChannelSelectMenu, StringMenuComponent, StringSelectMenu, userSelectMen
|
||||
*/
|
||||
export async function buttonTests(mog) {
|
||||
var m = new message();
|
||||
// const comp = new Button();
|
||||
// comp.style = MessageButtonStyles.SUCCESS;
|
||||
// comp.label = "HELLO WORLD";
|
||||
// comp.custom_id = "temptemp";
|
||||
|
||||
const c = new StringSelectMenu();
|
||||
const comp2 = new StringMenuComponent();
|
||||
comp2.value = 'llllll';
|
||||
comp2.label = 'llllll';
|
||||
c.options.push(comp2);
|
||||
c.custom_id = "temp";
|
||||
const btnSuccess = new Button();
|
||||
btnSuccess.style = MessageButtonStyles.SUCCESS;
|
||||
btnSuccess.label = "SUCCESS";
|
||||
btnSuccess.custom_id = "tempbtnsu";
|
||||
|
||||
const btnDanger = new Button();
|
||||
btnDanger.style = MessageButtonStyles.DANGER;
|
||||
btnDanger.label = "HELLO WORLD";
|
||||
btnDanger.custom_id = "tempbtnda";
|
||||
|
||||
const btnSecondary = new Button();
|
||||
btnSecondary.style = MessageButtonStyles.SECONDARY;
|
||||
btnSecondary.label = "HELLO WORLD";
|
||||
btnSecondary.custom_id = "tempbtnse";
|
||||
|
||||
const btnPrim = new Button();
|
||||
btnPrim.style = MessageButtonStyles.PRIMARY;
|
||||
btnPrim.label = "HELLO WORLD";
|
||||
btnPrim.custom_id = "temppr";
|
||||
|
||||
const btnLink = new Button();
|
||||
btnLink.style = MessageButtonStyles.LINK;
|
||||
btnLink.label = "HELLO WORLD";
|
||||
btnLink.url = 'https://www.google.com/';
|
||||
|
||||
const comp3 = new userSelectMenu();
|
||||
comp3.custom_id = "userMenu";
|
||||
|
||||
const row = new MessageActionRow();
|
||||
// row.addComponent(comp);
|
||||
// row.addComponent(c);
|
||||
row.addComponent(comp3);
|
||||
row.addComponent(btnSuccess);
|
||||
row.addComponent(btnDanger);
|
||||
row.addComponent(btnSecondary);
|
||||
row.addComponent(btnPrim);
|
||||
row.addComponent(btnLink);
|
||||
m.addComponents(row);
|
||||
m.content = "OOGA BOOGA";
|
||||
|
||||
|
||||
@@ -0,0 +1,56 @@
|
||||
import { Button } from "../structures/interactions/Button.js";
|
||||
import { Channel } from "../structures/guilds/Channel.js";
|
||||
import { message } from "../structures/messages/message.js";
|
||||
import { MessageButtonStyles } from "../structures/interactions/ButtonStyles.js";
|
||||
import { MessageActionRow } from "../structures/messages/MessageActionRow.js";
|
||||
import { ChannelSelectMenu, RoleSelectMenu, StringMenuComponent, StringSelectMenu, userSelectMenu } from "../structures/interactions/MessageSelectMenu.js";
|
||||
|
||||
/**
|
||||
* @param {message} mog
|
||||
*/
|
||||
export async function createMenuTests(mog) {
|
||||
var m = new message();
|
||||
|
||||
const sMenu = new StringSelectMenu();
|
||||
const stringComp = new StringMenuComponent();
|
||||
stringComp.value = 'llllll';
|
||||
stringComp.label = 'llllll';
|
||||
|
||||
const stringComp2 = new StringMenuComponent();
|
||||
stringComp2.value = 'pppppp';
|
||||
stringComp2.label = 'pppppp';
|
||||
|
||||
sMenu.data.push(stringComp);
|
||||
sMenu.data.push(stringComp2);
|
||||
sMenu.custom_id = "temp";
|
||||
sMenu.max_values = 2;
|
||||
|
||||
const uMenu = new userSelectMenu();
|
||||
uMenu.custom_id = "userMenu";
|
||||
|
||||
const cMenu = new ChannelSelectMenu();
|
||||
cMenu.custom_id = "channelMenu";
|
||||
|
||||
const rMenu = new RoleSelectMenu();
|
||||
rMenu.custom_id = "roleMenu";
|
||||
|
||||
const row = new MessageActionRow();
|
||||
row.addComponent(uMenu);
|
||||
m.addComponents(row);
|
||||
|
||||
const row2 = new MessageActionRow();
|
||||
row2.addComponent(sMenu);
|
||||
m.addComponents(row2);
|
||||
|
||||
const row3 = new MessageActionRow();
|
||||
row3.addComponent(rMenu);
|
||||
m.addComponents(row3);
|
||||
|
||||
m.content = "OOGA BOOGA";
|
||||
mog.reply(m);
|
||||
}
|
||||
|
||||
|
||||
export async function handleMenuTests(menu) {
|
||||
|
||||
}
|
||||
@@ -1,8 +1,12 @@
|
||||
import switchConsoleDefault from '../utils/consoleToFile.js';
|
||||
import { Client, gateWayIntents, message, Interaction } from '../structures/types.js';
|
||||
import config from '../config.json' assert { type: 'json' };
|
||||
import { buttonTests } from './Buttontests.js';
|
||||
import { createMenuTests } from './menuTests.js';
|
||||
const { bottoken } = config;
|
||||
|
||||
// switchConsoleDefault();
|
||||
|
||||
var c = new Client({
|
||||
intents: [
|
||||
gateWayIntents.Guilds,
|
||||
@@ -26,6 +30,8 @@ c.login(bottoken);
|
||||
c.on('messageRecieved', /**@param {message} message*/ async (message) => {
|
||||
if (message.content == 'buttontest') {
|
||||
return buttonTests(message);
|
||||
} else if (message.content == 'menutest') {
|
||||
return createMenuTests(message);
|
||||
}
|
||||
(await import('./messageTests.js')).default(message);
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user