Skip to content

Commit

Permalink
fix DMs - message.js
Browse files Browse the repository at this point in the history
  • Loading branch information
Crenshaw committed Mar 19, 2021
1 parent 949992b commit 4a4f357
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions events/message.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,11 @@ exports.run = async (client, message) => {
if (message.content == (clientMention)) return await client.commands.get("help").run(client, message, args);

// prefix
let prefix = await database.get(`${message.guild.id}.prefix`)
let prefix;
if (message.guild) prefix = await database.get(`${message.guild.id}.prefix`);
if (!prefix) {
prefix = client.config.prefix
await database.set(`${message.guild.id}.prefix`, client.config.prefix);
if (message.guild) await database.set(`${message.guild.id}.prefix`, client.config.prefix);
}
client.prefix = prefix;
if (message.content.startsWith(clientMention)) prefix = clientMention;
Expand All @@ -24,7 +25,7 @@ exports.run = async (client, message) => {
const cmd = args.shift().toLowerCase();

// Jelly bean data :3
client.jellybean = await database.get(`${message.guild.id}.jellybeandata`);
if (message.guild) client.jellybean = await database.get(`${message.guild.id}.jellybeandata`);


// does the command exsist?
Expand Down

0 comments on commit 4a4f357

Please sign in to comment.