Skip to content

Commit 4aa8490

Browse files
committed
feat: Transition welcome embed to slash command
1 parent 60bf5a5 commit 4aa8490

File tree

5 files changed

+74
-126
lines changed

5 files changed

+74
-126
lines changed

src/commands/embeds/paidmember.js

-64
This file was deleted.

src/commands/embeds/welcome.js

-54
This file was deleted.

src/slashCommands/admin/nukepaid.js

+1-4
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,4 @@
1-
const {
2-
SlashCommandBuilder,
3-
PermissionFlagsBits,
4-
} = require('discord.js');
1+
const { SlashCommandBuilder, PermissionFlagsBits } = require('discord.js');
52

63
module.exports = {
74
...new SlashCommandBuilder()

src/slashCommands/admin/unlock.js

+1-4
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,4 @@
1-
const {
2-
SlashCommandBuilder,
3-
PermissionFlagsBits,
4-
} = require('discord.js');
1+
const { SlashCommandBuilder, PermissionFlagsBits } = require('discord.js');
52

63
module.exports = {
74
...new SlashCommandBuilder()

src/slashCommands/embeds/welcome.js

+72
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,72 @@
1+
const {
2+
SlashCommandBuilder,
3+
PermissionFlagsBits,
4+
EmbedBuilder,
5+
ActionRowBuilder,
6+
ButtonBuilder,
7+
} = require('discord.js');
8+
9+
module.exports = {
10+
...new SlashCommandBuilder()
11+
.setName('welcomemebed')
12+
.setDescription('Create the welcome embed')
13+
.setDefaultMemberPermissions(
14+
PermissionFlagsBits.KickMembers || PermissionFlagsBits.BanMembers
15+
),
16+
17+
/**
18+
*
19+
* @param {Client} client
20+
* @param {CommandInteraction} interaction
21+
* @param {String[]} args
22+
*/
23+
24+
run: async (client, interaction) => {
25+
const embed = new EmbedBuilder()
26+
.setColor(0x3fb618)
27+
.setFooter({ text: `Called By: ${interaction.user.tag}` })
28+
.setTimestamp()
29+
.setTitle('Welcome!')
30+
.setDescription(
31+
`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.`
32+
)
33+
.setThumbnail('https://i.imgur.com/ww6wKwJ.png')
34+
.addFields(
35+
{
36+
name: 'Exec Members',
37+
value: `President - <@867382918883180554>.\r\nSecretary - <@257938317243449346>.\r\nTreasurer - <@465912244404879361>.\r\nSocial Secretary - <@772513928160084009>.\r\nWebmaster - <@609463800818827264>.\r\n\r\n\r\n`,
38+
},
39+
{
40+
name: 'Our Site',
41+
value: 'https://hullcss.org/',
42+
},
43+
{
44+
name: 'Gain Access',
45+
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.**`,
46+
},
47+
{
48+
name: 'Confirmation',
49+
value:
50+
'By reacting with the check mark, you confirm that you have read the #hullcss Code of Conduct',
51+
}
52+
);
53+
54+
const row = new ActionRowBuilder()
55+
.addComponents(
56+
new ButtonBuilder()
57+
.setURL('https://github.com/hullcss/conduct/')
58+
.setLabel('Code of Conduct')
59+
.setStyle('Link')
60+
)
61+
.addComponents(
62+
new ButtonBuilder()
63+
.setCustomId('codeOfConduct')
64+
.setEmoji('✅')
65+
.setLabel(' I have read the code of conduct!')
66+
.setStyle('Success')
67+
);
68+
69+
interaction.channel.send({ embeds: [embed], components: [row] });
70+
interaction.reply({ content: 'Embed sent.', ephemeral: true });
71+
},
72+
};

0 commit comments

Comments
 (0)