ESLint and spelling

imgbot
Kieran 2022-09-10 09:32:54 +01:00
parent 2fd3414e63
commit 49239fae01
39 changed files with 6613 additions and 942 deletions

21
.eslintrc.json Normal file
View File

@ -0,0 +1,21 @@
{
"extends": ["airbnb-base", "plugin:prettier/recommended"],
"plugins": ["prettier"],
"parserOptions": {
"ecmaVersion": 2018
},
"rules": {
"prettier/prettier": "error",
"no-unused-vars": "warn",
"no-console": "off",
"func-names": "off",
"no-process-exit": "off",
"object-shorthand": "off",
"class-methods-use-this": "off",
"eqeqeq": "off",
"node/no-unsupported-features/es-syntax": "off",
"consistent-return": "off",
"no-plusplus": "off",
"no-underscore-dangle": "off"
}
}

6
.prettierrc Normal file
View File

@ -0,0 +1,6 @@
{
"semi": true,
"singleQuote": true,
"tabWidth": 2,
"useTabs": true
}

28
cspell.json Normal file
View File

@ -0,0 +1,28 @@
{
"words": [
"ACWPing",
"addemoji",
"courserep",
"dockerhub",
"freeside",
"gorb",
"gorbcelebration",
"gorbchristmas",
"gorbcs",
"gorblarge",
"gorbstorm",
"guildmember",
"Hullcss",
"Jetbrains",
"Kieran",
"kieranr",
"lampadaferens",
"nukepaid",
"organising",
"Ouroboros",
"paidmember",
"robsoc",
"usefullinks",
"welcomechannel"
]
}

5560
package-lock.json generated

File diff suppressed because it is too large Load Diff

View File

@ -4,14 +4,27 @@
"description": "", "description": "",
"main": "src/index.js", "main": "src/index.js",
"scripts": { "scripts": {
"start": "node src/index.js" "start": "node src/index.js",
"lint": "eslint . --fix",
"spell": "cspell src/**/"
}, },
"keywords": [], "keywords": [],
"author": "", "author": "",
"license": "ISC", "license": "ISC",
"dependencies": { "dependencies": {
"@discordjs/builders": "^1.2.0",
"discord-api-types": "^0.37.8",
"discord.js": "^13.10.2", "discord.js": "^13.10.2",
"dotenv": "^16.0.1", "dotenv": "^16.0.1",
"glob": "^7.2.3" "glob": "^7.2.3"
},
"devDependencies": {
"cspell": "^6.8.1",
"eslint": "^8.23.0",
"eslint-config-airbnb-base": "^15.0.0",
"eslint-config-prettier": "^8.5.0",
"eslint-plugin-import": "^2.25.3",
"eslint-plugin-prettier": "^4.2.1",
"prettier": "^2.7.1"
} }
} }

View File

@ -1,35 +1,45 @@
const { Message, Client, Permissions } = require("discord.js"); /* eslint-disable no-restricted-syntax */
const Discord = require('discord.js') const { Permissions } = require('discord.js');
const Discord = require('discord.js');
module.exports = { module.exports = {
name: "addemoji", name: 'addemoji',
aliases: [''], aliases: [''],
/** /**
* *
* @param {Client} client * @param {Client} client
* @param {Message} message * @param {Message} message
* @param {String[]} args * @param {String[]} args
*/ */
run: async (client, message, args) => { run: async (client, message, args) => {
if(!message.member.permissions.has(Permissions.FLAGS.MANAGE_EMOJIS_AND_STICKERS, Permissions.FLAGS.ADMINISTRATOR)) if (
message.channel.send("You don't have permission to use that command."); !message.member.permissions.has(
Permissions.FLAGS.MANAGE_EMOJIS_AND_STICKERS,
else { Permissions.FLAGS.ADMINISTRATOR
if (!args.length) return message.channel('Please specify an emoji!!') )
)
message.channel.send("You don't have permission to use that command.");
else {
if (!args.length) return message.channel('Please specify an emoji!!');
for (const emojis of args) { for (const emojis of args) {
const getEmoji = Discord.Util.parseEmoji(emojis); const getEmoji = Discord.Util.parseEmoji(emojis);
if (getEmoji.id) {
const emojiExt = getEmoji.animated ? ".gif" : ".png";
const emojiURL = `https://cdn.discordapp.com/emojis/${getEmoji.id + emojiExt}`
message.guild.emojis.create(emojiURL, getEmoji.name).then(emoji =>
message.channel.send(`Successfully added: ${emoji} - ${emoji.name} to the server!!`))
}
}
if (getEmoji.id) {
const emojiExt = getEmoji.animated ? '.gif' : '.png';
const emojiURL = `https://cdn.discordapp.com/emojis/${
getEmoji.id + emojiExt
}`;
}; message.guild.emojis
} .create(emojiURL, getEmoji.name)
} .then((emoji) =>
message.channel.send(
`Successfully added: ${emoji} - ${emoji.name} to the server!!`
)
);
}
}
}
},
};

View File

@ -1,20 +1,26 @@
const { Client, Message, Permissions } = require('discord.js'); const { Permissions } = require('discord.js');
module.exports = { module.exports = {
name: 'lock', name: 'lock',
aliases: [''], aliases: [''],
/** /**
* @param {Client} client * @param {Client} client
* @param {Message} message * @param {Message} message
* @param {String[]} args * @param {String[]} args
*/ */
run: async(client, message, args) => { run: async (client, message) => {
const permission = message.member.permissions.has(
Permissions.FLAGS.MANAGE_CHANNELS
);
if (!permission)
return message.reply({
contents: "You don't have permission to use this command",
});
const permission = message.member.permissions.has(Permissions.FLAGS.MANAGE_CHANNELS) message.channel.permissionOverwrites.edit(message.guild.roles.everyone.id, {
if (!permission)return message.reply({ contents: "You don't have permission to use this command" }); SEND_MESSAGES: false,
});
message.channel.permissionOverwrites.edit(message.guild.roles.everyone.id, {SEND_MESSAGES: false});
message.channel.send("Channel has been locked.") message.channel.send('Channel has been locked.');
} },
} };

View File

@ -1,26 +1,23 @@
const { Client, Message } = require('discord.js');
module.exports = { module.exports = {
name: 'nukepaid', name: 'nukepaid',
aliases: [''], aliases: [''],
/** /**
* @param {Client} client * @param {Client} client
* @param {Message} message * @param {Message} message
* @param {String[]} args * @param {String[]} args
*/ */
run: async(client, message, args) => { run: async (client, message) => {
const role = message.guild.roles.cache.get("427878753008353292"); const role = message.guild.roles.cache.get('427878753008353292');
message.guild.roles.create({ message.guild.roles.create({
data: { data: {
name: role.name, name: role.name,
color: role.color, color: role.color,
hoist: role.hoist, hoist: role.hoist,
position: role.position, position: role.position,
permissions: role.permissions, permissions: role.permissions,
mentionable: role.mentionable mentionable: role.mentionable,
} },
}) });
role.delete('I had to.') role.delete('I had to.');
},
} };
}

View File

