feature/fix disableBaseDamage command + move to /server command
This commit is contained in:
6 files changed
+217
-140
No files matched your search
+18
-3
@@ -77,12 +77,12 @@ class DayzRBot extends Client {
|
||||
|
||||
this.log(`Interaction - ${command}`);
|
||||
|
||||
this.rest = new REST({ version: '10' }).setToken(this.config.Token);
|
||||
|
||||
// Easy to send response so ;)
|
||||
interaction.guild = await this.guilds.fetch(interaction.guild_id);
|
||||
interaction.send = async (message) => {
|
||||
const rest = new REST({ version: '10' }).setToken(this.config.Token);
|
||||
|
||||
return await rest.post(Routes.interactionCallback(interaction.id, interaction.token), {
|
||||
return await this.rest.post(Routes.interactionCallback(interaction.id, interaction.token), {
|
||||
body: {
|
||||
type: 4,
|
||||
data: message,
|
||||
@@ -90,6 +90,21 @@ class DayzRBot extends Client {
|
||||
});
|
||||
};
|
||||
|
||||
interaction.deferReply = async (message) => {
|
||||
return await this.rest.post(Routes.interactionCallback(interaction.id, interaction.token), {
|
||||
body: {
|
||||
type: 5,
|
||||
data: message,
|
||||
}
|
||||
});
|
||||
};
|
||||
|
||||
interaction.editReply = async (message) => {
|
||||
return await this.rest.patch(Routes.webhookMessage(this.application.id, interaction.token), {
|
||||
body: message,
|
||||
});
|
||||
};
|
||||
|
||||
if (!this.databaseConnected) {
|
||||
let dbFailedEmbed = new EmbedBuilder()
|
||||
.setDescription(`**Internal Error:**\nUh Oh D: Its not you, its me.\nThe bot has failed to connect to the database 5 times!\nContact the Developers\nhttps://discord.gg/YCXhvy9uZw`)
|
||||
|
||||
Reference in new issue
Block a user