v2.1.0 push 2
This commit is contained in:
+7
-6
@@ -18,14 +18,14 @@ module.exports = () => {
|
||||
client.on("messageCreate", msg => {
|
||||
if (msg.content.startsWith(config.prefix+"msg")){
|
||||
if (config.main_adminroles.some((item)=>{return msg.member.roles.cache.has(item)}) == false){
|
||||
msg.channel.send({content:"You have no permission to run this command!"})
|
||||
msg.channel.send({embeds:[bot.errorLog.noPermsMessage]})
|
||||
return
|
||||
}
|
||||
|
||||
const id = msg.content.split(config.prefix+"msg")[1].substring(1) ? msg.content.split(config.prefix+"msg")[1].substring(1) : false
|
||||
|
||||
if (!id) return msg.channel.send({content:"**There is no id!**\nUse: `"+config.prefix+"msg <id>`"})
|
||||
if (!msgIds.includes(id)) return msg.channel.send({content:"**Invalid id!**\nChoose from this list:\n_"+msgIds.join("_\n_")+"_"})
|
||||
if (!id) return msg.channel.send({embeds:[bot.errorLog.invalidArgsMessage("Missing Argument `<id>`:\n`"+config.prefix+"msg <id>`")]})
|
||||
if (!msgIds.includes(id)) return msg.channel.send({embeds:[bot.errorLog.invalidIdChooseFromList(msgIds)]})
|
||||
|
||||
|
||||
const {embed,componentRows} = require("../core/ticketMessageEmbed").createEmbed(id)
|
||||
@@ -41,14 +41,15 @@ module.exports = () => {
|
||||
if (!interaction.isCommand()) return
|
||||
if (interaction.commandName != "message") return
|
||||
|
||||
if (config.main_adminroles.some((item)=>{return interaction.guild.members.cache.find((m) => m.id == interaction.member.id).roles.cache.has(item)}) == false){
|
||||
interaction.reply({content:"You have no permission to run this command!"})
|
||||
const permsmember = client.guilds.cache.find(g => g.id == interaction.guild.id).members.cache.find(m => m.id == interaction.member.id)
|
||||
if (config.main_adminroles.some((item)=>{return interaction.guild.members.cache.find((m) => m.id == interaction.member.id).roles.cache.has(item)}) == false && permsmember.permissions.has("ADMINISTRATOR")){
|
||||
interaction.reply({embeds:[bot.errorLog.noPermsMessage]})
|
||||
return
|
||||
}
|
||||
|
||||
const id = interaction.options.getString("id")
|
||||
|
||||
if (!msgIds.includes(id)) return interaction.reply({content:"**Invalid id!**\nChoose from this list:\n_"+msgIds.join("_\n_")+"_"})
|
||||
if (!msgIds.includes(id)) return interaction.reply({embeds:[bot.errorLog.invalidIdChooseFromList(msgIds)]})
|
||||
|
||||
const {embed,componentRows} = require("../core/ticketMessageEmbed").createEmbed(id)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user