talking in other channels is now a thing
This commit is contained in:
parent
1aeee86b5d
commit
0ee9694df1
|
@ -4,13 +4,22 @@ exports.run = async (client, message, args) => {
|
||||||
msg = args.join(" ");
|
msg = args.join(" ");
|
||||||
await message.delete();
|
await message.delete();
|
||||||
|
|
||||||
if(args.length == 0)
|
if(args.length === 0) {
|
||||||
return message.reply("please insert a valid message.")
|
return (await message.reply("please insert a valid message.")).delete(5000);
|
||||||
.then(msg => {
|
}
|
||||||
msg.delete(5000).catch(e => {e})
|
|
||||||
})
|
let location = message.channel;
|
||||||
|
guild = message.guild;
|
||||||
|
|
||||||
|
if(args[0].startsWith('<#') && args[0].endsWith('>')) {
|
||||||
|
location = args[0].slice(2, -1);
|
||||||
|
location = guild.channels.find(c => c.id === location);
|
||||||
|
msg = msg.replace(/[0-9]+/g, "");
|
||||||
|
msg = msg.replace(/[$<#> ]+/g, "");
|
||||||
|
console.log(`msg is ${msg}`)
|
||||||
|
}
|
||||||
|
|
||||||
message.channel.send(msg);
|
location.send(msg);
|
||||||
}
|
}
|
||||||
|
|
||||||
exports.conf = {
|
exports.conf = {
|
||||||
|
@ -24,5 +33,5 @@ exports.help = {
|
||||||
name: "talk",
|
name: "talk",
|
||||||
category: "Fun",
|
category: "Fun",
|
||||||
description: "Talk as the bot in the current channel you're in.",
|
description: "Talk as the bot in the current channel you're in.",
|
||||||
usage: "talk text"
|
usage: "talk <text>"
|
||||||
};
|
};
|
Loading…
Reference in New Issue