Skip to content

Commit

Permalink
response command update
Browse files Browse the repository at this point in the history
  • Loading branch information
Moonded committed Aug 11, 2024
1 parent 32e6e73 commit acb44c2
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 12 deletions.
12 changes: 2 additions & 10 deletions src/commands/funny/respond.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,23 +12,15 @@ export default command(meta, async ({ interaction, client }) => {
const user = interaction.member?.user.username;

async function randomResponse() {
const data = await fetch(
"https://raw.githubusercontent.com/Moonded/responses/main/responses.json"
);

let responses = await data.json();

if (!Array.isArray(responses)) {
responses = localResponses;
}
let responses = localResponses;

return responses[Math.floor(Math.random() * responses.length)];
}

let response = await randomResponse();

while (response.User !== "everyone" && response.User !== user) {
response = randomResponse();
response = await randomResponse();
}

const channel = client.channels.cache.get(
Expand Down
15 changes: 13 additions & 2 deletions src/resources/respond.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
[
{ "Message": "The fuck you want?", "User": "everyone" },
{ "Message": "I am here to serve you, creator", "User": "moonded" },
{
"Message": "I am here to serve you, my creator Moonded.",
"User": "moonded"
},
{ "Message": "I am V", "User": "projectv" },
{ "Message": "the bin in the bin", "User": "everyone" },
{
Expand Down Expand Up @@ -40,5 +43,13 @@
{
"Message": "hello im new here how fix unresolved hash error? useless modders always updating shit without my consent I HAD A REASON TO PIRATE I ALREADY BOUGHT THE GAME this is why the game is DEAD, mod abooz pls demot",
"User": "everyone"
}
},
{
"Message": "In terms of getting people to mod, I'm the world's worst slut",
"User": "everyone"
},
{ "Message": "## LINK HARDER", "User": "everyone" },
{ "Message": "## INTERLINK EVERYTHING", "User": "everyone" },
{ "Message": "_Psst,_ wanna buy some oranges?", "User": "fronkenzeepa" },
{ "Message": "What the dog doing?", "User": "moonded" }
]

0 comments on commit acb44c2

Please sign in to comment.