Formatted all files using clang

This commit is contained in:
2023-09-01 06:53:45 +02:00
parent dc3525a524
commit 9787b0e14a
37 changed files with 1708 additions and 1717 deletions

View File

@@ -1,4 +1,4 @@
const { ContextMenuCommandBuilder, ApplicationCommandType, PermissionFlagsBits, userMention} = require('discord.js'); const { ContextMenuCommandBuilder, ApplicationCommandType, PermissionFlagsBits, userMention } = require('discord.js');
module.exports = { module.exports = {
name: 'congratsmessage', name: 'congratsmessage',
@@ -22,7 +22,7 @@ module.exports = {
const target = message.author; const target = message.author;
await message.reply({ await message.reply({
embeds:[{ embeds: [{
title: 'Congratulations!', title: 'Congratulations!',
description: `GG to ${userMention(target.id)}!`, description: `GG to ${userMention(target.id)}!`,
}] }]

View File

@@ -3,7 +3,7 @@ const { color } = require("../config/options.json");
const verify = require("../schemas/verifySchema.js"); const verify = require("../schemas/verifySchema.js");
const mongoose = require("mongoose"); const mongoose = require("mongoose");
const { gm, manager, moderator, beast, member, trialmember, guildRole, guildStaff, defaultMember } = require("../config/roles.json"); const { gm, manager, moderator, beast, member, trialmember, guildRole, guildStaff, defaultMember } = require("../config/roles.json");
const removeThese = [ gm, manager, moderator, beast, member, trialmember, guildRole, guildStaff, defaultMember ] const removeThese = [gm, manager, moderator, beast, member, trialmember, guildRole, guildStaff, defaultMember]
module.exports = { module.exports = {
name: "forceunverify", name: "forceunverify",

View File

@@ -4,7 +4,7 @@ const hypixelApiKey = process.env.HYPIXELAPIKEY;
const fetch = require('axios'); const fetch = require('axios');
const { color, hypixelGuildID } = require('../config/options.json'); const { color, hypixelGuildID } = require('../config/options.json');
const verify = require('../schemas/verifySchema.js') const verify = require('../schemas/verifySchema.js')
const {mongoose} = require('mongoose'); const { mongoose } = require('mongoose');
const { gm, manager, moderator, beast, elite, member, trialmember, guildRole, guildStaff, defaultMember } = require('../config/roles.json'); const { gm, manager, moderator, beast, elite, member, trialmember, guildRole, guildStaff, defaultMember } = require('../config/roles.json');

View File

@@ -67,7 +67,7 @@ module.exports = {
return return
} }
await interaction.editReply({ content: "Please check your DMs.", ephemeral: true}) await interaction.editReply({ content: "Please check your DMs.", ephemeral: true })
const input = await user.dmChannel.awaitMessages({ const input = await user.dmChannel.awaitMessages({
@@ -84,17 +84,17 @@ module.exports = {
return return
} }
if (input.first().content.toLowerCase() !== 'yes') { if (input.first().content.toLowerCase() !== 'yes') {
await user.send({ embeds: [cancelled]} ); await user.send({ embeds: [cancelled] });
return return
} }
// first question // first question
const question1 = await user.send({ const question1 = await user.send({
embeds: [{ embeds: [{
title : "**Question 1**", title: "**Question 1**",
description: qu1 + "\n\nPlease type your answer below or type `cancel` to cancel your application.\n`" + ignM + "`", description: qu1 + "\n\nPlease type your answer below or type `cancel` to cancel your application.\n`" + ignM + "`",
color: embedColor, color: embedColor,
footer:{ footer: {
text: "You have 5 minutes to respond to this message." text: "You have 5 minutes to respond to this message."
} }
}] }]
@@ -142,10 +142,10 @@ module.exports = {
// second question // second question
const question2 = await user.send({ const question2 = await user.send({
embeds: [{ embeds: [{
title : "**Question 2**", title: "**Question 2**",
description: qu2 + "\n\nPlease type your answer below or type `cancel` to cancel your application.\n" + "`(8 characters max)`", description: qu2 + "\n\nPlease type your answer below or type `cancel` to cancel your application.\n" + "`(8 characters max)`",
color: embedColor, color: embedColor,
footer:{ footer: {
text: "You have 15 minutes to respond to this message." text: "You have 15 minutes to respond to this message."
} }
}] }]
@@ -181,10 +181,10 @@ module.exports = {
// third question // third question
const question3 = await user.send({ const question3 = await user.send({
embeds: [{ embeds: [{
title : "**Question 3**", title: "**Question 3**",
description: qu3 + "\n\nPlease type your answer below or type `cancel` to cancel your application.\n`" + smallM + "`", description: qu3 + "\n\nPlease type your answer below or type `cancel` to cancel your application.\n`" + smallM + "`",
color: embedColor, color: embedColor,
footer:{ footer: {
text: "You have 15 minutes to respond to this message." text: "You have 15 minutes to respond to this message."
} }
}] }]
@@ -219,11 +219,11 @@ module.exports = {
// fourth question // fourth question
const question4 = await user.send({ const question4 = await user.send({
embeds: [{ embeds: [{
title : "**Question 4**", title: "**Question 4**",
description: qu4 + "\n\nPlease type your answer below or type `cancel` to cancel your application." + description: qu4 + "\n\nPlease type your answer below or type `cancel` to cancel your application." +
" `(We expect a longer answer.)`\n`" + largeM + "`", " `(We expect a longer answer.)`\n`" + largeM + "`",
color: embedColor, color: embedColor,
footer:{ footer: {
text: "You have 15 minutes to respond to this message." text: "You have 15 minutes to respond to this message."
} }
}] }]
@@ -258,10 +258,10 @@ module.exports = {
// fifth question // fifth question
const question5 = await user.send({ const question5 = await user.send({
embeds: [{ embeds: [{
title : "**Question 5**", title: "**Question 5**",
description: qu5 + "\n\nPlease type your answer below or type `cancel` to cancel your application.\n`" + smallM + "`", description: qu5 + "\n\nPlease type your answer below or type `cancel` to cancel your application.\n`" + smallM + "`",
color: embedColor, color: embedColor,
footer:{ footer: {
text: "You have 15 minutes to respond to this message." text: "You have 15 minutes to respond to this message."
} }
}] }]
@@ -296,10 +296,10 @@ module.exports = {
// sixth question // sixth question
const question6 = await user.send({ const question6 = await user.send({
embeds: [{ embeds: [{
title : "**Question 6**", title: "**Question 6**",
description: qu6 + "\n\nPlease type your answer below or type `cancel` to cancel your application.\n`" + largeM + "`", description: qu6 + "\n\nPlease type your answer below or type `cancel` to cancel your application.\n`" + largeM + "`",
color: embedColor, color: embedColor,
footer:{ footer: {
text: "You have 15 minutes to respond to this message." text: "You have 15 minutes to respond to this message."
} }
}] }]
@@ -334,10 +334,10 @@ module.exports = {
// seventh question // seventh question
const question7 = await user.send({ const question7 = await user.send({
embeds: [{ embeds: [{
title : "**Question 7**", title: "**Question 7**",
description: qu7 + "\n\nPlease type your answer below or type `cancel` to cancel your application.\n`" + smallM + "`", description: qu7 + "\n\nPlease type your answer below or type `cancel` to cancel your application.\n`" + smallM + "`",
color: embedColor, color: embedColor,
footer:{ footer: {
text: "You have 15 minutes to respond to this message." text: "You have 15 minutes to respond to this message."
} }
}] }]
@@ -372,10 +372,10 @@ module.exports = {
// eighth question // eighth question
const question8 = await user.send({ const question8 = await user.send({
embeds: [{ embeds: [{
title : "**Question 8**", title: "**Question 8**",
description: qu8 + "\n\nPlease type your answer below or type `cancel` to cancel your application.\n" + "`(64 characters max)`", description: qu8 + "\n\nPlease type your answer below or type `cancel` to cancel your application.\n" + "`(64 characters max)`",
color: embedColor, color: embedColor,
footer:{ footer: {
text: "You have 15 minutes to respond to this message." text: "You have 15 minutes to respond to this message."
} }
}] }]
@@ -428,7 +428,7 @@ module.exports = {
return return
} }
if (final.first().content.toLowerCase() !== 'yes') { if (final.first().content.toLowerCase() !== 'yes') {
await user.send({ embeds: [cancelled]} ); await user.send({ embeds: [cancelled] });
return return
} }

View File

@@ -36,16 +36,14 @@ module.exports = {
try { try {
await user.send({ await user.send({
embeds: [ embeds: [{
{
title: "Guild Inactivity Log", title: "Guild Inactivity Log",
description: "Please answer the following questions to submit an inactivity log for the guild.\n" + description: "Please answer the following questions to submit an inactivity log for the guild.\n" +
"If you wish to cancel your form, please press type `cancel` at any time.\n" + "If you wish to cancel your form, please press type `cancel` at any time.\n" +
"If you wish to proceed with your form, please type `yes`.\n\n" + "**Do not upload images, videos, or GIFS.**\n" + "If you wish to proceed with your form, please type `yes`.\n\n" + "**Do not upload images, videos, or GIFS.**\n" +
"You have a minute to respond to this message.", "You have a minute to respond to this message.",
color: embedColor color: embedColor
} }]
]
}); });
} catch (error) { } catch (error) {
return await interaction.reply({ content: "Please enable your DMs.", ephemeral: true }); return await interaction.reply({ content: "Please enable your DMs.", ephemeral: true });
@@ -72,16 +70,14 @@ module.exports = {
} }
await user.send({ await user.send({
embeds: [ embeds: [{
{
title: "**Question 1**", title: "**Question 1**",
description: ia1 + "\n\nPlease type your answer below or type `cancel` to cancel your application.\n`" + ignM + "`", description: ia1 + "\n\nPlease type your answer below or type `cancel` to cancel your application.\n`" + ignM + "`",
color: embedColor, color: embedColor,
footer: { footer: {
text: "You have 5 minutes to respond to this message." text: "You have 5 minutes to respond to this message."
} }
} }]
]
}); });
const answer1 = await user.dmChannel.awaitMessages({ const answer1 = await user.dmChannel.awaitMessages({
@@ -95,12 +91,10 @@ module.exports = {
} }
if (answer1.first().content > 16) { if (answer1.first().content > 16) {
await user.send({ await user.send({
embeds: [ embeds: [{
{
description: "Max character limit is 16.", description: "Max character limit is 16.",
color: embedColor color: embedColor
} }]
]
}); });
return; return;
} }
@@ -108,12 +102,10 @@ module.exports = {
await fetch(mojangAPI + answer1.first().content); await fetch(mojangAPI + answer1.first().content);
} catch (error) { } catch (error) {
await user.send({ await user.send({
embeds: [ embeds: [{
{
description: "That is not a valid Minecraft username.\n" + "Application cancelled.", description: "That is not a valid Minecraft username.\n" + "Application cancelled.",
color: embedColor color: embedColor
} }]
]
}); });
return; return;
} }
@@ -148,12 +140,10 @@ module.exports = {
} }
if (answer2.first().content > 128) { if (answer2.first().content > 128) {
await user.send({ await user.send({
embeds: [ embeds: [{
{
description: "Max character limit is 128.", description: "Max character limit is 128.",
color: embedColor color: embedColor
} }]
]
}); });
return; return;
} }
@@ -188,12 +178,10 @@ module.exports = {
} }
if (answer3.first().content > 256) { if (answer3.first().content > 256) {
await user.send({ await user.send({
embeds: [ embeds: [{
{
description: "Max character limit is 256", description: "Max character limit is 256",
color: embedColor color: embedColor
} }]
]
}); });
return; return;
} }
@@ -227,7 +215,7 @@ module.exports = {
return return
} }
if (final.first().content.toLowerCase() !== 'yes') { if (final.first().content.toLowerCase() !== 'yes') {
await user.send({ embeds: [cancelled]} ); await user.send({ embeds: [cancelled] });
return return
} }

View File

@@ -10,7 +10,6 @@ module.exports = {
async execute(interaction) { async execute(interaction) {
const user = interaction.user; const user = interaction.user;
const channel = interaction.channel;
const guild = interaction.guild; const guild = interaction.guild;
const embedColor = Number(color.replace("#", "0x")); const embedColor = Number(color.replace("#", "0x"));

View File

@@ -27,12 +27,12 @@ module.exports = {
await interaction.deferReply({ ephemeral: true }); await interaction.deferReply({ ephemeral: true });
if (!userRoles.has(guildRole)) { if (!userRoles.has(guildRole)) {
await interaction.editReply({content: "You must be a member of the guild to apply for staff.", ephemeral: true}); await interaction.editReply({ content: "You must be a member of the guild to apply for staff.", ephemeral: true });
return return
} }
if (userRoles.has(guildStaff)) { if (userRoles.has(guildStaff)) {
await interaction.editReply({content: "You are already a staff member.", ephemeral: true}); await interaction.editReply({ content: "You are already a staff member.", ephemeral: true });
return return
} }
@@ -70,7 +70,7 @@ module.exports = {
return return
} }
await interaction.editReply({ content: "Please check your DMs.", ephemeral: true}) await interaction.editReply({ content: "Please check your DMs.", ephemeral: true })
const input = await user.dmChannel.awaitMessages({ const input = await user.dmChannel.awaitMessages({
filter: m => m.author.id === user.id, filter: m => m.author.id === user.id,
@@ -86,17 +86,17 @@ module.exports = {
return return
} }
if (input.first().content.toLowerCase() !== 'yes') { if (input.first().content.toLowerCase() !== 'yes') {
await user.send({ embeds: [cancelled]} ); await user.send({ embeds: [cancelled] });
return return
} }
// first question // first question
const question1 = await user.send({ const question1 = await user.send({
embeds: [{ embeds: [{
title : "**Question 1**", title: "**Question 1**",
description: sq1 + "\n\nPlease type your answer below or type `cancel` to cancel your application.\n`" + ignM + "`", description: sq1 + "\n\nPlease type your answer below or type `cancel` to cancel your application.\n`" + ignM + "`",
color: embedColor, color: embedColor,
footer:{ footer: {
text: "You have 5 minutes to respond to this message." text: "You have 5 minutes to respond to this message."
} }
}] }]
@@ -144,10 +144,10 @@ module.exports = {
// second question // second question
const question2 = await user.send({ const question2 = await user.send({
embeds: [{ embeds: [{
title : "**Question 2**", title: "**Question 2**",
description: sq2 + "\n\nPlease type your answer below or type `cancel` to cancel your application.\n" + "`(64 characters max)`", description: sq2 + "\n\nPlease type your answer below or type `cancel` to cancel your application.\n" + "`(64 characters max)`",
color: embedColor, color: embedColor,
footer:{ footer: {
text: "You have 15 minutes to respond to this message." text: "You have 15 minutes to respond to this message."
} }
}] }]
@@ -183,10 +183,10 @@ module.exports = {
// third question // third question
const question3 = await user.send({ const question3 = await user.send({
embeds: [{ embeds: [{
title : "**Question 3**", title: "**Question 3**",
description: sq3 + "\n\nPlease type your answer below or type `cancel` to cancel your application.\n`" + largeM + "`", description: sq3 + "\n\nPlease type your answer below or type `cancel` to cancel your application.\n`" + largeM + "`",
color: embedColor, color: embedColor,
footer:{ footer: {
text: "You have 15 minutes to respond to this message." text: "You have 15 minutes to respond to this message."
} }
}] }]
@@ -221,10 +221,10 @@ module.exports = {
// fourth question // fourth question
const question4 = await user.send({ const question4 = await user.send({
embeds: [{ embeds: [{
title : "**Question 4**", title: "**Question 4**",
description: sq4 + "\n\nPlease type your answer below or type `cancel` to cancel your application.\n`" + largeM + "`", description: sq4 + "\n\nPlease type your answer below or type `cancel` to cancel your application.\n`" + largeM + "`",
color: embedColor, color: embedColor,
footer:{ footer: {
text: "You have 15 minutes to respond to this message." text: "You have 15 minutes to respond to this message."
} }
}] }]
@@ -259,10 +259,10 @@ module.exports = {
// fifth question // fifth question
const question5 = await user.send({ const question5 = await user.send({
embeds: [{ embeds: [{
title : "**Question 5**", title: "**Question 5**",
description: sq5 + "\n\nPlease type your answer below or type `cancel` to cancel your application.\n`" + largeM + "`", description: sq5 + "\n\nPlease type your answer below or type `cancel` to cancel your application.\n`" + largeM + "`",
color: embedColor, color: embedColor,
footer:{ footer: {
text: "You have 15 minutes to respond to this message." text: "You have 15 minutes to respond to this message."
} }
}] }]
@@ -297,11 +297,11 @@ module.exports = {
// sixth question // sixth question
const question6 = await user.send({ const question6 = await user.send({
embeds: [{ embeds: [{
title : "**Question 6**", title: "**Question 6**",
description: sq6 + "\n\nPlease type your answer below or type `cancel` to cancel your application." + description: sq6 + "\n\nPlease type your answer below or type `cancel` to cancel your application." +
"`(We expect a longer answer here)`\n`" + largeM + "`", "`(We expect a longer answer here)`\n`" + largeM + "`",
color: embedColor, color: embedColor,
footer:{ footer: {
text: "You have 15 minutes to respond to this message." text: "You have 15 minutes to respond to this message."
} }
}] }]
@@ -354,7 +354,7 @@ module.exports = {
return return
} }
if (final.first().content.toLowerCase() !== 'yes') { if (final.first().content.toLowerCase() !== 'yes') {
await user.send({ embeds: [cancelled]} ); await user.send({ embeds: [cancelled] });
return return
} }
@@ -430,8 +430,7 @@ module.exports = {
.setStyle(ButtonStyle.Danger) .setStyle(ButtonStyle.Danger)
) )
] ]
} });
);
} }
} }
} }

View File

@@ -209,7 +209,8 @@ client.on(Events.ClientReady, () => {
client.on(Events.ClientReady, () => { client.on(Events.ClientReady, () => {
client.user.setActivity( client.user.setActivity(
{ name: "over the Illegitimate Server", type: ActivityType.Watching }); { name: "over the Illegitimate Server", type: ActivityType.Watching }
);
const activities = [ const activities = [
{ name: "for Martina's return", type: ActivityType.Watching }, { name: "for Martina's return", type: ActivityType.Watching },
@@ -229,9 +230,11 @@ client.on(Events.ClientReady, () => {
1000 * 60 * 30 1000 * 60 * 30
) )
}); });
client.on(Events.ClientReady, () => { client.on(Events.ClientReady, () => {
client.user.setStatus('dnd'); client.user.setStatus('dnd');
}); });
client.login(token); client.login(token);
connect(mongoURI, {}).then(() => { connect(mongoURI, {}).then(() => {

View File

@@ -23,7 +23,7 @@ const rest = new REST({ version: '10' }).setToken(token);
// and deploy your commands! // and deploy your commands!
(async () => { (async () => {
try { try {
console.log(`Started refreshing ${commands.length} application (/) commands.`); console.log(`Started refreshing ${commands.length} application (/) commands.`);
@@ -38,4 +38,4 @@ const rest = new REST({ version: '10' }).setToken(token);
// And of course, make sure you catch and log any errors! // And of course, make sure you catch and log any errors!
console.error(error); console.error(error);
} }
})(); })();

View File

@@ -1,13 +1,13 @@
/* ---------- bedwars level ---------- */ /* ---------- bedwars level ---------- */
function getExpForLevel(level){ function getExpForLevel(level) {
if(level == 0) return 0; if (level == 0) return 0;
var respectedLevel = getLevelRespectingPrestige(level); var respectedLevel = getLevelRespectingPrestige(level);
if(respectedLevel > EASY_LEVELS){ if (respectedLevel > EASY_LEVELS) {
return 5000; return 5000;
} }
switch(respectedLevel){ switch (respectedLevel) {
case 1: case 1:
return 500; return 500;
case 2: case 2:
@@ -20,27 +20,28 @@ function getExpForLevel(level){
return 5000; return 5000;
} }
function getLevelRespectingPrestige(level){ function getLevelRespectingPrestige(level) {
if(level > HIGHEST_PRESTIGE * LEVELS_PER_PRESTIGE){ if (level > HIGHEST_PRESTIGE * LEVELS_PER_PRESTIGE) {
return level - HIGHEST_PRESTIGE * LEVELS_PER_PRESTIGE; return level - HIGHEST_PRESTIGE * LEVELS_PER_PRESTIGE;
} }
else { else {
return level % LEVELS_PER_PRESTIGE; return level % LEVELS_PER_PRESTIGE;
} }
} }
const EASY_LEVELS = 4; const EASY_LEVELS = 4;
const EASY_LEVELS_XP = 7000; const EASY_LEVELS_XP = 7000;
const XP_PER_PRESTIGE = 96 * 5000 + EASY_LEVELS_XP; const XP_PER_PRESTIGE = 96 * 5000 + EASY_LEVELS_XP;
const LEVELS_PER_PRESTIGE = 100; const LEVELS_PER_PRESTIGE = 100;
const HIGHEST_PRESTIGE = 50; const HIGHEST_PRESTIGE = 50;
function getLevelForExp(exp){ function getLevelForExp(exp) {
var prestiges = Math.floor(exp / XP_PER_PRESTIGE); var prestiges = Math.floor(exp / XP_PER_PRESTIGE);
var level = prestiges * LEVELS_PER_PRESTIGE; var level = prestiges * LEVELS_PER_PRESTIGE;
var expWithoutPrestiges = exp - (prestiges * XP_PER_PRESTIGE); var expWithoutPrestiges = exp - (prestiges * XP_PER_PRESTIGE);
for(let i = 1; i <= EASY_LEVELS; ++i){ for (let i = 1; i <= EASY_LEVELS; ++i) {
var expForEasyLevel = getExpForLevel(i); var expForEasyLevel = getExpForLevel(i);
if(expWithoutPrestiges < expForEasyLevel){ if (expWithoutPrestiges < expForEasyLevel) {
break; break;
} }
level++; level++;
@@ -48,12 +49,11 @@ function getLevelForExp(exp){
} }
return level + expWithoutPrestiges / 5000 return level + expWithoutPrestiges / 5000
} }
// hypixel // hypixel
const BASE = 10000; const BASE = 10000;
const GROWTH = 2500; const GROWTH = 2500;
const HALF_GROWTH = 0.5 * GROWTH; const HALF_GROWTH = 0.5 * GROWTH;
const REVERSE_PQ_PREFIX = -(BASE - 0.5 * GROWTH) / GROWTH; const REVERSE_PQ_PREFIX = -(BASE - 0.5 * GROWTH) / GROWTH;
const REVERSE_CONST = REVERSE_PQ_PREFIX * REVERSE_PQ_PREFIX; const REVERSE_CONST = REVERSE_PQ_PREFIX * REVERSE_PQ_PREFIX;
const GROWTH_DIVIDES_2 = 2 / GROWTH; const GROWTH_DIVIDES_2 = 2 / GROWTH;
@@ -65,6 +65,7 @@ function getLevel(exp) {
function getExactLevel(exp) { function getExactLevel(exp) {
return getLevel(exp) + getPercentageToNextLevel(exp); return getLevel(exp) + getPercentageToNextLevel(exp);
} }
function getExpFromLevelToNext(level) { function getExpFromLevelToNext(level) {
return level < 1 ? BASE : GROWTH * (level - 1) + BASE; return level < 1 ? BASE : GROWTH * (level - 1) + BASE;
} }
@@ -85,6 +86,7 @@ function getPercentageToNextLevel(exp) {
const x0 = getTotalExpToLevel(lv); const x0 = getTotalExpToLevel(lv);
return (exp - x0) / (getTotalExpToLevel(lv + 1) - x0); return (exp - x0) / (getTotalExpToLevel(lv + 1) - x0);
} }
/* ---------- skywars level ---------- */ /* ---------- skywars level ---------- */
function skywarsLevel(xp) { function skywarsLevel(xp) {
var xps = [0, 20, 70, 150, 250, 500, 1000, 2000, 3500, 6000, 10000, 15000]; var xps = [0, 20, 70, 150, 250, 500, 1000, 2000, 3500, 6000, 10000, 15000];
@@ -95,7 +97,7 @@ function skywarsLevel(xp) {
} else { } else {
for (i = 0; i < xps.length; i++) { for (i = 0; i < xps.length; i++) {
if (xp < xps[i]) { if (xp < xps[i]) {
exactLevel = i + (xp - xps[i-1]) / (xps[i] - xps[i-1]); exactLevel = i + (xp - xps[i - 1]) / (xps[i] - xps[i - 1]);
return exactLevel; return exactLevel;
} }
} }