feat: Transition welcome embed to slash command

imgbot
KieranRobson 2023-08-21 14:12:24 +01:00
parent 60bf5a5e15
commit 4aa8490268
5 changed files with 74 additions and 126 deletions

View File

@ -1,64 +0,0 @@
const {
MessageEmbed,
MessageActionRow,
MessageButton,
Permissions,
} = require('discord.js');
module.exports = {
name: 'paidmember',
aliases: [''],
/**
*
* @param {Client} client
* @param {Message} message
* @param {String[]} args
*/
run: async (client, message) => {
if (
!message.member.permissions.has(
Permissions.FLAGS.BAN_MEMBERS,
Permissions.FLAGS.ADMINISTRATOR
)
)
return message.channel.send(
"You don't have permission to use that command."
);
const embed = new MessageEmbed()
.setColor('GREEN')
.setFooter({ text: `Called By: ${message.author.tag}` })
.setTimestamp()
.setTitle('Paid Member!')
.setDescription(
`Press the button below to get access to the paid member role.`
)
.addField(
'Benefits?',
'Come to every event\r\n Vote in AGMs and EGMs\r\n Access a special area, just for paid members\r\n Access our archive of previous events and guest talks\r\nAnd support the society you are apart of!'
)
.addField(
'Disclaimer!',
'This is a manual process, executive members need to verify that you have paid your membership and then manually give you the role. **There is no notification of you receiving the role!**'
)
.addField('Pay for a membership', 'Press the grey button below!')
.setThumbnail('https://i.imgur.com/ww6wKwJ.png')
.setImage(`https://i.imgur.com/ro0U7LG.png?2048`);
const row = new MessageActionRow()
.addComponents(
new MessageButton()
.setURL('https://hulluniunion.com/shop?aid=304')
.setEmoji('')
.setLabel('Pay for a membership!')
.setStyle('LINK')
)
.addComponents(
new MessageButton()
.setCustomId('paidModal')
.setLabel('Paid Member Request')
.setStyle('PRIMARY')
);
message.channel.send({ embeds: [embed], components: [row] });
},
};

View File

@ -1,54 +0,0 @@
const { MessageEmbed, MessageActionRow, MessageButton } = require('discord.js');
module.exports = {
name: 'welcome',
aliases: [''],
/**
*
* @param {Client} client
* @param {Message} message
* @param {String[]} args
*/
run: async (client, message) => {
const embed = new MessageEmbed()
.setColor('GREEN')
.setFooter({ text: `Called By: ${message.author.tag}` })
.setTimestamp()
.setTitle('Welcome!')
.setDescription(
`We're the official student-run Computer Science Society at Hull, set up with the aim of providing engaging events for students with an interest in Computer Science. This basically means our role is to make life outside of your course as fun and interesting as possible, organising both social and technical events for you.`
)
.setThumbnail('https://i.imgur.com/ww6wKwJ.png')
.addField(
'Exec Members',
`President - <@867382918883180554>.\r\nSecretary - <@257938317243449346>.\r\nTreasurer - <@465912244404879361>.\r\nSocial Secretary - <@772513928160084009>.\r\nWebmaster - <@609463800818827264>.\r\n\r\n\r\n`
)
.addField('Our Site', `https://hullcss.org/`)
.addField(
'Gain Access',
`To gain access to the server, you will need to have a read of the code of conduct, found here: https://github.com/hullcss/conduct/ and react to the check mark below.\r\n \r\n **All Members, including Community are required to read this policy to access the server.**`
)
.addField(
'Confirmation',
'By reacting with the check mark, you confirm that you have read the #hullcss Code of Conduct'
);
const row = new MessageActionRow()
.addComponents(
new MessageButton()
.setURL('https://github.com/hullcss/conduct/')
.setEmoji('')
.setLabel('Code of Conduct')
.setStyle('LINK')
)
.addComponents(
new MessageButton()
.setCustomId('codeOfConduct')
.setEmoji('✅')
.setLabel(' I have read the code of conduct!')
.setStyle('SUCCESS')
);
message.channel.send({ embeds: [embed], components: [row] });
},
};

View File

@ -1,7 +1,4 @@
const {
SlashCommandBuilder,
PermissionFlagsBits,
} = require('discord.js');
const { SlashCommandBuilder, PermissionFlagsBits } = require('discord.js');
module.exports = {
...new SlashCommandBuilder()

View File

@ -1,7 +1,4 @@
const {
SlashCommandBuilder,
PermissionFlagsBits,
} = require('discord.js');
const { SlashCommandBuilder, PermissionFlagsBits } = require('discord.js');
module.exports = {
...new SlashCommandBuilder()

View File

@ -0,0 +1,72 @@
const {
SlashCommandBuilder,
PermissionFlagsBits,
EmbedBuilder,
ActionRowBuilder,
ButtonBuilder,
} = require('discord.js');
module.exports = {
...new SlashCommandBuilder()
.setName('welcomemebed')
.setDescription('Create the welcome embed')
.setDefaultMemberPermissions(
PermissionFlagsBits.KickMembers || PermissionFlagsBits.BanMembers
),
/**
*
* @param {Client} client
* @param {CommandInteraction} interaction
* @param {String[]} args
*/
run: async (client, interaction) => {
const embed = new EmbedBuilder()
.setColor(0x3fb618)
.setFooter({ text: `Called By: ${interaction.user.tag}` })
.setTimestamp()
.setTitle('Welcome!')
.setDescription(
`We're the official student-run Computer Science Society at Hull, set up with the aim of providing engaging events for students with an interest in Computer Science. This basically means our role is to make life outside of your course as fun and interesting as possible, organising both social and technical events for you.`
)
.setThumbnail('https://i.imgur.com/ww6wKwJ.png')
.addFields(
{
name: 'Exec Members',
value: `President - <@867382918883180554>.\r\nSecretary - <@257938317243449346>.\r\nTreasurer - <@465912244404879361>.\r\nSocial Secretary - <@772513928160084009>.\r\nWebmaster - <@609463800818827264>.\r\n\r\n\r\n`,
},
{
name: 'Our Site',
value: 'https://hullcss.org/',
},
{
name: 'Gain Access',
value: `To gain access to the server, you will need to have a read of the code of conduct, found here: https://github.com/hullcss/conduct/ and react to the check mark below.\r\n \r\n **All Members, including Community are required to read this policy to access the server.**`,
},
{
name: 'Confirmation',
value:
'By reacting with the check mark, you confirm that you have read the #hullcss Code of Conduct',
}
);
const row = new ActionRowBuilder()
.addComponents(
new ButtonBuilder()
.setURL('https://github.com/hullcss/conduct/')
.setLabel('Code of Conduct')
.setStyle('Link')
)
.addComponents(
new ButtonBuilder()
.setCustomId('codeOfConduct')
.setEmoji('✅')
.setLabel(' I have read the code of conduct!')
.setStyle('Success')
);
interaction.channel.send({ embeds: [embed], components: [row] });
interaction.reply({ content: 'Embed sent.', ephemeral: true });
},
};