more more
All checks were successful
Deploy bot / build-and-deploy (push) Successful in 14s

This commit is contained in:
2025-08-07 23:56:07 +02:00
parent 2594991b21
commit dfc14f7f33
8 changed files with 38 additions and 7 deletions

View File

@ -3,6 +3,7 @@ exports.description =
":star: Sums and calculates bonus for player stat numbers."; ":star: Sums and calculates bonus for player stat numbers.";
exports.usage = "<<bonus <number> <number> [inf optional extra numbers]"; exports.usage = "<<bonus <number> <number> [inf optional extra numbers]";
exports.example = "<<bonus 100 100"; exports.example = "<<bonus 100 100";
exports.hidden = false;
exports.run = (client, message, args) => { exports.run = (client, message, args) => {
let is1nan = false; let is1nan = false;
if (!args[0]) if (!args[0])

View File

@ -2,6 +2,7 @@ exports.name = "cat";
exports.description = ":cat: Calculates boost for cat."; exports.description = ":cat: Calculates boost for cat.";
exports.usage = "<<cat <boost> <levels>"; exports.usage = "<<cat <boost> <levels>";
exports.example = "<<cat 80 120"; exports.example = "<<cat 80 120";
exports.hidden = false;
exports.run = (client, message, args) => { exports.run = (client, message, args) => {
if (!args[0] || !args[1]) if (!args[0] || !args[1])
return message.channel.send("Not enough arguments, consult <<help."); return message.channel.send("Not enough arguments, consult <<help.");

View File

@ -3,6 +3,7 @@ exports.description =
":crossed_swords: Calculate calamity blade damage taking in to account projectile speed."; ":crossed_swords: Calculate calamity blade damage taking in to account projectile speed.";
exports.usage = "<<cb <damage> <ups> [projectile speed]"; exports.usage = "<<cb <damage> <ups> [projectile speed]";
exports.example = "<<cb 10000 250 10000"; exports.example = "<<cb 10000 250 10000";
exports.hidden = false;
exports.run = (client, message, args) => { exports.run = (client, message, args) => {
if (!args[0] || !args[1]) if (!args[0] || !args[1])
return message.channel.send("Not enough arguments, consult <<help."); return message.channel.send("Not enough arguments, consult <<help.");

View File

@ -4,6 +4,7 @@ exports.description =
":scroll: Shows this message. (this bot is a crude imitation of tbolt's better bot :P)"; ":scroll: Shows this message. (this bot is a crude imitation of tbolt's better bot :P)";
exports.usage = "<<help [optional other command]"; exports.usage = "<<help [optional other command]";
exports.example = "<<help res"; exports.example = "<<help res";
exports.hidden = false;
exports.run = (client, message, args) => { exports.run = (client, message, args) => {
let embed = new EmbedBuilder(); let embed = new EmbedBuilder();
embed.setTitle("Commands Helper"); embed.setTitle("Commands Helper");
@ -13,6 +14,7 @@ exports.run = (client, message, args) => {
return message.channel.send( return message.channel.send(
"Command not found, try `<<help` first." "Command not found, try `<<help` first."
); );
if (cmd.hidden && message.author.id != client.ownerID) return;
embed.setTitle(`Help for \`${cmd.name}\` command`); embed.setTitle(`Help for \`${cmd.name}\` command`);
embed.setDescription(cmd.description); embed.setDescription(cmd.description);
embed.addFields( embed.addFields(
@ -27,6 +29,7 @@ exports.run = (client, message, args) => {
); );
} else { } else {
client.commands.forEach((cmd) => { client.commands.forEach((cmd) => {
if (cmd.hidden && message.author.id != client.ownerID) return;
embed.addFields({ embed.addFields({
name: cmd.name, name: cmd.name,
value: cmd.description, value: cmd.description,

View File

@ -3,6 +3,7 @@ exports.description =
":tada: Calculate moon staff damage taking in to account projectile speed."; ":tada: Calculate moon staff damage taking in to account projectile speed.";
exports.usage = "<<ms <elemental damage> <ups> [projectile speed]"; exports.usage = "<<ms <elemental damage> <ups> [projectile speed]";
exports.example = "<<ms 10000 250 10000"; exports.example = "<<ms 10000 250 10000";
exports.hidden = false;
exports.run = (client, message, args) => { exports.run = (client, message, args) => {
if (!args[0] || !args[1]) if (!args[0] || !args[1])
return message.channel.send("Not enough arguments, consult <<help."); return message.channel.send("Not enough arguments, consult <<help.");

20
commands/refetch.js Normal file
View File

@ -0,0 +1,20 @@
exports.name = "refetch";
exports.description = ":ninja: Refetch user react data.";
exports.usage = "<<refetch";
exports.example = "<<refetch";
exports.hidden = true;
exports.run = async (client, message, args) => {
const url = "https://drive.overflow.fun/public/react.json";
client.usersToReactTo = [];
const res = await fetch(url);
const data = await res.json();
client.usersToReactTo = data.map((entry) => {
const [userId, emoji] = entry.split(":");
return { userId, emoji };
});
message.channel.send(
"Refetched react data. " + JSON.stringify(client.usersToReactTo)
);
};

View File

@ -4,6 +4,7 @@ exports.description =
exports.usage = exports.usage =
"<<res <res> <res> <res> [res] | <hero stat> <levels> [second hero stat]"; "<<res <res> <res> <res> [res] | <hero stat> <levels> [second hero stat]";
exports.example = "<<res -3 1 -16 14 | 406 440"; exports.example = "<<res -3 1 -16 14 | 406 440";
exports.hidden = false;
exports.run = (client, message, args) => { exports.run = (client, message, args) => {
for (let i = 0; i < args.length; i++) { for (let i = 0; i < args.length; i++) {
if (args[i] == "|") continue; if (args[i] == "|") continue;

View File

@ -19,6 +19,7 @@ const client = new Client({
], ],
}); });
client.commands = new Collection(); client.commands = new Collection();
client.ownerID = 263247134147608578;
fs.readdir("./commands/", (err, files) => { fs.readdir("./commands/", (err, files) => {
if (err) return console.error(err); if (err) return console.error(err);
@ -32,12 +33,12 @@ fs.readdir("./commands/", (err, files) => {
}); });
const url = "https://drive.overflow.fun/public/react.json"; const url = "https://drive.overflow.fun/public/react.json";
let userstoreact = []; client.usersToReactTo = [];
client.once(Events.ClientReady, async (readyClient) => { client.once(Events.ClientReady, async (readyClient) => {
const res = await fetch(url); const res = await fetch(url);
const data = await res.json(); const data = await res.json();
userstoreact = data.map((entry) => { client.usersToReactTo = data.map((entry) => {
const [userId, emoji] = entry.split(":"); const [userId, emoji] = entry.split(":");
return { userId, emoji }; return { userId, emoji };
}); });
@ -46,12 +47,14 @@ client.once(Events.ClientReady, async (readyClient) => {
client.on(Events.MessageCreate, async (message) => { client.on(Events.MessageCreate, async (message) => {
if (message.author.bot) return; if (message.author.bot) return;
console.log(message.mentions.users);
userstoreact.forEach(async (usr) => { client.usersToReactTo.forEach(async (item) => {
if (message.mentions.users.find((u) => u.id == usr.userId)) { if (
message.mentions.users.find((u) => u.id == item.userId) &&
!message.reference
) {
try { try {
await message.react(usr.emoji); await message.react(item.emoji);
} catch (err) { } catch (err) {
console.error("Failed to react to message:", err); console.error("Failed to react to message:", err);
} }
@ -67,7 +70,7 @@ client.on(Events.MessageCreate, async (message) => {
if (!cmd) return; if (!cmd) return;
cmd.run(client, message, args); await cmd.run(client, message, args);
}); });
// Log in to Discord with your client's token // Log in to Discord with your client's token