Skip to content

Commit

Permalink
new setting + modify bot ignoring code
Browse files Browse the repository at this point in the history
  • Loading branch information
DEVTomatoCake committed Oct 8, 2023
1 parent a2d8cd7 commit 00161dd
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 1 deletion.
14 changes: 14 additions & 0 deletions modules/sticky-messages/configs/sticky-messages.json
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,20 @@
},
"type": "string",
"allowEmbed": true
},{
"name": "respondBots",
"humanName": {
"en": "Respond to bots",
"de": "Antworten auf Bots"
},
"default": {
"en": false
},
"description": {
"en": "Whether your bot reacts to messages from other bots in the channel",
"de": "Ob dein Bot auf Nachrichten von anderen Bots in dem Kanal reagiert"
},
"type": "boolean"
}
]
}
3 changes: 2 additions & 1 deletion modules/sticky-messages/events/messageCreate.js
Original file line number Diff line number Diff line change
Expand Up @@ -43,13 +43,14 @@ module.exports.run = async (client, msg) => {
if (!msg.guild) return;
if (msg.guild.id !== client.guildID) return;
if (!msg.member) return;
if (msg.author.bot) return;
if (msg.author.id === client.user.id) return;

const stickyChannels = client.configurations['sticky-messages']['sticky-messages'];
if (!stickyChannels) return;

const currentConfig = stickyChannels.find(c => c.channelId === msg.channel.id);
if (!currentConfig || !currentConfig.message) return;
if (!currentConfig.respondBots && msg.author.bot) return;

if (channelData[msg.channel.id]) {
if (channelData[msg.channel.id].time + 5000 > Date.now()) {
Expand Down

0 comments on commit 00161dd

Please sign in to comment.