debug last commit?
This commit is contained in:
3 files changed
+37
-36
No files matched your search
+34
-33
@@ -332,48 +332,49 @@ module.exports = {
|
||||
|
||||
} else if (args[0].name == 'bot_admin_role') {
|
||||
|
||||
if (args[0].options[0].value == 'add') {
|
||||
const roleId = args[0].options[1].value;
|
||||
if (args[0].options[0].value == 'add') {
|
||||
|
||||
client.dbo.collection("guilds").updateOne({"server.serverID":GuildDB.serverID},{$push: {"server.botAdminRoles": roleId}}, function(err, res) {
|
||||
if (err) return client.sendInternalError(interaction, err);
|
||||
});
|
||||
const roleId = args[0].options[1].value;
|
||||
|
||||
const successEmbed = new EmbedBuilder()
|
||||
.setDescription(`Successfully added <@&${roleId}> as a bot admin role.\nUsers with this role can use restricted commands.`)
|
||||
.setColor(client.config.Colors.Green);
|
||||
client.dbo.collection("guilds").updateOne({"server.serverID":GuildDB.serverID},{$push: {"server.botAdminRoles": roleId}}, function(err, res) {
|
||||
if (err) return client.sendInternalError(interaction, err);
|
||||
});
|
||||
|
||||
return interaction.send({ embeds: [successEmbed] });
|
||||
const successEmbed = new EmbedBuilder()
|
||||
.setDescription(`Successfully added <@&${roleId}> as a bot admin role.\nUsers with this role can use restricted commands.`)
|
||||
.setColor(client.config.Colors.Green);
|
||||
|
||||
} else if (args[0].options[0].value== 'remove') {
|
||||
return interaction.send({ embeds: [successEmbed] });
|
||||
|
||||
if (!GuildDB.botADminRoles.includes(args[0].options[1].value)) {
|
||||
const noRole = new EmbedBuilder()
|
||||
.setColor(client.config.Colors.Yellow)
|
||||
.setDescription(`**Notice:**\n> The role <@&${args[0].options[1].value}> has not been configured as a bot admin.`);
|
||||
} else if (args[0].options[0].value== 'remove') {
|
||||
|
||||
return interaction.send({ embeds: [noRole] });
|
||||
}
|
||||
if (!GuildDB.botADminRoles.includes(args[0].options[1].value)) {
|
||||
const noRole = new EmbedBuilder()
|
||||
.setColor(client.config.Colors.Yellow)
|
||||
.setDescription(`**Notice:**\n> The role <@&${args[0].options[1].value}> has not been configured as a bot admin.`);
|
||||
|
||||
const prompt = new EmbedBuilder()
|
||||
.setTitle(`Are you sure you want to remove this role as a bot admin?`)
|
||||
.setColor(client.config.Colors.Default)
|
||||
|
||||
const opt = new ActionRowBuilder()
|
||||
.addComponents(
|
||||
new ButtonBuilder()
|
||||
.setCustomId(`RemoveBotAdminRole-yes-${args[0].options[1].value}-${interaction.member.user.id}`)
|
||||
.setLabel("Yes")
|
||||
.setStyle(ButtonStyle.Danger),
|
||||
new ButtonBuilder()
|
||||
.setCustomId(`RemoveBotAdminRole-no-${args[0].options[1].value}-${interaction.member.user.id}`)
|
||||
.setLabel("No")
|
||||
.setStyle(ButtonStyle.Success)
|
||||
)
|
||||
|
||||
return interaction.send({ embeds: [prompt], components: [opt], flags: (1 << 6) });
|
||||
return interaction.send({ embeds: [noRole] });
|
||||
}
|
||||
|
||||
const prompt = new EmbedBuilder()
|
||||
.setTitle(`Are you sure you want to remove this role as a bot admin?`)
|
||||
.setColor(client.config.Colors.Default)
|
||||
|
||||
const opt = new ActionRowBuilder()
|
||||
.addComponents(
|
||||
new ButtonBuilder()
|
||||
.setCustomId(`RemoveBotAdminRole-yes-${args[0].options[1].value}-${interaction.member.user.id}`)
|
||||
.setLabel("Yes")
|
||||
.setStyle(ButtonStyle.Danger),
|
||||
new ButtonBuilder()
|
||||
.setCustomId(`RemoveBotAdminRole-no-${args[0].options[1].value}-${interaction.member.user.id}`)
|
||||
.setLabel("No")
|
||||
.setStyle(ButtonStyle.Success)
|
||||
)
|
||||
|
||||
return interaction.send({ embeds: [prompt], components: [opt], flags: (1 << 6) });
|
||||
}
|
||||
|
||||
} else if (args[0].name == 'admin_role') {
|
||||
client.dbo.collection("guilds").updateOne({"server.serverID":GuildDB.serverID},{$set: {"server.adminRole": args[0].options[0].value}}, function(err, res) {
|
||||
if (err) return client.sendInternalError(interaction, err);
|
||||
|
||||
+1
-1
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "dayz-armbands",
|
||||
"version": "6.0.0",
|
||||
"version": "6.0.1",
|
||||
"description": "A General Purpose Discord Bot for DayZ Servers.",
|
||||
"main": "index.js",
|
||||
"nodemonConfig": {
|
||||
|
||||
@@ -166,9 +166,9 @@ class DayzArmbands extends Client {
|
||||
if (this.config.Dev != 'PROD.') console.log('---- tick ----');
|
||||
this.activePlayersTick++;
|
||||
|
||||
await DownloadNitradoFile(`/games/${this.config.Nitrado.UserID}/noftp/dayzxb/config/DayZServer_X1_x64.ADM`, './logs/server-logs.ADM').then(async () => {
|
||||
await DownloadNitradoFile(this, `/games/${this.config.Nitrado.UserID}/noftp/dayzxb/config/DayZServer_X1_x64.ADM`, './logs/server-logs.ADM').then(async () => {
|
||||
await this.readLogs(this.config.GuildID).then(async () => {
|
||||
if (this.activePlayersTick == 12) await HandleActivePlayersList(this.config.GuildID);
|
||||
if (this.activePlayersTick == 12) await HandleActivePlayersList(this, this.config.GuildID);
|
||||
})
|
||||
});
|
||||
this.logsUpdateTimer(); // restart this function
|
||||
|
||||
Reference in new issue
Block a user