aboutsummaryrefslogtreecommitdiff
path: root/common.js
diff options
context:
space:
mode:
authorElias Fleckenstein <eliasfleckenstein@web.de>2022-03-06 13:48:10 +0100
committerElias Fleckenstein <eliasfleckenstein@web.de>2022-03-06 13:48:10 +0100
commit34d0cf9d14647c088a2683153b92c7d72bb21614 (patch)
treee9e4b43166a64bdcf7a6109b666cb545d84491c7 /common.js
parent766e86b48346b2a91ac99ad17ad7a52595f7e6b2 (diff)
downloadfurrybot-discord-34d0cf9d14647c088a2683153b92c7d72bb21614.tar.xz
Implement NSFW
Diffstat (limited to 'common.js')
-rw-r--r--common.js16
1 files changed, 9 insertions, 7 deletions
diff --git a/common.js b/common.js
index 46fe05a..d06566d 100644
--- a/common.js
+++ b/common.js
@@ -9,7 +9,7 @@ const getPing = module.exports.getPing = (msg, ping, allowSelf) => {
msg.reply("Please mention a user other than yourself")
return
}
-
+
if (msg.guild.members.cache.get(id))
return id
}
@@ -19,24 +19,27 @@ const getPing = module.exports.getPing = (msg, ping, allowSelf) => {
module.exports.uppercase = str => str.slice(0, 1).toUpperCase() + str.slice(1)
-module.exports.requestCommand = (help, onRequest, onAccept) => new Object({
+module.exports.requestCommand = (help, info, onRequest, onAccept) => new Object({
params: "<player>",
- help: "Request to " + help + " another user",
+ help: "Request to " + help,
func: (msg, [targetPing], {requests}) => {
const target = getPing(msg, targetPing, false)
if (target) {
const err = onRequest(msg, target)
- if (err)
+ if (err) {
msg.reply(err)
- else
+ } else {
+ msg.channel.send(`<@!${target}>: <@!${msg.author.id}> ${info}. Type !accept to accept or !deny to deny.`)
+
requests[target] = {
origin: msg.author.id,
func: onAccept,
}
+ }
}
-
+
}
})
@@ -103,4 +106,3 @@ module.exports.listChangeCommand = (action, list, status) => new Object({
})
module.exports.stripPings = str => str.replace(/@/g, "\@")
-