@ -1,18 +1,24 @@
const { Client, Message, Permissions } = require('discord.js'); const { Permissions } = require('discord.js');
module.exports = { module.exports = {
name: 'unlock', name: 'unlock',
aliases: [''], aliases: [''],
/** /**
* @param {Client} client * @param {Client} client
* @param {Message} message * @param {Message} message
* @param {String[]} args * @param {String[]} args
*/ */
run: async(client, message, args) => { run: async (client, message) => {
const permission = message.member.permissions.has(
const permission = message.member.permissions.has(Permissions.FLAGS.MANAGE_CHANNELS) Permissions.FLAGS.MANAGE_CHANNELS
if (!permission)return message.reply({ contents: "You don't have permission to use this command" }); );
message.channel.permissionOverwrites.edit(message.guild.roles.everyone.id, {SEND_MESSAGES: true}); if (!permission)
message.channel.send("Channel has been unlocked.") return message.reply({
} contents: "You don't have permission to use this command",
} });
message.channel.permissionOverwrites.edit(message.guild.roles.everyone.id, {
SEND_MESSAGES: true,
});
message.channel.send('Channel has been unlocked.');
},
};

View File

@ -1,42 +1,59 @@
const {MessageEmbed, MessageActionRow, MessageButton } = require("discord.js"); const {
MessageEmbed,
MessageActionRow,
MessageButton,
Permissions,
} = require('discord.js');
module.exports = { module.exports = {
name: "paidmember", name: 'paidmember',
aliases: [''], aliases: [''],
/** /**
* *
* @param {Client} client * @param {Client} client
* @param {Message} message * @param {Message} message
* @param {String[]} args * @param {String[]} args
*/ */
run: async (client, message, 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."
);
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\n\r\nAnd support the society you are apart of!'
)
.addField('Pay for a membership', 'Press the grey button below!')
.setThumbnail('https://i.imgur.com/ww6wKwJ.png');
const embed = new MessageEmbed() const row = new MessageActionRow()
.setColor('GREEN') .addComponents(
.setFooter({ text: `Called By: ${message.author.tag}`}) new MessageButton()
.setTimestamp() .setURL('https://hulluniunion.com/shop?aid=304')
.setTitle("Paid Member!") .setEmoji('')
.setDescription(`Press the button below to get access to the paid member role.`) .setLabel('Pay for a membership!')
.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\n\r\nAnd support the society you are apart of!') .setStyle('LINK')
.addField('Pay for a membership', 'Press the grey button below!') )
.setThumbnail('https://i.imgur.com/ww6wKwJ.png') .addComponents(
new MessageButton()
const row = new MessageActionRow() .setCustomId('paidModal')
.addComponents( .setLabel('Paid Member Request')
new MessageButton() .setStyle('PRIMARY')
.setURL('https://hulluniunion.com/shop?aid=304') );
.setEmoji('') message.channel.send({ embeds: [embed], components: [row] });
.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,39 +1,53 @@
const { MessageEmbed, MessageActionRow, MessageButton } = require("discord.js"); const { MessageEmbed } = require('discord.js');
module.exports = { module.exports = {
name: "usefullinks", name: 'usefullinks',
aliases: [''], aliases: [''],
/** /**
* *
* @param {Client} client * @param {Client} client
* @param {Message} message * @param {Message} message
* @param {String[]} args * @param {String[]} args
*/ */
run: async (client, message, args) => { run: async (client, message) => {
const embed = new MessageEmbed() const embed = new MessageEmbed()
.setColor('GREEN') .setColor('GREEN')
.setFooter({ text: `Called By: ${message.author.tag}`}) .setFooter({ text: `Called By: ${message.author.tag}` })
.setTimestamp() .setTimestamp()
.setTitle("Useful Links!") .setTitle('Useful Links!')
.setDescription(`Below are a some useful links to communities and resources.`) .setDescription(
.setThumbnail('https://i.imgur.com/ww6wKwJ.png') `Below are a some useful links to communities and resources.`
)
.setThumbnail('https://i.imgur.com/ww6wKwJ.png')
.addField('Free Stuff', ` .addField(
'Free Stuff',
`
- GitHub Student Developer Pack: https://education.github.com/pack\r\n - GitHub Student Developer Pack: https://education.github.com/pack\r\n
- Microsoft Azure Dev Tools for Teaching: https://azure.microsoft.com/en-gb/free/students/\r\n - Microsoft Azure Dev Tools for Teaching: https://azure.microsoft.com/en-gb/free/students/\r\n
- Jetbrains IDE Package: https://www.jetbrains.com/community/education/#students\r\n`) - Jetbrains IDE Package: https://www.jetbrains.com/community/education/#students\r\n`
)
.addField('University of Hull Specific Features', ` .addField(
'University of Hull Specific Features',
`
- Freeside Student Resource List: https://github.com/FreesideHull/StudentResources\r\n - Freeside Student Resource List: https://github.com/FreesideHull/StudentResources\r\n
- Hull University Buddy: https://chrome.google.com/webstore/detail/hull-university-buddy/jnppmhcoifoohipnnhdabhnolnilncbk\r\n`) - Hull University Buddy: https://chrome.google.com/webstore/detail/hull-university-buddy/jnppmhcoifoohipnnhdabhnolnilncbk\r\n`
)
.addField('Other Communities', ` .addField(
'Other Communities',
`
- Freeside: https://freeside.co.uk/\r\n - Freeside: https://freeside.co.uk/\r\n
- Unofficial University of Hull Discord Server: https://discord.gg/rm7r5wbYq2\r\n - Unofficial University of Hull Discord Server: https://discord.gg/rm7r5wbYq2\r\n
- The Programmer's Hangout: https://discord.gg/programming\r\n`) - The Programmer's Hangout: https://discord.gg/programming\r\n`
)
.addField(`Want to add a resource?`, `Message an <@&427866208726155274> with your suggestion for consideration!`) .addField(
`Want to add a resource?`,
message.channel.send({ embeds: [embed] }) `Message an <@&427866208726155274> with your suggestion for consideration!`
}, );
message.channel.send({ embeds: [embed] });
},
}; };

View File

@ -1,43 +1,54 @@
const { MessageEmbed, MessageActionRow, MessageButton } = require("discord.js"); const { MessageEmbed, MessageActionRow, MessageButton } = require('discord.js');
module.exports = { module.exports = {
name: "welcome", name: 'welcome',
aliases: [''], aliases: [''],
/** /**
* *
* @param {Client} client * @param {Client} client
* @param {Message} message * @param {Message} message
* @param {String[]} args * @param {String[]} args
*/ */
run: async (client, message, args) => { run: async (client, message) => {
const embed = new MessageEmbed() const embed = new MessageEmbed()
.setColor('GREEN') .setColor('GREEN')
.setFooter({ text: `Called By: ${message.author.tag}`}) .setFooter({ text: `Called By: ${message.author.tag}` })
.setTimestamp() .setTimestamp()
.setTitle("Welcome!") .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.`) .setDescription(
.setThumbnail('https://i.imgur.com/ww6wKwJ.png') `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.`
.addField('Exec Members', `President - <@261607869068214272>.\r\nSecretary - <@265925073926488064>.\r\nTreasurer - <@354324259629170700>.\r\nSocial Secretary - NA.\r\n Publicity Officer - <@328928794364870656>.\r\nWebmaster - <@449573875743981569>.\r\n\r\n\r\n`) )
.addField('Our Site', `https://hullcss.org/`) .setThumbnail('https://i.imgur.com/ww6wKwJ.png')
.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(
.addField('Confirmation', 'By reacting with the check mark, you confirm that you have read the #hullcss Code of Conduct') 'Exec Members',
`President - <@261607869068214272>.\r\nSecretary - <@265925073926488064>.\r\nTreasurer - <@354324259629170700>.\r\nSocial Secretary - NA.\r\n Publicity Officer - <@328928794364870656>.\r\nWebmaster - <@449573875743981569>.\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() const row = new MessageActionRow()
.addComponents( .addComponents(
new MessageButton()
.setURL('https://github.com/hullcss/conduct/')
.setEmoji('')
.setLabel('Code of Conduct')
.setStyle('LINK')
)
.addComponents(
new MessageButton() new MessageButton()
.setCustomId('codeOfConduct') .setURL('https://github.com/hullcss/conduct/')
.setEmoji('✅') .setEmoji('')
.setLabel(' I have read the code of conduct!') .setLabel('Code of Conduct')
.setStyle('SUCCESS') .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] }) message.channel.send({ embeds: [embed], components: [row] });
}, },
}; };

View File

@ -1,33 +1,30 @@
const { Message, Client, MessageEmbed } = require("discord.js"); const { MessageEmbed } = require('discord.js');
module.exports = { module.exports = {
name: "8ball", name: '8ball',
aliases: ['8b'], aliases: ['8b'],
/** /**
* *
* @param {Client} client * @param {Client} client
* @param {Message} message * @param {Message} message
* @param {String[]} args * @param {String[]} args
*/ */
run: async (client, message, args) => { run: async (client, message, args) => {
const Responses = [ const Responses = ['Yes', 'No', 'Maybe', 'It is likely', 'It is unlikely'];
"Yes",
"No",
"Maybe",
"It is likely",
"It is unlikely"
];
let messageArgs = args.join(' '); const messageArgs = args.join(' ');
if (!messageArgs[1]) return message.reply('Please specify a topic.'); if (!messageArgs[1]) return message.reply('Please specify a topic.');
const embed = new MessageEmbed() const embed = new MessageEmbed()
.setColor('GREEN') .setColor('GREEN')
.setFooter({ text: `Called By: ${message.author.tag}`}) .setFooter({ text: `Called By: ${message.author.tag}` })
.setTimestamp() .setTimestamp()
.setTitle("8Ball") .setTitle('8Ball')
.addField(`${messageArgs}`,`${Responses[Math.floor(Math.random() * Responses.length)]}`) .addField(
`${messageArgs}`,
message.channel.send({ embeds: [embed] }) `${Responses[Math.floor(Math.random() * Responses.length)]}`
}, );
message.channel.send({ embeds: [embed] });
},
}; };

View File

@ -1,38 +1,34 @@
module.exports = { module.exports = {
name: "gorb", name: 'gorb',
aliases: [''], aliases: [''],
/** /**
* *
* @param {Client} client * @param {Client} client
* @param {Message} message * @param {Message} message
* @param {String[]} args * @param {String[]} args
*/ */
run: async (client, message, args) => { run: async (client, message, args) => {
if (!args[0]) {
if(!args[0]){ message.channel.send({ files: ['./images/gorb.jpg'] });
message.channel.send({ files: ['./images/gorb.jpg'] }) }
} if (args[0] === 'cs') {
if(args[0] === 'cs'){ message.channel.send({ files: ['./images/gorbcs.jpg'] });
message.channel.send({ files: ['./images/gorbcs.jpg'] }) }
}
if(args[0] === 'party'){ if (args[0] === 'party') {
message.channel.send({ files: ['./images/gorbcelebration.PNG'] }) message.channel.send({ files: ['./images/gorbcelebration.PNG'] });
} }
if (args[0] === 'christmas') {
if(args[0] === 'christmas'){ message.channel.send({ files: ['./images/gorbchristmas.PNG'] });
message.channel.send({ files: ['./images/gorbchristmas.PNG'] }) }
}
if(args[0] === 'storm'){ if (args[0] === 'storm') {
message.channel.send({ files: ['./images/gorbstorm.PNG'] }) message.channel.send({ files: ['./images/gorbstorm.PNG'] });
} }
if(args[0] == 'large'){ if (args[0] == 'large') {
message.channel.send({ files: ['./images/gorblarge.png'] }) message.channel.send({ files: ['./images/gorblarge.png'] });
} }
},
};
},
};

View File

@ -1,13 +1,15 @@
module.exports = { module.exports = {
name: "lampadaferens", name: 'lampadaferens',
aliases: [''], aliases: [''],
/** /**
* *
* @param {Client} client * @param {Client} client
* @param {Message} message * @param {Message} message
* @param {String[]} args * @param {String[]} args
*/ */
run: async (client, message, args) => { run: async (client, message) => {
message.channel.send('https://th.bing.com/th/id/R.b938157fa7b152a1109aede2091f6b72?rik=%2f3u0RlNpTY1JDw&pid=ImgRaw&r=0') message.channel.send(
}, 'https://th.bing.com/th/id/R.b938157fa7b152a1109aede2091f6b72?rik=%2f3u0RlNpTY1JDw&pid=ImgRaw&r=0'
}; );
},
};

View File

@ -1,20 +1,23 @@
const { MessageEmbed } = require("discord.js"); const { MessageEmbed } = require('discord.js');
module.exports = { module.exports = {
name: "buy", name: 'buy',
aliases: ['paid'], aliases: ['paid'],
/** /**
* *
* @param {Client} client * @param {Client} client
* @param {Message} message * @param {Message} message
* @param {String[]} args * @param {String[]} args
*/ */
run: async (client, message, args) => { run: async (client, message) => {
const embed = new MessageEmbed() const embed = new MessageEmbed()
.setTitle("Thanks for considering to become a paid member!") .setTitle('Thanks for considering to become a paid member!')
.setColor('GREEN') .setColor('GREEN')
.setFooter({text: `Called By: ${message.author.tag}`}) .setFooter({ text: `Called By: ${message.author.tag}` })
.addField('You can purchase from below!','https://hulluniunion.com/shop?aid=304') .addField(
message.channel.send({ embeds: [embed] }); 'You can purchase from below!',
} 'https://hulluniunion.com/shop?aid=304'
} );
message.channel.send({ embeds: [embed] });
},
};

View File

@ -1,21 +1,26 @@
const { MessageEmbed } = require("discord.js"); const { MessageEmbed } = require('discord.js');
module.exports = { module.exports = {
name: "freeside", name: 'freeside',
aliases: ['fs'], aliases: ['fs'],
/** /**
* *
* @param {Client} client * @param {Client} client
* @param {Message} message * @param {Message} message
* @param {String[]} args * @param {String[]} args
*/ */
run: async (client, message, args) => { run: async (client, message) => {
const embed = new MessageEmbed() const embed = new MessageEmbed()
.setTitle("Freeside") .setTitle('Freeside')
.setColor('ORANGE') .setColor('ORANGE')
.setFooter({ text: `Called By: ${message.author.tag}`}) .setFooter({ text: `Called By: ${message.author.tag}` })
.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.') .setDescription(
.addField('You can join them from below!','https://discord.freeside.co.uk') '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.'
message.channel.send({ embeds: [embed] }); )
} .addField(
} 'You can join them from below!',
'https://discord.freeside.co.uk'
);
message.channel.send({ embeds: [embed] });
},
};

View File

@ -1,81 +1,73 @@
const discord = require("discord.js"); const discord = require('discord.js');
module.exports = { module.exports = {
name: "help", name: 'help',
aliases: [''], aliases: [''],
/** /**
* *
* @param {Client} client * @param {Client} client
* @param {Message} message * @param {Message} message
* @param {String[]} args * @param {String[]} args
*/ */
run: async (client, message, args) => { run: async (client, message, args) => {
if (!args[0]) {
const embed = new discord.MessageEmbed()
.setTitle('HullCSS Help')
.setDescription(
'You can use `!help <category>` to get additional commands within a specific category'
)
.setColor('GREEN')
if(!args[0]){ .addField('❓`!help`', 'This Command', true)
const embed = new discord.MessageEmbed() .addField('🛠️`!help admin`', 'Displays Admin Commands!', true)
.setTitle("HullCSS Help") .addField(' `!help general`', 'Displays General Commands!', true)
.setDescription("You can use `!help <category>` to get additional commands within a specific category") .addField('🎉`!help fun`', 'Displays Fun Commands!', true)
.setColor('GREEN') .addField('🐹 `!help gorb`', 'Displays Gorb Commands', true);
message.channel.send({ embeds: [embed] });
.addField('❓`!help`','This Command', true) }
.addField('🛠️`!help admin`','Displays Admin Commands!', true)
.addField(' `!help general`', 'Displays General Commands!', true)
.addField('🎉`!help fun`', 'Displays Fun Commands!', true)
.addField('🐹 `!help gorb`', 'Displays Gorb Commands', true)
message.channel.send({ embeds: [embed] });
}
if(args[0] === 'admin'){
const embed = new discord.MessageEmbed()
.setTitle("Admin Commands")
.setColor('GREEN')
if (args[0] === 'admin') {
const embed = new discord.MessageEmbed()
.setTitle('Admin Commands')
.setColor('GREEN');
message.channel.send({ embeds: [embed] }); message.channel.send({ embeds: [embed] });
} }
if (args[0] === 'general') {
if(args[0] === 'general'){ const embed = new discord.MessageEmbed()
const embed = new discord.MessageEmbed() .setTitle('General Commands')
.setTitle("General Commands") .setColor('GREEN')
.setColor('GREEN')
.addField('!buy', 'Sends a link to purchase membership') .addField('!buy', 'Sends a link to purchase membership')
.addField('!links', 'Get all the links') .addField('!links', 'Get all the links')
.addField('!freeside', 'A link to the Freeside discord server') .addField('!freeside', 'A link to the Freeside discord server')
.addField('!robsoc', 'A link to the Robotics Society discord server') .addField('!robsoc', 'A link to the Robotics Society discord server');
message.channel.send({ embeds: [embed] }); message.channel.send({ embeds: [embed] });
} }
if(args[0] === 'fun'){
const embed = new discord.MessageEmbed()
.setTitle("Fun Commands")
.setColor('GREEN')
.addField('!8ball', 'Answer your deepest questions.') if (args[0] === 'fun') {
.addField('!gorb', 'guinea pig orb') const embed = new discord.MessageEmbed()
.addField('!torch', 'Light the way') .setTitle('Fun Commands')
message.channel.send({ embeds: [embed] }); .setColor('GREEN')
}
if(args[0] === 'gorb'){
const embed = new discord.MessageEmbed()
.setTitle("Gorb Commands")
.setColor('GREEN')
.addField('!gorb cs', 'CS Gorb')
.addField('!gorb party', 'Party Gorb')
.addField('!gorb christmas', 'Christmas Gorb')
.addField('!gorb storm', 'Storm Gorb')
message.channel.send({ embeds: [embed] });
}
}
}
.addField('!8ball', 'Answer your deepest questions.')
.addField('!gorb', 'guinea pig orb')
.addField('!torch', 'Light the way');
message.channel.send({ embeds: [embed] });
}
if (args[0] === 'gorb') {
const embed = new discord.MessageEmbed()
.setTitle('Gorb Commands')
.setColor('GREEN')
.addField('!gorb cs', 'CS Gorb')
.addField('!gorb party', 'Party Gorb')
.addField('!gorb christmas', 'Christmas Gorb')
.addField('!gorb storm', 'Storm Gorb');
message.channel.send({ embeds: [embed] });
}
},
};

View File

@ -1,22 +1,20 @@
const { MessageEmbed } = require("discord.js"); const { MessageEmbed } = require('discord.js');
module.exports = { module.exports = {
name: "links", name: 'links',
aliases: [''], aliases: [''],
/** /**
* *
* @param {Client} client * @param {Client} client
* @param {Message} message * @param {Message} message
* @param {String[]} args * @param {String[]} args
*/ */
run: async (client, message, args) => { run: async (client, message) => {
const embed = new MessageEmbed() const embed = new MessageEmbed()
.setTitle("Links!") .setTitle('Links!')
.setColor('GREEN') .setColor('GREEN')
.setFooter({ text: `Called By: ${message.author.tag}`}) .setFooter({ text: `Called By: ${message.author.tag}` })
.addField('Find us here:','https://hullcss.org') .addField('Find us here:', 'https://hullcss.org');
message.channel.send({ embeds: [embed] }); message.channel.send({ embeds: [embed] });
},
},
}; };

View File

@ -1,31 +1,32 @@
const { Message, Client, MessageEmbed } = require("discord.js"); const { MessageEmbed } = require('discord.js');
module.exports = { module.exports = {
name: "ping", name: 'ping',
aliases: ['p'], aliases: ['p'],
/** /**
* *
* @param {Client} client * @param {Client} client
* @param {Message} message * @param {Message} message
* @param {String[]} args * @param {String[]} args
*/ */
run: async (client, message, args) => { run: async (client, message) => {
let days = Math.floor(client.uptime / 86400000); const days = Math.floor(client.uptime / 86400000);
let hours = Math.floor(client.uptime / 3600000) % 24; const hours = Math.floor(client.uptime / 3600000) % 24;
let minutes = Math.floor(client.uptime / 60000) % 60; const minutes = Math.floor(client.uptime / 60000) % 60;
let seconds = Math.floor(client.uptime / 1000) % 60; const seconds = Math.floor(client.uptime / 1000) % 60;
const embed = new MessageEmbed() const embed = new MessageEmbed()
.setColor('GREEN') .setColor('GREEN')
.setFooter({ text: `Called By: ${message.author.tag}`}) .setFooter({ text: `Called By: ${message.author.tag}` })
.setTimestamp() .setTimestamp()
.setTitle("Pong!") .setTitle('Pong!')
.setDescription(`${client.ws.ping} ping to host`) .setDescription(`${client.ws.ping} ping to host`)
.addField('Uptime', ` ${days}days ${hours}hrs ${minutes}min ${seconds}sec`, true) .addField(
'Uptime',
` ${days}days ${hours}hrs ${minutes}min ${seconds}sec`,
true
);
message.channel.send({ embeds: [embed] }) message.channel.send({ embeds: [embed] });
},
},
}; };

View File

@ -1,21 +1,26 @@
const { MessageEmbed } = require("discord.js"); const { MessageEmbed } = require('discord.js');
module.exports = { module.exports = {
name: "robotics", name: 'robotics',
aliases: ['robsoc'], aliases: ['robsoc'],
/** /**
* *
* @param {Client} client * @param {Client} client
* @param {Message} message * @param {Message} message
* @param {String[]} args * @param {String[]} args
*/ */
run: async (client, message, args) => { run: async (client, message) => {
const embed = new MessageEmbed() const embed = new MessageEmbed()
.setTitle("Robotics Society") .setTitle('Robotics Society')
.setColor('BLUE') .setColor('BLUE')
.setFooter({ text: `Called By: ${message.author.tag}`}) .setFooter({ text: `Called By: ${message.author.tag}` })
.setDescription('Robotics Society aee a society where you can gain skills in building an actual robot, or get help with your assignments or exams, but they also run social night where they go out to do stuff.') .setDescription(
.addField('You can join them from below!','https://discord.gg/cMP5CavnK4') 'Robotics Society aee a society where you can gain skills in building an actual robot, or get help with your assignments or exams, but they also run social night where they go out to do stuff.'
message.channel.send({ embeds: [embed] }); )
} .addField(
} 'You can join them from below!',
'https://discord.gg/cMP5CavnK4'
);
message.channel.send({ embeds: [embed] });
},
};

View File

@ -1,42 +1,42 @@
const { Message, Client, MessageActionRow, MessageSelectMenu } = require("discord.js"); const { MessageActionRow, MessageSelectMenu } = require('discord.js');
module.exports = { module.exports = {
name: "bcs", name: 'bcs',
aliases: [''], aliases: [''],
/** /**
* *
* @param {Client} client * @param {Client} client
* @param {Message} message * @param {Message} message
* @param {String[]} args * @param {String[]} args
*/ */
run: async (client, message, args) => { run: async (client, message) => {
const row3 = new MessageActionRow() const row3 = new MessageActionRow().addComponents(
.addComponents( new MessageSelectMenu()
new MessageSelectMenu() .setCustomId('bcsSelect')
.setCustomId("bcsSelect") .setPlaceholder('Select your BCS Status')
.setPlaceholder("Select your BCS Status") .addOptions([
.addOptions([ {
{ label: 'Student Member',
label:"Student Member", value: 'bcsStudent',
value:"bcsStudent", },
}, {
{ label: 'Associate Member',
label:"Associate Member", value: 'bcsAss',
value:"bcsAss", },
{
label: 'Professional Member',
value: 'bcsProf',
},
{
label: 'Fellow',
value: 'bcsFellow',
},
])
);
}, message.channel.send({
{ content: 'Select your BCS status',
label:"Professional Member", components: [row3],
value:"bcsProf", });
}, },
{ };
label:"Fellow",
value:"bcsFellow",
},
])
)
message.channel.send({content: "Select your BCS status", components:[row3]})
}
}

View File

@ -1,41 +1,39 @@
const { MessageActionRow, MessageSelectMenu } = require('discord.js');
const { Message, Client, MessageActionRow, MessageSelectMenu } = require("discord.js");
module.exports = { module.exports = {
name: "roles", name: 'roles',
aliases: [''], aliases: [''],
/** /**
* *
* @param {Client} client * @param {Client} client
* @param {Message} message * @param {Message} message
* @param {String[]} args * @param {String[]} args
*/ */
run: async (client, message, args) => { run: async (client, message) => {
const row4 = new MessageActionRow().addComponents(
new MessageSelectMenu()
.setCustomId('miscSelect')
.setPlaceholder('Select your misc roles')
.setMinValues(0)
.setMaxValues(2)
.addOptions([
{
label: 'Course Rep',
description: 'Get access to the course rep channel',
value: 'courserep',
},
{
label: 'CourseWork Help Ping',
description:
'If you want to help out within our coursework-help channel',
value: 'ACWPing',
},
])
);
const row4 = new MessageActionRow() message.channel.send({
.addComponents( content: 'Select your Misc roles',
new MessageSelectMenu() components: [row4],
.setCustomId("miscSelect") });
.setPlaceholder("Select your misc roles") },
.setMinValues(0) };
.setMaxValues(2)
.addOptions([
{
label:"Course Rep",
description:"Get access to the course rep channel",
value:"courserep",
},
{
label:"CourseWork Help Ping",
description:"If you want to help out within our coursework-help channel",
value:"ACWPing",
},
])
)
message.channel.send({content: "Select your Misc roles", components:[row4]})
},
};

View File

@ -1,56 +1,56 @@
const { Message, Client, MessageActionRow, MessageSelectMenu } = require("discord.js"); const { MessageActionRow, MessageSelectMenu } = require('discord.js');
module.exports = { module.exports = {
name: "pronouns", name: 'pronouns',
aliases: [''], aliases: [''],
/** /**
* *
* @param {Client} client * @param {Client} client
* @param {Message} message * @param {Message} message
* @param {String[]} args * @param {String[]} args
*/ */
run: async (client, message, args) => { run: async (client, message) => {
const row2 = new MessageActionRow() const row2 = new MessageActionRow().addComponents(
.addComponents( new MessageSelectMenu()
new MessageSelectMenu() .setCustomId('pronounSelect')
.setCustomId("pronounSelect") .setPlaceholder('Select your pronouns')
.setPlaceholder("Select your pronouns") .setMinValues(0)
.setMinValues(0) .setMaxValues(7)
.setMaxValues(7) .addOptions([
.addOptions([ {
{ label: 'He/Him',
label:"He/Him", value: 'HeHim',
value:"HeHim", },
}, {
{ label: 'He/They',
label:"He/They", value: 'HeThey',
value:"HeThey", },
{
label: 'She/Her',
value: 'SheHer',
},
{
label: 'She/They',
value: 'SheThey',
},
{
label: 'They/Them',
value: 'TheyThem',
},
{
label: 'Any Pronouns',
value: 'Any',
},
{
label: 'Ask My Pronouns',
value: 'Ask',
},
])
);
}, message.channel.send({
{ content: 'Select your pronouns.',
label:"She/Her", components: [row2],
value:"SheHer", });
}, },
{ };
label:"She/They",
value:"SheThey",
},
{
label:"They/Them",
value:"TheyThem",
},
{
label:"Any Pronouns",
value:"Any",
},
{
label:"Ask My Pronouns",
value:"Ask",
},
])
)
message.channel.send({content: "Select your pronouns.", components:[row2]})
}
}

View File

@ -1,57 +1,54 @@
const { Message, Client, MessageActionRow, MessageSelectMenu } = require("discord.js"); const { MessageActionRow, MessageSelectMenu } = require('discord.js');
module.exports = { module.exports = {
name: "years", name: 'years',
aliases: [''], aliases: [''],
/** /**
* *
* @param {Client} client * @param {Client} client
* @param {Message} message * @param {Message} message
* @param {String[]} args * @param {String[]} args
*/ */
run: async (client, message, args) => { run: async (client, message) => {
const row1 = new MessageActionRow() const row1 = new MessageActionRow().addComponents(
.addComponents( new MessageSelectMenu()
new MessageSelectMenu() .setCustomId('yearSelect')
.setCustomId("yearSelect") .setPlaceholder('Select your current year')
.setPlaceholder("Select your current year") .addOptions([
.addOptions([ {
{ label: 'Foundation',
label:"Foundation", value: '0',
value:"0", },
}, {
{ label: 'First Year',
label:"First Year", value: '1',
value:"1", },
{
}, label: 'Second Year',
{ value: '2',
label:"Second Year", },
value:"2", {
}, label: 'Year In Industry',
{ value: '3',
label:"Year In Industry", },
value:"3", {
}, label: 'Third Year',
{ value: '4',
label:"Third Year", },
value:"4", {
}, label: 'Masters',
{ value: '5',
label:"Masters", },
value:"5", {
}, label: 'PhD',
{ value: '6',
label:"PhD", },
value:"6", {
}, label: 'Graduate',
{ value: '7',
label:"Graduate", },
value:"7", ])
}, );
]) message.channel.send({ content: 'Select your year.', components: [row1] });
) },
message.channel.send({content: "Select your year.", components:[row1]}) };
}
}

View File

@ -1,12 +1,12 @@
const client = require("../index"); const client = require('../index');
client.on('guildMemberAdd', async (guildmember) =>{ client.on('guildMemberAdd', async (guildmember) => {
const welcomechannel = client.channels.cache.get('427875246801027072') const welcomechannel = client.channels.cache.get('427875246801027072');
const guild = client.guilds.cache.get('427865794467069962'); const guild = client.guilds.cache.get('427865794467069962');
if(guild == guildmember.guild.id ) if (guild == guildmember.guild.id) {
{ welcomechannel.send({
welcomechannel.send({ content: `<a:WavingHand:973689926258393169> Welcome! **${guildmember.user}** has just joined the server! Grab some roles from <#427873938333499404> and let us know who you are within <#427874873898041346>`}) content: `<a:WavingHand:973689926258393169> Welcome! **${guildmember.user}** has just joined the server! Grab some roles from <#427873938333499404> and let us know who you are within <#427874873898041346>`,
});
} }
}) });

