debug
This commit is contained in:
6 files changed
+23
-24
No files matched your search
@@ -1,7 +1,7 @@
|
|||||||
const { MessageEmbed } = require('discord.js');
|
const { MessageEmbed } = require('discord.js');
|
||||||
|
|
||||||
module.exports = {
|
module.exports = {
|
||||||
name: "connectAccount",
|
name: "connect_account",
|
||||||
description: "Connect your Discord Account to the Lines Police CAD Database",
|
description: "Connect your Discord Account to the Lines Police CAD Database",
|
||||||
usage: "",
|
usage: "",
|
||||||
permissions: {
|
permissions: {
|
||||||
@@ -1,7 +1,7 @@
|
|||||||
const { MessageEmbed } = require('discord.js');
|
const { MessageEmbed } = require('discord.js');
|
||||||
|
|
||||||
module.exports = {
|
module.exports = {
|
||||||
name: "logout",
|
name: "disconnect_account",
|
||||||
description: "Disconnect your Discord account from the Lines Police CAD Database",
|
description: "Disconnect your Discord account from the Lines Police CAD Database",
|
||||||
usage: "",
|
usage: "",
|
||||||
permissions: {
|
permissions: {
|
||||||
@@ -8,7 +8,6 @@ module.exports = {
|
|||||||
channel: ["VIEW_CHANNEL", "SEND_MESSAGES", "EMBED_LINKS"],
|
channel: ["VIEW_CHANNEL", "SEND_MESSAGES", "EMBED_LINKS"],
|
||||||
member: [],
|
member: [],
|
||||||
},
|
},
|
||||||
aliases: [],
|
|
||||||
SlashCommand: {
|
SlashCommand: {
|
||||||
options: [],
|
options: [],
|
||||||
/**
|
/**
|
||||||
|
|||||||
+1
-1
@@ -21,4 +21,4 @@ module.exports = {
|
|||||||
name: "Grand Theft Auto V", // The message shown
|
name: "Grand Theft Auto V", // The message shown
|
||||||
type: "PLAYING", // PLAYING, WATCHING, LISTENING, STREAMING
|
type: "PLAYING", // PLAYING, WATCHING, LISTENING, STREAMING
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
@@ -28,39 +28,38 @@ class LinesPoliceCadBot extends Client {
|
|||||||
this.Ready = false;
|
this.Ready = false;
|
||||||
|
|
||||||
this.ws.on("INTERACTION_CREATE", async (interaction) => {
|
this.ws.on("INTERACTION_CREATE", async (interaction) => {
|
||||||
client.log("Interaction")
|
|
||||||
let GuildDB = await this.GetGuild(interaction.guild_id);
|
let GuildDB = await this.GetGuild(interaction.guild_id);
|
||||||
|
|
||||||
if (interaction.type==3) return;
|
if (interaction.type==3) return;
|
||||||
|
|
||||||
|
|
||||||
const command = interaction.data.name.toLowerCase();
|
const command = interaction.data.name.toLowerCase();
|
||||||
const args = interaction.data.options;
|
const args = interaction.data.options;
|
||||||
|
|
||||||
//Easy to send respnose so ;)
|
//Easy to send respnose so ;)
|
||||||
interaction.guild = await this.guilds.fetch(interaction.guild_id);
|
interaction.guild = await this.guilds.fetch(interaction.guild_id);
|
||||||
interaction.send = async (message) => {
|
interaction.send = async (message) => {
|
||||||
return await this.api
|
return await this.api
|
||||||
.interactions(interaction.id, interaction.token)
|
.interactions(interaction.id, interaction.token)
|
||||||
.callback.post({
|
.callback.post({
|
||||||
data: {
|
data: {
|
||||||
type: 4,
|
type: 4,
|
||||||
data:
|
data:
|
||||||
typeof message == "string"
|
typeof message == "string"
|
||||||
? { content: message }
|
? { content: message }
|
||||||
: message.type && message.type === "rich"
|
: message.type && message.type === "rich"
|
||||||
? { embeds: [message] }
|
? { embeds: [message] }
|
||||||
: message,
|
: message,
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
};
|
};
|
||||||
let cmd = client.commands.get(command);
|
let cmd = client.commands.get(command);
|
||||||
|
client.log("Interaction - "+cmd.name);
|
||||||
if (cmd.SlashCommand && cmd.SlashCommand.run)
|
if (cmd.SlashCommand && cmd.SlashCommand.run)
|
||||||
cmd.SlashCommand.run(this, interaction, args, { GuildDB });
|
cmd.SlashCommand.run(this, interaction, args, { GuildDB });
|
||||||
});
|
});
|
||||||
|
|
||||||
const client = this;
|
const client = this;
|
||||||
}
|
}
|
||||||
|
|
||||||
async connectMongo(mongoURI, dbo) {
|
async connectMongo(mongoURI, dbo) {
|
||||||
this.db = await MongoClient.connect(mongoURI,{useUnifiedTopology:true});
|
this.db = await MongoClient.connect(mongoURI,{useUnifiedTopology:true});
|
||||||
|
|||||||
@@ -29,6 +29,7 @@ module.exports = (client, guild) => {
|
|||||||
await GuildAPI.commands.post({ data: dataStuff });
|
await GuildAPI.commands.post({ data: dataStuff });
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
client.log('Error: API missing permissions');
|
client.log('Error: API missing permissions');
|
||||||
|
console.log(e)
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|||||||
Reference in new issue
Block a user