prepare member_roles with template

This commit is contained in:
Baipyrus 2024-03-02 23:49:13 +01:00
parent e0c581dcfd
commit 4aee497fba
3 changed files with 42 additions and 0 deletions

View File

@ -0,0 +1,34 @@
import { SlashCommandBuilder, PermissionFlagsBits } from 'discord.js';
export const data = new SlashCommandBuilder()
.setName('member_roles')
.setDMPermission(false)
.setDefaultMemberPermissions(PermissionFlagsBits.ManageRoles)
.setDescription('Assigns roles to new members.')
.addSubcommand((subcommand) =>
subcommand
.setName('add')
.setDescription('Registers a role to be assigned to new members.')
.addRoleOption((option) =>
option
.setName('role')
.setDescription('The role to assign to new members.')
.setRequired(true)
)
)
.addSubcommand((subcommand) =>
subcommand
.setName('remove')
.setDescription('Unregisters a role from new member assignment.')
.addRoleOption((option) =>
option
.setName('role')
.setDescription('The role to unregister from assignmment.')
.setRequired(true)
)
);
/** @param {ChatInputCommandInteraction} interaction */
export async function execute(interaction) {
const { options } = interaction;
}

View File

@ -0,0 +1,7 @@
import { Events, GuildMember } from 'discord.js';
export const name = Events.GuildMemberAdd;
/** @param {GuildMember} member */
export function execute(member) {
console.log(member);
}

View File

@ -17,6 +17,7 @@ const runClient = (commands, events) => {
const client = new Client({ const client = new Client({
intents: [ intents: [
GatewayIntentBits.Guilds, GatewayIntentBits.Guilds,
GatewayIntentBits.GuildMembers,
GatewayIntentBits.GuildMessages, GatewayIntentBits.GuildMessages,
GatewayIntentBits.GuildVoiceStates, GatewayIntentBits.GuildVoiceStates,
GatewayIntentBits.GuildMessageReactions GatewayIntentBits.GuildMessageReactions