Merge branch 'dev' into 'main'
Formatted all files using clang See merge request illegitimate/illegitimate-bot!20
This commit is contained in:
@@ -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;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -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"));
|
||||||
|
|
||||||
|
|||||||
@@ -430,8 +430,7 @@ module.exports = {
|
|||||||
.setStyle(ButtonStyle.Danger)
|
.setStyle(ButtonStyle.Danger)
|
||||||
)
|
)
|
||||||
]
|
]
|
||||||
}
|
});
|
||||||
);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
5
index.js
5
index.js
@@ -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(() => {
|
||||||
|
|||||||
@@ -28,6 +28,7 @@ function getLevelRespectingPrestige(level){
|
|||||||
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;
|
||||||
@@ -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];
|
||||||
|
|||||||
Reference in New Issue
Block a user