Skip to content

Commit

Permalink
index file color & prefix
Browse files Browse the repository at this point in the history
  • Loading branch information
alepouna committed Jul 26, 2024
1 parent 67836fb commit 154a3e7
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 4 deletions.
2 changes: 2 additions & 0 deletions src/constants.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
export const Prefix = '.'

export enum Colors {
DFD_ORANGE = 0xF1BE4E,
DFD_DARK_PINK = 0x9B2358,
Expand Down
7 changes: 3 additions & 4 deletions src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ import { commands } from './commands';
import { createEmbed } from './lib/embed';
import logs from './logging';
import utils from './utils';
import { Colors, Prefix } from './constants';

dotenv.config();

Expand All @@ -15,8 +16,6 @@ const client = new Client({
}),
});

const prefix = '.';

client.on('ready', (client) => {
console.log(`Bot is logged in as "${client.user.tag}"!`);
});
Expand All @@ -32,7 +31,7 @@ client.on('messageCreate', async (message) => {
if (message.author.bot) return;

const isDm = message.channel.type === Discord.ChannelType.DM;
const isCommand = message.content.startsWith(prefix);
const isCommand = message.content.startsWith(Prefix);

// log all DMs which are sent to the bot
if (isDm) {
Expand Down Expand Up @@ -83,7 +82,7 @@ client.on('messageCreate', async (message) => {
.send({
embeds: [
new Discord.EmbedBuilder()
.setColor(0xff0000)
.setColor(Colors.ERROR)
.setTitle('Error')
.setDescription('You do not have the required permissions to use that command'),
],
Expand Down

0 comments on commit 154a3e7

Please sign in to comment.