feat: Transition paidmember over to embed
parent
2683677032
commit
6ec81c3d07
|
@ -1,9 +1,9 @@
|
|||
const client = require('../index');
|
||||
const { ActivityType } = require('discord.js')
|
||||
const { ActivityType } = require('discord.js');
|
||||
|
||||
client.on('ready', () => {
|
||||
console.log('HullCSS is online');
|
||||
client.user.setActivity('HullCSS.org', { type: ActivityType.Custom })
|
||||
client.user.setActivity('HullCSS.org', { type: ActivityType.Custom });
|
||||
|
||||
setInterval(() => {
|
||||
const { memberCount } = client.guilds.cache.get('427865794467069962');
|
||||
|
|
|
@ -16,7 +16,9 @@ module.exports = {
|
|||
*/
|
||||
|
||||
run: async (client, interaction) => {
|
||||
interaction.channel.permissionOverwrites.edit(interaction.guild.everyone, { SendMessages: false });
|
||||
interaction.channel.permissionOverwrites.edit(interaction.guild.everyone, {
|
||||
SendMessages: false,
|
||||
});
|
||||
interaction.reply('Channel has been locked.');
|
||||
},
|
||||
};
|
||||
|
|
|
@ -1,6 +1,8 @@
|
|||
const { Permissions } = require('discord.js');
|
||||
const { SlashCommandBuilder } = require('@discordjs/builders');
|
||||
const { PermissionFlagsBits } = require('discord-api-types/v10');
|
||||
const {
|
||||
Permissions,
|
||||
SlashCommandBuilder,
|
||||
PermissionFlagsBits,
|
||||
} = require('discord.js');
|
||||
|
||||
module.exports = {
|
||||
...new SlashCommandBuilder()
|
||||
|
@ -18,33 +20,36 @@ module.exports = {
|
|||
*/
|
||||
|
||||
run: async (client, interaction) => {
|
||||
await interaction.deferReply({
|
||||
ephemeral: true,
|
||||
await interaction.deferReply({
|
||||
ephemeral: true,
|
||||
});
|
||||
|
||||
|
||||
try {
|
||||
const role = interaction.guild.roles.cache.find(r => r.name === 'Paid Member')
|
||||
|
||||
interaction.guild.roles.create({
|
||||
name: role.name,
|
||||
color: role.color,
|
||||
hoist: role.hoist,
|
||||
position: role.position,
|
||||
permissions: role.permissions,
|
||||
mentionable: role.mentionable,
|
||||
})
|
||||
const role = interaction.guild.roles.cache.find(
|
||||
(r) => r.name === 'Paid Member'
|
||||
);
|
||||
|
||||
role.delete(role.id, 'The Nuke Paid Command Was Run. ');
|
||||
interaction.guild.roles.create({
|
||||
name: role.name,
|
||||
color: role.color,
|
||||
hoist: role.hoist,
|
||||
position: role.position,
|
||||
permissions: role.permissions,
|
||||
mentionable: role.mentionable,
|
||||
});
|
||||
|
||||
role.delete(role.id, 'The Nuke Paid Command Was Run. ');
|
||||
|
||||
const channel = client.channels.cache.get('1143157359917682711');
|
||||
channel.setName(`Paid Members: 0`);
|
||||
|
||||
const newRole = interaction.guild.roles.cache.find(r => r.name === 'Paid Member')
|
||||
interaction.editReply(`Role has been replaced. The paid members counter has been reset to 0.\n\n The new role ID is: ${newRole.id}. Please pass this to Kieran.`, true);
|
||||
|
||||
|
||||
|
||||
const newRole = interaction.guild.roles.cache.find(
|
||||
(r) => r.name === 'Paid Member'
|
||||
);
|
||||
interaction.editReply(
|
||||
`Role has been replaced. The paid members counter has been reset to 0.\n\n The new role ID is: ${newRole.id}. Please pass this to Kieran.`,
|
||||
true
|
||||
);
|
||||
} catch (error) {
|
||||
interaction.editReply({
|
||||
content: error,
|
||||
|
|
|
@ -1,4 +1,8 @@
|
|||
const { SlashCommandBuilder, PermissionFlagsBits, ThreadAutoArchiveDuration } = require('discord.js');
|
||||
const {
|
||||
SlashCommandBuilder,
|
||||
PermissionFlagsBits,
|
||||
ThreadAutoArchiveDuration,
|
||||
} = require('discord.js');
|
||||
|
||||
module.exports = {
|
||||
...new SlashCommandBuilder()
|
||||
|
@ -16,7 +20,9 @@ module.exports = {
|
|||
*/
|
||||
|
||||
run: async (client, interaction) => {
|
||||
interaction.channel.permissionOverwrites.edit(interaction.guild.everyone, { SendMessages: true });
|
||||
interaction.channel.permissionOverwrites.edit(interaction.guild.everyone, {
|
||||
SendMessages: true,
|
||||
});
|
||||
interaction.reply('Channel has been unlocked.');
|
||||
},
|
||||
};
|
||||
|
|
|
@ -0,0 +1,69 @@
|
|||
const {
|
||||
SlashCommandBuilder,
|
||||
PermissionFlagsBits,
|
||||
EmbedBuilder,
|
||||
ActionRowBuilder,
|
||||
ButtonBuilder,
|
||||
} = require('discord.js');
|
||||
|
||||
module.exports = {
|
||||
...new SlashCommandBuilder()
|
||||
.setName('paidmemberembed')
|
||||
.setDescription('Create the paid member 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('Paid Member!')
|
||||
.setDescription(
|
||||
`Press the button below to get access to the paid member role.`
|
||||
)
|
||||
.addFields(
|
||||
{
|
||||
name: 'Benefits?',
|
||||
value:
|
||||
'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!',
|
||||
},
|
||||
{
|
||||
name: 'Disclaimer!',
|
||||
value:
|
||||
'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!**',
|
||||
},
|
||||
{
|
||||
name: 'Pay for a membership',
|
||||
value: 'Press the green button below!',
|
||||
}
|
||||
)
|
||||
.setThumbnail('https://i.imgur.com/ww6wKwJ.png')
|
||||
.setImage(`https://i.imgur.com/ro0U7LG.png?2048`);
|
||||
|
||||
const row = new ActionRowBuilder()
|
||||
.addComponents(
|
||||
new ButtonBuilder()
|
||||
.setURL('https://hulluniunion.com/shop?aid=304')
|
||||
.setLabel('Pay for a membership!')
|
||||
.setStyle('Link')
|
||||
)
|
||||
.addComponents(
|
||||
new ButtonBuilder()
|
||||
.setCustomId('paidModal')
|
||||
.setLabel('Paid Member Request')
|
||||
.setStyle('Primary')
|
||||
);
|
||||
|
||||
interaction.channel.send({ embeds: [embed], components: [row] });
|
||||
interaction.reply({ content: 'Embed sent.', ephemeral: true });
|
||||
},
|
||||
};
|
|
@ -13,11 +13,12 @@ module.exports = {
|
|||
run: async (client, interaction) => {
|
||||
const embed = new EmbedBuilder()
|
||||
.setTitle('Thanks for considering to become a paid member!')
|
||||
.setColor(0x3FB618)
|
||||
.setColor(0x3fb618)
|
||||
.setFooter({ text: `Called By: ${interaction.user.tag}` })
|
||||
.addFields(
|
||||
{name: 'You can purchase from below!', value: 'https://hulluniunion.com/shop?aid=304'}
|
||||
);
|
||||
.addFields({
|
||||
name: 'You can purchase from below!',
|
||||
value: 'https://hulluniunion.com/shop?aid=304',
|
||||
});
|
||||
interaction.reply({ embeds: [embed] });
|
||||
},
|
||||
};
|
||||
|
|
|
@ -18,9 +18,10 @@ module.exports = {
|
|||
.setDescription(
|
||||
'Freeside is the student run and maintained linux cluster within the University Of Hull Computer Science Department providing Linux administration experience, mentoring and technical advice alongside other peer-led support. It is completely free to all students to join, irrespective of degree pathway.'
|
||||
)
|
||||
.addFields(
|
||||
{ name: 'You can join them from below!', value: 'https://discord.freeside.co.uk' }
|
||||
);
|
||||
.addFields({
|
||||
name: 'You can join them from below!',
|
||||
value: 'https://discord.freeside.co.uk',
|
||||
});
|
||||
interaction.reply({ embeds: [embed] });
|
||||
},
|
||||
};
|
||||
|
|
|
@ -13,9 +13,9 @@ module.exports = {
|
|||
run: async (client, interaction) => {
|
||||
const embed = new EmbedBuilder()
|
||||
.setTitle('Links!')
|
||||
.setColor(0x3FB618)
|
||||
.setColor(0x3fb618)
|
||||
.setFooter({ text: `Called By: ${interaction.user.tag}` })
|
||||
.addFields({name: 'Find us here:', value: 'https://hullcss.org'});
|
||||
.addFields({ name: 'Find us here:', value: 'https://hullcss.org' });
|
||||
interaction.reply({ embeds: [embed] });
|
||||
},
|
||||
};
|
||||
|
|
|
@ -17,14 +17,16 @@ module.exports = {
|
|||
const seconds = Math.floor(client.uptime / 1000) % 60;
|
||||
|
||||
const embed = new EmbedBuilder()
|
||||
.setColor(0x3FB618)
|
||||
.setColor(0x3fb618)
|
||||
.setFooter({ text: `Called By: ${interaction.user.tag}` })
|
||||
.setTimestamp()
|
||||
.setTitle('Pong!')
|
||||
.setDescription(`${client.ws.ping} ping to host`)
|
||||
.addFields(
|
||||
{ name: 'Uptime', value: `${days}days ${hours}hrs ${minutes}min ${seconds}sec`, inline: true }
|
||||
);
|
||||
.addFields({
|
||||
name: 'Uptime',
|
||||
value: `${days}days ${hours}hrs ${minutes}min ${seconds}sec`,
|
||||
inline: true,
|
||||
});
|
||||
interaction.reply({ embeds: [embed] });
|
||||
},
|
||||
};
|
||||
|
|
|
@ -20,7 +20,7 @@ module.exports = {
|
|||
)
|
||||
.addFields({
|
||||
name: 'You can join them from below!',
|
||||
value: 'https://discord.gg/cMP5CavnK4'
|
||||
value: 'https://discord.gg/cMP5CavnK4',
|
||||
});
|
||||
interaction.reply({ embeds: [embed] });
|
||||
},
|
||||
|
|
Loading…
Reference in New Issue