-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'main' of https://github.com/Fernando-Santana-j/SDKApps
- Loading branch information
Showing
18 changed files
with
713 additions
and
187 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,46 @@ | ||
// let functions = require('../../../functions') | ||
// const Discord = require("discord.js"); | ||
// let db = require('../../../Firebase/models'); | ||
// const { SlashCommandBuilder } = require('discord.js'); | ||
|
||
// module.exports = { | ||
// data: new SlashCommandBuilder() | ||
// .setName('blockChannel') | ||
// .setDescription('Configurar o bot de vendas!'), | ||
// async execute(interaction,client) { | ||
// let verifyPermissions = await functions.verifyPermissions(interaction.user.id, interaction.guildId, null, client) | ||
// if (verifyPermissions.error == false && verifyPermissions.perms.commands == true) { | ||
// let serverData = await db.findOne({ colecao: `servers`, doc: await interaction.guildId }) | ||
// if (serverData.botActive == false) { | ||
// await interaction.reply({ | ||
// content: `⚠️| O vendedor desativou o bot desse servidor!`, | ||
// ephemeral: true | ||
// }) | ||
// return | ||
// } | ||
|
||
// interaction.reply({ | ||
// embeds: [ | ||
// new Discord.EmbedBuilder() | ||
// .setColor("#6E58C7") | ||
// .setTitle(`Configure o bot atraves da nossa plataforma acessando o link abaixo!`) | ||
// ], | ||
// components: [ | ||
// new Discord.ActionRowBuilder() | ||
// .addComponents( | ||
// new Discord.ButtonBuilder() | ||
// .setStyle(5) | ||
// .setLabel('Ir para a plataforma') | ||
// .setEmoji(await require('../../emojisGet').redirect) | ||
// .setURL(`https://skapps.com.br/server/${interaction.guildId}`) | ||
// ) | ||
// ], | ||
// ephemeral: true | ||
// }) | ||
// } else { | ||
// interaction.reply('Você não tem permissão para enviar comandos') | ||
// } | ||
// } | ||
// }; | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,55 @@ | ||
let functions = require('../../../functions') | ||
const Discord = require("discord.js"); | ||
let db = require('../../../Firebase/models'); | ||
const { SlashCommandBuilder } = require('discord.js'); | ||
|
||
module.exports = { | ||
data: new SlashCommandBuilder() | ||
.setName('clear') | ||
.setDescription('Apaga as ultimas mensagens enviadas!') | ||
.addIntegerOption(option => | ||
option.setName('quantidade') | ||
.setDescription("Numero de mensagem a serem apagadas!") | ||
.setRequired(true) | ||
.setMinValue(1) | ||
), | ||
async execute(interaction, client) { | ||
let verifyPermissions = await functions.verifyPermissions(interaction.user.id, interaction.guildId, null, client) | ||
let amount = await interaction.options.getInteger(`quantidade`) | ||
if (verifyPermissions.error == false && verifyPermissions.perms.commands == true) { | ||
let serverData = await db.findOne({ colecao: `servers`, doc: await interaction.guildId }) | ||
if (serverData.botActive == false) { | ||
await interaction.reply({ | ||
content: `⚠️| O vendedor desativou o bot desse servidor!`, | ||
ephemeral: true | ||
}) | ||
return | ||
} | ||
|
||
let remaining = amount; // Mensagens restantes para apagar | ||
let deletedTotal = 0; // Contador de mensagens apagadas | ||
interaction.deferReply(); | ||
try { | ||
while (remaining > 0) { | ||
const deleteCount = Math.min(remaining, 100); // Até 100 mensagens por vez | ||
const deleted = await interaction.channel.bulkDelete(deleteCount, true); | ||
deletedTotal += deleted.size; | ||
remaining -= deleted.size; | ||
|
||
if (deleted.size < deleteCount) break; // Nenhuma mensagem restante | ||
} | ||
|
||
await interaction.editReply( | ||
`Foram apagadas ${deletedTotal} mensagem(ns) no total!` | ||
); | ||
} catch (error) { | ||
console.error(error); | ||
await interaction.editReply('Ocorreu um erro ao tentar apagar mensagens.'); | ||
} | ||
} else { | ||
interaction.reply('Você não tem permissão para enviar comandos') | ||
} | ||
} | ||
}; | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.