Update main.js
This commit is contained in:
parent
f09324c7f2
commit
dfa00d7b95
1 changed files with 13 additions and 9 deletions
22
main.js
22
main.js
|
@ -36,27 +36,28 @@ function gotMessage(message){
|
|||
}
|
||||
}
|
||||
|
||||
let msg = message.content.toLowerCase()
|
||||
const msg = message.content.toLowerCase()
|
||||
|
||||
let content = message.content.trim()
|
||||
const content = message.content.trim()
|
||||
|
||||
const msgContentSplit = content.split(/[ ]+/);
|
||||
let msgContentSplit = content.split(/[ ]+/);
|
||||
|
||||
/**
|
||||
* reference can't be null => must be a reply to message
|
||||
* must contain only one argument
|
||||
* that argument mentions channel
|
||||
*/
|
||||
|
||||
if(message.reference != null && msgContentSplit.length == 1
|
||||
&& message.mentions.channels.first() != undefined){
|
||||
move(message, msgContentSplit[0])
|
||||
}
|
||||
|
||||
let isBot = message.author.bot
|
||||
const isBot = message.author.bot
|
||||
|
||||
if (!isBot){
|
||||
if (msg.includes("henlo")) {
|
||||
henlo(message)
|
||||
henlo(message);
|
||||
}
|
||||
else if (msg.includes("how ye")) {
|
||||
mood(message)
|
||||
|
@ -68,7 +69,7 @@ function gotMessage(message){
|
|||
hug(message)
|
||||
}
|
||||
else if (msgContentSplit[0] == "!say") {
|
||||
say(message)
|
||||
say(message);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -178,10 +179,13 @@ function move(message, channelId){
|
|||
}
|
||||
|
||||
function say(message){
|
||||
let tmp = message.content.split("!say ")
|
||||
let content = tmp[1]
|
||||
message.channel.send(content)
|
||||
const tmp = message.content.split("!say ");
|
||||
const msgContent = tmp[1];
|
||||
const msgChannel = message.channel;
|
||||
message.delete()
|
||||
if (msgContent != undefined && msgContent != ""){
|
||||
msgChannel.send(msgContent);
|
||||
}
|
||||
}
|
||||
|
||||
function createEmbed(title, img, desc){
|
||||
|
|
Loading…
Reference in a new issue