Skip to content

Commit

Permalink
add message rate limitiing
Browse files Browse the repository at this point in the history
  • Loading branch information
dispherical committed Jun 21, 2024
1 parent 3a4bb1c commit e5d5b7c
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions interactions/message.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ module.exports = ({ app, client }) => {
token: process.env.SLACK_USER_TOKEN,
});
if (utils.blockedChannels.includes(message.channel)) return;

if (await client.exists(`${process.env.INSTANCE_ID || "production"}.newChannelMessage`) || Date.now() < client.get(`${process.env.INSTANCE_ID || "production"}.newChannelMessage`))
if (
(await client.exists(
`${process.env.INSTANCE_ID || "production"}.messageText`,
Expand Down Expand Up @@ -113,7 +113,7 @@ module.exports = ({ app, client }) => {
});
}, 1000);
} catch (e) {}
client.set(
await client.set(
`${process.env.INSTANCE_ID || "production"}.newChannelMessage`,
Date.now() + 1300,
);
Expand Down

0 comments on commit e5d5b7c

Please sign in to comment.