unban command discord.js v12
if(command === "unban"){
if(!msg.member.hasPermission("BAN_MEMBERS")) {
return msg.channel.send(`**${msg.author.username}**, You do not have perms to unban someone`)
}
if(!msg.guild.me.hasPermission("BAN_MEMBERS")) {
return msg.channel.send(`**${msg.author.username}**, I do not have perms to unban someone`)
}
let userID = args[0]
msg.guild.fetchBans().then(bans=> {
if(bans.size == 0) return
let bUser = bans.find(b => b.user.id == userID)
if(!bUser) return
msg.guild.members.unban(bUser.user)
})
;}
Also in JavaScript:
- kendo grid add line javascript
- edit html element javascript
- puppeteer js onblur
- parsing through json without using key value python
- javascript on url anchor change event
- pagination.js
- python run javascript
- run javascript when typing
- check if date is today js
- require("history").createBrowserHistory` instead of `require("history/createBrowserHistory")`
- simple javascript code
- not equal to sign in js
- jquery parsexml get attribute
- create functional component react
- javascript json to array
- use bootstrap in react
- jquery dialog button text set by variable
- regular expression arabic and persion
- angular interview questions
- dropdown option selection change event in jquery
- moment duratuion from hours
- redirect to homepage javascript
- swagger editor
- javascript int values