Skip to content

Commit

Permalink
Merge pull request #8 from rakshithx09/main
Browse files Browse the repository at this point in the history
fixed #2
  • Loading branch information
NidheeshaT authored Oct 30, 2023
2 parents 593eaf2 + 0cef73b commit 57ff8ff
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 3 deletions.
1 change: 0 additions & 1 deletion .env.example
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
ANONUMOUS_CHANNEL=<ID of the channel where the bot will send the anonymous messages>
MOD_CHANNEL=<ID of the channel where the bot will send the messages to be mods>
ROLE_NAME=<Role name to be excluded from being deleted & resent by the bot [usually mods]>
DISCORD_TOKEN=<Discord bot token>
4 changes: 2 additions & 2 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import { Client, GatewayIntentBits, Events, Partials } from "discord.js";
import getAvatar from "./avatar.js";

const anonymousChannel = process.env.ANONUMOUS_CHANNEL;
const roleName = process.env.ROLE_NAME;
const roleName= "stealth-admin";
const modChannel = process.env.MOD_CHANNEL;
const token = process.env.DISCORD_TOKEN;
if (!anonymousChannel || !token) {
Expand Down Expand Up @@ -37,7 +37,7 @@ client.on(Events.MessageCreate, async (message) => {
}

if (channel.id !== anonymousChannel) return;
if (roleName && message.member.roles.cache.some((role) => role.name === roleName)) return; // admin can't send anonymous messages
if (message.member.roles.cache.some((role) => role.name === roleName)) return; // admin can't send anonymous messages
await channelMessage(channel, message, messageStamp);
});

Expand Down

0 comments on commit 57ff8ff

Please sign in to comment.