mirror of
https://github.com/litruv/DAdmin.git
synced 2026-07-26 03:36:13 +10:00
DM Fix
This commit is contained in:
37
index.js
37
index.js
@@ -92,22 +92,29 @@ client.on("message", (msg) => {
|
||||
})
|
||||
|
||||
function onMessage(msg, again = true) {
|
||||
if (client.cachedserversettings.filter(function (server) {
|
||||
return server.guildID == msg.guild.id
|
||||
}).length == 0)
|
||||
client.database.get_setting("prefix", msg.guild.id).then(prefix => {
|
||||
client.cachedserversettings.push(new cachedsettings(msg.guild.id, prefix))
|
||||
doCommand(msg, prefix)
|
||||
}).catch(err => {
|
||||
if (again == true) {
|
||||
client.database.set_setting(msg.guild.id, "prefix", "~")
|
||||
onMessage(msg, false)
|
||||
}
|
||||
})
|
||||
else
|
||||
doCommand(msg, client.cachedserversettings.filter(function (server) {
|
||||
if (msg.channel.type = "dm") {
|
||||
doCommand(msg, "")
|
||||
}
|
||||
else {
|
||||
|
||||
if (client.cachedserversettings.filter(function (server) {
|
||||
return server.guildID == msg.guild.id
|
||||
})[0].getPrefix())
|
||||
}).length == 0)
|
||||
client.database.get_setting("prefix", msg.guild.id).then(prefix => {
|
||||
client.cachedserversettings.push(new cachedsettings(msg.guild.id, prefix))
|
||||
doCommand(msg, prefix)
|
||||
}).catch(err => {
|
||||
if (again == true) {
|
||||
client.database.set_setting(msg.guild.id, "prefix", "~")
|
||||
onMessage(msg, false)
|
||||
}
|
||||
})
|
||||
else
|
||||
doCommand(msg, client.cachedserversettings.filter(function (server) {
|
||||
return server.guildID == msg.guild.id
|
||||
})[0].getPrefix())
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
function doCommand(msg, prefix) {
|
||||
|
||||
Reference in New Issue
Block a user