Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
"pg": "^8.13.3",
"play-dl": "^1.9.7",
"prism-media": "^1.3.5",
"systeminfo": "^0.0.1",
"systeminformation": "5.25.11",
"ytdl-core": "^4.11.5"
},
"scripts": {
Expand Down
2 changes: 1 addition & 1 deletion src/commands/Misc/ping.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ export const execute = async (message: Message): Promise<void> => {

const sentMessage = await message.reply({ embeds: [embed] });

await new Promise((res) => setTimeout(res, 3000));
await new Promise((res) => setTimeout(res, 1000));

const latency = sentMessage.createdTimestamp - message.createdTimestamp;
const apiLatency = message.client.ws.ping;
Expand Down
3 changes: 2 additions & 1 deletion src/commands/Misc/userinfo.ts
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,8 @@ export const execute = async (
}
)
.setColor("Random")
.setTimestamp();
.setTimestamp()
.setFooter({ text: `Requested by ${message.author.username}` });

await channel.send({ embeds: [embed] });
};
116 changes: 65 additions & 51 deletions src/commands/Moderation/ban.ts
Original file line number Diff line number Diff line change
Expand Up @@ -25,19 +25,23 @@ export const execute = async (
)
.setColor("#5865f2");

await message.reply({ embeds: [help_embed] });
await message
.reply({ embeds: [help_embed] })
.then((msg) => setTimeout(() => msg.delete(), 5000));
return;
}

if (!message.member.permissions.has(PermissionFlagsBits.BanMembers)) {
await message.reply({
embeds: [
new EmbedBuilder()
.setDescription("❌ You don't have permission to ban members.")
.setColor("#FF0000")
.setTimestamp(),
],
});
await message
.reply({
embeds: [
new EmbedBuilder()
.setDescription("❌ You don't have permission to ban members.")
.setColor("#FF0000")
.setTimestamp(),
],
})
.then((msg) => setTimeout(() => msg.delete(), 5000));
return;
}

Expand All @@ -50,56 +54,64 @@ export const execute = async (
try {
target = await message.guild.members.fetch(user_id);
} catch (error) {
await message.reply({
embeds: [
new EmbedBuilder()
.setDescription("❌ User ID not found.")
.setColor("#FF0000")
.setTimestamp(),
],
});
await message
.reply({
embeds: [
new EmbedBuilder()
.setDescription("❌ User ID not found.")
.setColor("#FF0000")
.setTimestamp(),
],
})
.then((msg) => setTimeout(() => msg.delete(), 5000));
return;
}
}
}

if (!target) {
await message.reply({
embeds: [
new EmbedBuilder()
.setDescription("❌ Please mention a user to ban.")
.setColor("#FF0000")
.setTimestamp(),
],
});
await message
.reply({
embeds: [
new EmbedBuilder()
.setDescription("❌ Please mention a user to ban.")
.setColor("#FF0000")
.setTimestamp(),
],
})
.then((msg) => setTimeout(() => msg.delete(), 5000));
return;
}

if (
!message.guild.members.me?.permissions.has(PermissionFlagsBits.BanMembers)
) {
await message.reply({
embeds: [
new EmbedBuilder()
.setDescription("❌ I don't have permission to ban members.")
.setColor("#FF0000")
.setTimestamp(),
],
});
await message
.reply({
embeds: [
new EmbedBuilder()
.setDescription("❌ I don't have permission to ban members.")
.setColor("#FF0000")
.setTimestamp(),
],
})
.then((msg) => setTimeout(() => msg.delete(), 5000));
return;
}

if (!target.bannable) {
await message.reply({
embeds: [
new EmbedBuilder()
.setDescription(
"❌ I can't ban this user. They may have a higher role than me."
)
.setColor("#FF0000")
.setTimestamp(),
],
});
await message
.reply({
embeds: [
new EmbedBuilder()
.setDescription(
"❌ I can't ban this user. They may have a higher role than me."
)
.setColor("#FF0000")
.setTimestamp(),
],
})
.then((msg) => setTimeout(() => msg.delete(), 5000));
return;
}

Expand Down Expand Up @@ -136,13 +148,15 @@ export const execute = async (
});
} catch (error) {
console.error(error);
await message.reply({
embeds: [
new EmbedBuilder()
.setDescription(`❌ Failed to ban ${target.user.tag}.`)
.setColor("#5865f2")
.setTimestamp(),
],
});
await message
.reply({
embeds: [
new EmbedBuilder()
.setDescription(`❌ Failed to ban ${target.user.tag}.`)
.setColor("#5865f2")
.setTimestamp(),
],
})
.then((msg) => setTimeout(() => msg.delete(), 5000));
}
};
14 changes: 7 additions & 7 deletions src/commands/Moderation/kick.ts
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ export const execute = async (
)
.setColor(0x5865f2),
],
});
}).then(msg => setTimeout(() => msg.delete(), 5000));
return;
}