View File

@ -1,36 +1,50 @@
const client = require("../index");
const { MessageEmbed } = require('discord.js'); const { MessageEmbed } = require('discord.js');
const { time } = require("@discordjs/builders"); const client = require('../index');
client.on('guildScheduledEventCreate', async guildScheduledEvent =>{ client.on('guildScheduledEventCreate', async (guildScheduledEvent) => {
const channel = client.channels.cache.get('973686987787751534') const channel = client.channels.cache.get('973686987787751534');
const embed = new MessageEmbed() const embed = new MessageEmbed()
.setTitle(guildScheduledEvent.name) .setTitle(guildScheduledEvent.name)
.setDescription(guildScheduledEvent.description) .setDescription(guildScheduledEvent.description)
.setColor('GREEN') .setColor('GREEN');
if(interaction.user.tag !== null) if (guildScheduledEvent.user.tag !== null) {
{ embed.setFooter({ text: `Created by ${guildScheduledEvent.creator.tag}` });
embed.setFooter({text: `Created by ${guildScheduledEvent.creator.tag}`})
} }
embed.setTimestamp() embed.setTimestamp();
embed.setImage(`https://cdn.discordapp.com/guild-events/${guildScheduledEvent.id}/${guildScheduledEvent.image}.png?size=2048`) embed.setImage(
`https://cdn.discordapp.com/guild-events/${guildScheduledEvent.id}/${guildScheduledEvent.image}.png?size=2048`
);
if(guildScheduledEvent.entityType !== 'EXTERNAL') if (guildScheduledEvent.entityType !== 'EXTERNAL') {
{ embed.addField(
embed.addField('Location', `${guildScheduledEvent.channel.name} - [Link](https://discordapp.com/channels/427865794467069962/${guildScheduledEvent.channelId})`) 'Location',
} `${guildScheduledEvent.channel.name} - [Link](https://discordapp.com/channels/427865794467069962/${guildScheduledEvent.channelId})`
else );
{ } else {
embed.addField('Location', `External - ${guildScheduledEvent.entityMetadata.location}`) embed.addField(
} 'Location',
`External - ${guildScheduledEvent.entityMetadata.location}`
);
}
embed.addField('Start Date and Time', `${guildScheduledEvent.scheduledStartAt.toLocaleString('en-UK', { timeZone: "Europe/London" })}`, true) embed.addField(
if(guildScheduledEvent.scheduledEndAt !== null) 'Start Date and Time',
{ `${guildScheduledEvent.scheduledStartAt.toLocaleString('en-UK', {
embed.addField('End Date and Time', `${guildScheduledEvent.scheduledStartAt.toLocaleString('en-UK', { timeZone: "Europe/London" })}`, true) timeZone: 'Europe/London',
} })}`,
true
embed.addField('InviteURL', `${guildScheduledEvent.url}`) );
if (guildScheduledEvent.scheduledEndAt !== null) {
embed.addField(
'End Date and Time',
`${guildScheduledEvent.scheduledStartAt.toLocaleString('en-UK', {
timeZone: 'Europe/London',
})}`,
true
);
}
channel.send({ embeds: [embed]}) embed.addField('InviteURL', `${guildScheduledEvent.url}`);
})
channel.send({ embeds: [embed] });
});

View File

@ -1,21 +1,20 @@
const client = require("../index"); const client = require('../index');
client.on('ready', () => { client.on('ready', () => {
console.log('HullCSS is online') console.log('HullCSS is online');
const Activities = [ const Activities = ['Hullcss.org', 'Slash Commands'];
"Hullcss.org",
"Slash Commands",
];
setInterval(() =>{ setInterval(() => {
client.user.setActivity(Activities[Math.floor(Math.random() * Activities.length)], {type:"WATCHING"}) client.user.setActivity(
}, 180000); Activities[Math.floor(Math.random() * Activities.length)],
{ type: 'WATCHING' }
);
}, 180000);
setInterval(() =>{ setInterval(() => {
const memberCount = client.guilds.cache.get('427865794467069962').memberCount const { memberCount } = client.guilds.cache.get('427865794467069962');
const channel = client.channels.cache.get('906167542249308160'); const channel = client.channels.cache.get('906167542249308160');
channel.setName(`Discord Members: ${memberCount.toLocaleString()}`); channel.setName(`Discord Members: ${memberCount.toLocaleString()}`);
}, 600000); }, 600000);
});
})

View File

@ -1,8 +1,8 @@
const { Client, Collection } = require("discord.js"); const { Client, Collection } = require('discord.js');
require("dotenv").config(); require('dotenv').config();
const client = new Client({ const client = new Client({
intents: 98819, intents: 98819,
}); });
module.exports = client; module.exports = client;
@ -11,6 +11,6 @@ client.commands = new Collection();
client.slashCommands = new Collection(); client.slashCommands = new Collection();
// Initializing the project // Initializing the project
require("./handler")(client); require('./handler')(client);
client.login(process.env.DISCORD_TOKEN); client.login(process.env.DISCORD_TOKEN);

View File

@ -1,26 +1,35 @@
const { Client, CommandInteraction, Permissions } = require("discord.js"); const { Permissions } = require('discord.js');
const { SlashCommandBuilder } = require('@discordjs/builders'); const { SlashCommandBuilder } = require('@discordjs/builders');
const { PermissionFlagsBits } = require('discord-api-types/v10'); const { PermissionFlagsBits } = require('discord-api-types/v10');
module.exports = { module.exports = {
...new SlashCommandBuilder() ...new SlashCommandBuilder()
.setName('lock') .setName('lock')
.setDescription('Lock a channel') .setDescription('Lock a channel')
.setDefaultMemberPermissions(PermissionFlagsBits.KickMembers | PermissionFlagsBits.BanMembers), .setDefaultMemberPermissions(
PermissionFlagsBits.KickMembers || PermissionFlagsBits.BanMembers
),
/** /**
* *
* @param {Client} client * @param {Client} client
* @param {CommandInteraction} interaction * @param {CommandInteraction} interaction
* @param {String[]} args * @param {String[]} args
*/ */
run: async (client, interaction, args) => {
const permission = interaction.member.permissions.has(Permissions.FLAGS.MANAGE_CHANNELS) run: async (client, interaction) => {
if (!permission)return interaction.reply({ contents: "You don't have permission to use this command", ephemeral: true }); const permission = interaction.member.permissions.has(
interaction.channel.permissionOverwrites.edit(interaction.guild.roles.everyone.id, {SEND_MESSAGES: false}); Permissions.FLAGS.MANAGE_CHANNELS
interaction.reply("Channel has been locked.") );
if (!permission)
}, return interaction.reply({
}; contents: "You don't have permission to use this command",
ephemeral: true,
});
interaction.channel.permissionOverwrites.edit(
interaction.guild.roles.everyone.id,
{ SEND_MESSAGES: false }
);
interaction.reply('Channel has been locked.');
},
};

View File

@ -1,25 +1,33 @@
const { Client, CommandInteraction, Permissions } = require("discord.js"); const { Permissions } = require('discord.js');
const { SlashCommandBuilder } = require('@discordjs/builders'); const { SlashCommandBuilder } = require('@discordjs/builders');
const { PermissionFlagsBits } = require('discord-api-types/v10'); const { PermissionFlagsBits } = require('discord-api-types/v10');
module.exports = { module.exports = {
...new SlashCommandBuilder() ...new SlashCommandBuilder()
.setName('unlock') .setName('unlock')
.setDescription('Unlock a channel') .setDescription('Unlock a channel')
.setDefaultMemberPermissions(PermissionFlagsBits.KickMembers | PermissionFlagsBits.BanMembers), .setDefaultMemberPermissions(
/** PermissionFlagsBits.KickMembers || PermissionFlagsBits.BanMembers
* ),
* @param {Client} client /**
* @param {CommandInteraction} interaction *
* @param {String[]} args * @param {Client} client
*/ * @param {CommandInteraction} interaction
run: async (client, interaction, args) => { * @param {String[]} args
*/
const permission = interaction.member.permissions.has(Permissions.FLAGS.MANAGE_CHANNELS) run: async (client, interaction) => {
if (!permission)return interaction.reply({ contents: "You don't have permission to use this command", ephemeral: true }); const permission = interaction.member.permissions.has(
interaction.channel.permissionOverwrites.edit(interaction.guild.roles.everyone.id, {SEND_MESSAGES: true}); Permissions.FLAGS.MANAGE_CHANNELS
interaction.reply("Channel has been unlocked.") );
if (!permission)
}, return interaction.reply({
}; contents: "You don't have permission to use this command",
ephemeral: true,
});
interaction.channel.permissionOverwrites.edit(
interaction.guild.roles.everyone.id,
{ SEND_MESSAGES: true }
);
interaction.reply('Channel has been unlocked.');
},
};

View File

@ -1,41 +1,38 @@
const { Client, CommandInteraction, MessageEmbed } = require("discord.js"); const { MessageEmbed } = require('discord.js');
const { SlashCommandBuilder } = require('@discordjs/builders'); const { SlashCommandBuilder } = require('@discordjs/builders');
module.exports = { module.exports = {
...new SlashCommandBuilder() ...new SlashCommandBuilder()
.setName('8ball') .setName('8ball')
.setDescription('Answer your deepest questions') .setDescription('Answer your deepest questions')
.addStringOption((option) => option .addStringOption((option) =>
.setName('question') option
.setDescription("Your question") .setName('question')
.setRequired(true) .setDescription('Your question')
), .setRequired(true)
),
/** /**
* *
* @param {Client} client * @param {Client} client
* @param {CommandInteraction} interaction * @param {CommandInteraction} interaction
* @param {String[]} args * @param {String[]} args
*/ */
run: async (client, interaction, args) => { run: async (client, interaction) => {
const questionToSend = interaction.options.getString("question") const questionToSend = interaction.options.getString('question');
const Responses = [ const Responses = ['Yes', 'No', 'Maybe', 'It is likely', 'It is unlikely'];
"Yes",
"No",
"Maybe",
"It is likely",
"It is unlikely"
];
const embed = new MessageEmbed() const embed = new MessageEmbed()
.setColor('GREEN') .setColor('GREEN')
.setFooter({ text: `Called By: ${interaction.user.tag}`}) .setFooter({ text: `Called By: ${interaction.user.tag}` })
.setTimestamp() .setTimestamp()
.setTitle("8ball") .setTitle('8ball')
.addField(`${questionToSend}`,`${Responses[Math.floor(Math.random() * Responses.length)]}`) .addField(
interaction.reply({ embeds: [embed]}); `${questionToSend}`,
}, `${Responses[Math.floor(Math.random() * Responses.length)]}`
}; );
interaction.reply({ embeds: [embed] });
},
};

View File

@ -1,56 +1,53 @@
const { Client, CommandInteraction } = require("discord.js");
const { SlashCommandBuilder } = require('@discordjs/builders'); const { SlashCommandBuilder } = require('@discordjs/builders');
module.exports = { module.exports = {
...new SlashCommandBuilder() ...new SlashCommandBuilder()
.setName('gorb') .setName('gorb')
.setDescription('Gorb') .setDescription('Gorb')
.addStringOption(option => .addStringOption((option) =>
option option
.setName('type') .setName('type')
.setDescription('The gorb type') .setDescription('The gorb type')
.addChoices( .addChoices(
{ name: 'Christmas', value: 'christmas' }, { name: 'Christmas', value: 'christmas' },
{ name: 'Party', value: 'party' }, { name: 'Party', value: 'party' },
{ name: 'Computer Science', value: 'cs' }, { name: 'Computer Science', value: 'cs' },
{ name: 'Large', value: 'large' }, { name: 'Large', value: 'large' },
{ name: 'Storm', value: 'storm' }, { name: 'Storm', value: 'storm' }
)), )
),
/** /**
* *
* @param {Client} client * @param {Client} client
* @param {CommandInteraction} interaction * @param {CommandInteraction} interaction
* @param {String[]} args * @param {String[]} args
*/ */
run: async (client, interaction, args) => { run: async (client, interaction) => {
const string = interaction.options.getString('type'); const string = interaction.options.getString('type');
if(string == null){ if (string == null) {
await interaction.reply({ files: ['./images/gorb.jpg'] }) await interaction.reply({ files: ['./images/gorb.jpg'] });
} }
if(string == 'cs'){
await interaction.reply({ files: ['./images/gorbcs.jpg'] })
}
if(string == 'party'){ if (string == 'cs') {
await interaction.reply({ files: ['./images/gorbcelebration.PNG'] }) await interaction.reply({ files: ['./images/gorbcs.jpg'] });
} }
if(string == 'christmas'){ if (string == 'party') {
await interaction.reply({ files: ['./images/gorbchristmas.PNG'] }) await interaction.reply({ files: ['./images/gorbcelebration.PNG'] });
} }
if(string == 'storm'){
await interaction.reply({ files: ['./images/gorbstorm.PNG'] })
}
if(string == 'large'){ if (string == 'christmas') {
await interaction.reply({ files: ['./images/gorblarge.png'] }) await interaction.reply({ files: ['./images/gorbchristmas.PNG'] });
} }
if (string == 'storm') {
await interaction.reply({ files: ['./images/gorbstorm.PNG'] });
}
if (string == 'large') {
}, await interaction.reply({ files: ['./images/gorblarge.png'] });
}; }
},
};

View File

@ -1,16 +1,18 @@
const { Client, CommandInteraction } = require("discord.js");
module.exports = { module.exports = {
name: "lampadaferens", name: 'lampadaferens',
description: "Hull University", description: 'Hull University',
type: 'CHAT_INPUT', type: 'CHAT_INPUT',
/** /**
* *
* @param {Client} client * @param {Client} client
* @param {CommandInteraction} interaction * @param {CommandInteraction} interaction
* @param {String[]} args * @param {String[]} args
*/ */
run: async (client, interaction, args) => { run: async (client, interaction) => {
interaction.reply({ files: ['https://c.tenor.com/N8A8lQ3g0YIAAAAd/chaseatlanticgifs-sarahmcfadyen.gif'] }); interaction.reply({
}, files: [
}; 'https://c.tenor.com/N8A8lQ3g0YIAAAAd/chaseatlanticgifs-sarahmcfadyen.gif',
],
});
},
};

View File

@ -1,22 +1,24 @@
const { Client, CommandInteraction, MessageEmbed } = require("discord.js"); const { MessageEmbed } = require('discord.js');
module.exports = { module.exports = {
name: "buy", name: 'buy',
description: "returns membership purchase link", description: 'returns membership purchase link',
type: 'CHAT_INPUT', type: 'CHAT_INPUT',
/** /**
* *
* @param {Client} client * @param {Client} client
* @param {CommandInteraction} interaction * @param {CommandInteraction} interaction
* @param {String[]} args * @param {String[]} args
*/ */
run: async (client, interaction, args) => { run: async (client, interaction) => {
const embed = new MessageEmbed() const embed = new MessageEmbed()
.setTitle("Thanks for considering to become a paid member!") .setTitle('Thanks for considering to become a paid member!')
.setColor('GREEN') .setColor('GREEN')
.setFooter({ text: `Called By: ${interaction.user.tag}`}) .setFooter({ text: `Called By: ${interaction.user.tag}` })
.addField('You can purchase from below!','https://hulluniunion.com/shop?aid=304') .addField(
interaction.reply({ embeds: [embed] }); 'You can purchase from below!',
}, 'https://hulluniunion.com/shop?aid=304'
);
interaction.reply({ embeds: [embed] });
},
}; };

View File

@ -1,22 +1,27 @@
const { Client, CommandInteraction, MessageEmbed } = require("discord.js"); const { MessageEmbed } = require('discord.js');
module.exports = { module.exports = {
name: "freeside", name: 'freeside',
description: "returns freeside discord link", description: 'returns freeside discord link',
type: 'CHAT_INPUT', type: 'CHAT_INPUT',
/** /**
* *
* @param {Client} client * @param {Client} client
* @param {CommandInteraction} interaction * @param {CommandInteraction} interaction
* @param {String[]} args * @param {String[]} args
*/ */
run: async (client, interaction, args) => { run: async (client, interaction) => {
const embed = new MessageEmbed() const embed = new MessageEmbed()
.setTitle("Freeside") .setTitle('Freeside')
.setColor('ORANGE') .setColor('ORANGE')
.setFooter({ text: `Called By: ${interaction.user.tag}`}) .setFooter({ text: `Called By: ${interaction.user.tag}` })
.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.') .setDescription(
.addField('You can join them from below!','https://discord.freeside.co.uk') '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.'
interaction.reply({ embeds: [embed] }); )
}, .addField(
'You can join them from below!',
'https://discord.freeside.co.uk'
);
interaction.reply({ embeds: [embed] });
},
}; };

View File

@ -1,21 +1,21 @@
const { Client, CommandInteraction, MessageEmbed } = require("discord.js"); const { MessageEmbed } = require('discord.js');
module.exports = { module.exports = {
name: "links", name: 'links',
description: "returns links of Hullcss", description: 'returns links of HullCSS',
type: 'CHAT_INPUT', type: 'CHAT_INPUT',
/** /**
* *
* @param {Client} client * @param {Client} client
* @param {CommandInteraction} interaction * @param {CommandInteraction} interaction
* @param {String[]} args * @param {String[]} args
*/ */
run: async (client, interaction, args) => { run: async (client, interaction) => {
const embed = new MessageEmbed() const embed = new MessageEmbed()
.setTitle("Links!") .setTitle('Links!')
.setColor('GREEN') .setColor('GREEN')
.setFooter({ text: `Called By: ${interaction.user.tag}`}) .setFooter({ text: `Called By: ${interaction.user.tag}` })
.addField('Find us here:','https://hullcss.org') .addField('Find us here:', 'https://hullcss.org');
interaction.reply({ embeds: [embed]}); interaction.reply({ embeds: [embed] });
}, },
}; };

View File

@ -1,28 +1,32 @@
const { Client, CommandInteraction, MessageEmbed } = require("discord.js"); const { MessageEmbed } = require('discord.js');
module.exports = { module.exports = {
name: "ping", name: 'ping',
description: "returns ping of the Hullcss bot", description: 'returns ping of the HullCSS bot',
type: 'CHAT_INPUT', type: 'CHAT_INPUT',
/** /**
* *
* @param {Client} client * @param {Client} client
* @param {CommandInteraction} interaction * @param {CommandInteraction} interaction
* @param {String[]} args * @param {String[]} args
*/ */
run: async (client, interaction, args) => { run: async (client, interaction) => {
let days = Math.floor(client.uptime / 86400000); const days = Math.floor(client.uptime / 86400000);
let hours = Math.floor(client.uptime / 3600000) % 24; const hours = Math.floor(client.uptime / 3600000) % 24;
let minutes = Math.floor(client.uptime / 60000) % 60; const minutes = Math.floor(client.uptime / 60000) % 60;
let seconds = Math.floor(client.uptime / 1000) % 60; const seconds = Math.floor(client.uptime / 1000) % 60;
const embed = new MessageEmbed() const embed = new MessageEmbed()
.setColor('GREEN') .setColor('GREEN')
.setFooter({ text: `Called By: ${interaction.user.tag}`}) .setFooter({ text: `Called By: ${interaction.user.tag}` })
.setTimestamp() .setTimestamp()
.setTitle("Pong!") .setTitle('Pong!')
.setDescription(`${client.ws.ping} ping to host`) .setDescription(`${client.ws.ping} ping to host`)
.addField('Uptime', ` ${days}days ${hours}hrs ${minutes}min ${seconds}sec`, true) .addField(
interaction.reply({ embeds: [embed]}); 'Uptime',
}, ` ${days}days ${hours}hrs ${minutes}min ${seconds}sec`,
}; true
);
interaction.reply({ embeds: [embed] });
},
};

View File

@ -1,22 +1,27 @@
const { Client, CommandInteraction, MessageEmbed } = require("discord.js"); const { MessageEmbed } = require('discord.js');
module.exports = { module.exports = {
name: "robsoc", name: 'robsoc',
description: "returns robotics society discord link", description: 'returns robotics society discord link',
type: 'CHAT_INPUT', type: 'CHAT_INPUT',
/** /**
* *
* @param {Client} client * @param {Client} client
* @param {CommandInteraction} interaction * @param {CommandInteraction} interaction
* @param {String[]} args * @param {String[]} args
*/ */
run: async (client, interaction, args) => { run: async (client, interaction) => {
const embed = new MessageEmbed() const embed = new MessageEmbed()
.setTitle("Robotics Society") .setTitle('Robotics Society')
.setColor('BLUE') .setColor('BLUE')
.setFooter({ text: `Called By: ${interaction.user.tag}`}) .setFooter({ text: `Called By: ${interaction.user.tag}` })
.setDescription('Robotics Society are a society where you can gain skills in building an actual robot, or get help with your assignments or exams, but they also run social nights where they go out to do stuff.') .setDescription(
.addField('You can join them from below!','https://discord.gg/cMP5CavnK4') 'Robotics Society are a society where you can gain skills in building an actual robot, or get help with your assignments or exams, but they also run social nights where they go out to do stuff.'
interaction.reply({ embeds: [embed]}); )
}, .addField(
}; 'You can join them from below!',
'https://discord.gg/cMP5CavnK4'
);
interaction.reply({ embeds: [embed] });
},
};