Skip to content
This repository has been archived by the owner on Jul 29, 2023. It is now read-only.

Commit

Permalink
Awesome async/await function
Browse files Browse the repository at this point in the history
  • Loading branch information
NCT-skyouo authored Nov 21, 2020
1 parent 51af92f commit 2dcfb03
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions events/message.js
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
module.exports = (bot, msg) => {
let gdb = bot.db.get(msg.guild.id)
module.exports = async (bot, msg) => {
let gdb = await bot.db.get(msg.guild.id)
if (!gdb) {
bot.db.set(msg.guild.id, bot.config.defaultconfig)
await bot.db.set(msg.guild.id, bot.config.defaultconfig)
gdb = bot.config.defaultconfig
}
const preset = bot.db.get(msg.guild.id).prefix || bot.config.defaultconfig.prefix
const preset = gdb.prefix || bot.config.defaultconfig.prefix
msg.guild.prefix = preset.value || bot.config.prefix
const prefix = msg.guild.prefix || bot.config.prefix

Expand Down

0 comments on commit 2dcfb03

Please sign in to comment.