Skip to content
This repository has been archived by the owner on Jun 3, 2023. It is now read-only.

adjust command throttling/cooldown #13

Merged
merged 3 commits into from
May 16, 2022
Merged
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
4 changes: 2 additions & 2 deletions src/commands/dayz/leaderboard.js
Original file line number Diff line number Diff line change
Expand Up @@ -64,8 +64,8 @@ module.exports = {
// Setting a cooldown to avoid abuse
// Allowed 2 times every 10 seconds per user
cooldown: {
usages: 2,
duration: 10
usages: 7,
duration: 60
}
},

Expand Down
2 changes: 1 addition & 1 deletion src/listeners/interaction/applicationCommandInteraction.js
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ module.exports = (client, interaction) => {
// Throttle the command
// permLevel 4 = Developer
if (member.permLevel < 4) {
const onCooldown = throttleCommand(clientCmd, `${guild.id}${member.id}`);
const onCooldown = throttleCommand(clientCmd, `${guild.id}`);
if (onCooldown !== false) {
interaction.reply({
content: onCooldown.replace('{{user}}', `${member}`)
Expand Down
1 change: 0 additions & 1 deletion src/modules/cftClient.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@ const {

// export our CFTools client as unnamed default
module.exports = new cftSDK.CFToolsClientBuilder()
.withCache()
.withServerApiId(CFTOOLS_SERVER_API_ID)
.withCredentials(CFTOOLS_API_APPLICATION_ID, CFTOOLS_API_SECRET)
.build();