Skip to content

Commit

Permalink
a
Browse files Browse the repository at this point in the history
  • Loading branch information
eYuM-coder committed Oct 9, 2024
1 parent d03720e commit d938447
Show file tree
Hide file tree
Showing 5 changed files with 200 additions and 9 deletions.
13 changes: 13 additions & 0 deletions .vscode/tasks.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
{
"version": "2.0.0",
"tasks": [
{
"type": "npm",
"script": "install",
"group": "clean",
"problemMatcher": [],
"label": "npm: install",
"detail": "install dependencies from package"
}
]
}
152 changes: 143 additions & 9 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@
"common-tags": "^1.8.0",
"connect-mongo": "^4.4.1",
"convert-svg-to-png": "^0.6.4",
"crc": "^4.3.2",
"crypto": "^1.0.1",
"datadog-metrics": "^0.8.2",
"date-and-time": "^0.14.2",
Expand Down
39 changes: 39 additions & 0 deletions src/commands/fun/ship.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
const Command = require("../../structures/Command");
const { MessageEmbed, Message } = require("discord.js");
const crc32 = require("crc").crc32;
module.exports = class extends Command {
constructor(...args) {
super(...args, {
name: "ship",
description: "Ships two users together and calculates compatibility",
category: "Fun",
cooldown: 15,
})
}

async run(message) {
const mentions = message.mentions.members;

if (mentions.length < 2) {
return message.channel.send('Please provide two names to ship! Example: !ship Alice Bob');
}

const users = Array.from(mentions.values()).slice(0, 2);

const combinedNames = users[0].username + users[1].username;

const hash = crc32(combinedNames);

const shipPercentage = Math.abs(hash % 101);

const shipName = users[0].username.slice(0, Math.ceil(users[0].username.length / 2)) + users[1].username.slice(Math.floor(users[1].username.length / 2));

message.channel.send({
content: `:heartpulse: MATCHMAKING :heartpulse:\n:small_red_triangle_down: *\`${users[0].username}\`*\n:small_red_triangle_up: *\`${users[1].username}\`*`,
embeds: [
new MessageEmbed()
.setDescription(`${users[0].username}`)
]
})
}
}
4 changes: 4 additions & 0 deletions src/commands/moderation/clear.js
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,10 @@ module.exports = class extends Command {
reason = reason.slice(0, 1021) + "...";
}

if (logging.moderation.delete_after_executed === "true") {
message.delete().catch(() => { });
}

let messages;
messages = amount;

Expand Down

0 comments on commit d938447

Please sign in to comment.