Expand All @@ -37,7 +37,7 @@ export const execute = async (
.setDescription("❌ You don't have permission to kick members.")
.setColor(0xff0000),
],
});
}).then(msg => setTimeout(() => msg.delete(), 5000));
return;
}

Expand All @@ -50,7 +50,7 @@ export const execute = async (
.setDescription("❌ I don't have permission to kick members.")
.setColor(0xff0000),
],
});
}).then(msg => setTimeout(() => msg.delete(), 5000));
return;
}

Expand All @@ -70,7 +70,7 @@ export const execute = async (
.setDescription("❌ User ID not found.")
.setColor(0xff0000),
],
});
}).then(msg => setTimeout(() => msg.delete(), 5000));
return;
}
}
Expand All @@ -83,7 +83,7 @@ export const execute = async (
.setDescription("❌ Please mention a user to kick.")
.setColor(0xff0000),
],
});
}).then(msg => setTimeout(() => msg.delete(), 5000));
return;
}

Expand All @@ -96,7 +96,7 @@ export const execute = async (
)
.setColor(0xff0000),
],
});
}).then(msg => setTimeout(() => msg.delete(), 5000));
return;
}

Expand Down Expand Up @@ -138,6 +138,6 @@ export const execute = async (
.setDescription("❌ Failed to kick the user.")
.setColor(0xff0000),
],
});
}).then(msg => setTimeout(() => msg.delete(), 5000));
}
};
10 changes: 5 additions & 5 deletions src/commands/Moderation/lock.ts
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ export const execute = async (message: Message, args: string[] = []) => {
)
.setColor(0xff0000),
],
});
}).then(msg => setTimeout(() => msg.delete(), 5000));
return;
}

Expand All @@ -44,7 +44,7 @@ export const execute = async (message: Message, args: string[] = []) => {
.setDescription("❌ You don't have permission to manage channels.")
.setColor(0xff0000),
],
});
}).then(msg => setTimeout(() => msg.delete(), 5000));
return;
}

Expand All @@ -57,7 +57,7 @@ export const execute = async (message: Message, args: string[] = []) => {
.setDescription("❌ Please specify a channel to lock.`")
.setColor(0xff0000),
],
});
}).then(msg => setTimeout(() => msg.delete(), 5000));
return;
}

Expand All @@ -71,7 +71,7 @@ export const execute = async (message: Message, args: string[] = []) => {
.setDescription("❌ This channel is already locked.")
.setColor(0xff0000),
],
});
}).then(msg => setTimeout(() => msg.delete(), 5000));
return;
}

Expand All @@ -96,6 +96,6 @@ export const execute = async (message: Message, args: string[] = []) => {
.setDescription("❌ Failed to lock the channel.")
.setColor(0xff0000),
],
});
}).then(msg => setTimeout(() => msg.delete(), 5000));
}
};
18 changes: 9 additions & 9 deletions src/commands/Moderation/mute.ts
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ export const execute = async (
)
.setColor(0x5865f2),
],
});
}).then(msg => setTimeout(() => msg.delete(), 5000));
return;
}

Expand All @@ -66,7 +66,7 @@ export const execute = async (
.setDescription("❌ You don't have permission to mute members.")
.setColor(0xff0000),
],
});
}).then(msg => setTimeout(() => msg.delete(), 5000));
return;
}

Expand All @@ -81,7 +81,7 @@ export const execute = async (
.setDescription("❌ I don't have permission to mute members.")
.setColor(0xff0000),
],
});
}).then(msg => setTimeout(() => msg.delete(), 5000));
return;
}

Expand All @@ -101,7 +101,7 @@ export const execute = async (
.setDescription("❌ User ID not found.")
.setColor(0xff0000),
],
});
}).then(msg => setTimeout(() => msg.delete(), 5000));
return;
}
}
Expand All @@ -114,7 +114,7 @@ export const execute = async (
.setDescription("❌ Please mention a user or provide their ID.")
.setColor(0xff0000),
],
});
}).then(msg => setTimeout(() => msg.delete(), 5000));
return;
}

Expand All @@ -127,7 +127,7 @@ export const execute = async (
)
.setColor(0xff0000),
],
});
}).then(msg => setTimeout(() => msg.delete(), 5000));
return;
}

Expand All @@ -142,7 +142,7 @@ export const execute = async (
)
.setColor(0xff0000),
],
});
}).then(msg => setTimeout(() => msg.delete(), 5000));
return;
}

Expand All @@ -156,7 +156,7 @@ export const execute = async (
)
.setColor(0xff0000),
],
});
}).then(msg => setTimeout(() => msg.delete(), 5000));
return;
}

Expand Down Expand Up @@ -194,6 +194,6 @@ export const execute = async (
.setDescription("❌ Failed to mute the user.")
.setColor(0xff0000),
],
});
}).then(msg => setTimeout(() => msg.delete(), 5000));;
}
};
Loading