Skip to content
Branch: master
Find file Copy path
Find file Copy path
Fetching contributors…
Cannot retrieve contributors at this time
60 lines (54 sloc) 1.91 KB
#! ========================================
#! Kick
handler = (msg, match, Haruka) ->
members = msg.mentions.members
if not members.size
return msg.reply [
"Do you even know how to use this command...?"
"Don’t use such a powerful command if you
don’t know how to use it."
canKickAll = members.every (member) ->
# Override permissions if the executor is an op.
member.kickable or ( in Haruka.config.ops)
if canKickAll
members.tap (member) ->
.then -> [
"Nice, I kicked #{member} successfully."
"Cool, #{member} was kicked."
"Bye bye, #{member}, you've been kicked."
.catch (err) ->
msg.reply [
"Heck, I couldn't do that."
"Something happened."
"Dang, I wasn't able to do that."
].choose() + "\n```#{err}```"
msg.reply [
"You think you can do that? Nice try."
"I refuse to run that command."
"Who do you think you are, a mod?"
module.exports = {
name: "Kick"
regex: /^(kick|eject)(\s+|$)/i
handler: handler
short: "-h kick ::
Kicks mentioned users."
hidden: true
long: """
=== Help for kick ===
*Aliases*: kick, eject
-h kick <user...> :: Kicks all the mentioned users.
-h kick @MindfulMinun @Haruka
Note: Both you and I must be able to kick *all* mentioned users.
This function fails even if only 1 member can't be kicked.
You can’t perform that action at this time.