i want my bot to be able to use /tts and @
Using commands? Idk about.
Mentioning people? Here
var target = bot.getUser("username", stringWithUsername);
var response = target.mention + ", your message.";
bot.sendMessage(message.channel, response);
I'm getting this error now
..... replace "stringWithUsername" so that it is a variable that has the username in in...
You can also make a message TTS by specifying the option parameter, check
the docs for Client.sendMessage for an example of this.
On Thu, 5 Nov 2015 7:13 am Khionu Terabite [email protected] wrote:
..... replace "stringWithUsername" so that it is a variable that has the
username in in...—
Reply to this email directly or view it on GitHub
https://github.com/hydrabolt/discord.js/issues/46#issuecomment-153975254
.
Good to know, re TTS
so msg.sender.username?
If you want to mention them, no. If you just want their username, yep.
To mention do: msg.sender.mention() OR do msg.sender + ""
On Thu, 5 Nov 2015 7:21 am PastaAdventures [email protected] wrote:
so msg.sender.username?
—
Reply to this email directly or view it on GitHub
https://github.com/hydrabolt/discord.js/issues/46#issuecomment-153976113
.
Or, if you want to mention the sender at the beginning bot.reply(message, "what you want to tell them");
so this is suppose to send a tts msg?
if (msg.content === "!notice") {
bot.sendMessage(msg.channel, "Hey " + msg.sender.username + "!", true)
}
1) Learn JS
2) Read the Discord.JS documentation
3) Read what we said above.
ok, i think i'm good
That's not what. "msg.sender.username" is just going to give you the string. That's not what I showed you to Mention them.
yeah, for this one i just want the string, but want the bot to tts the whole msg. Specifying the parameter for tts does not seem to make the bot tts the msg
Options is an object, not just true. You need to use:
{
tts:true
}
On Thu, 5 Nov 2015 7:57 am PastaAdventures [email protected] wrote:
yeah, for this on i just want the string, but wan the bot to tts the whole
msg—
Reply to this email directly or view it on GitHub
https://github.com/hydrabolt/discord.js/issues/46#issuecomment-153981702
.
hi @khionu what do you mean by replacing "stringWithUsername" as a variable, I am new to discord.js so could you kindly show men how you can do this in javascript,
Thanks in advance!
@FredyTek are you trying to send a message that mentions someone?
Please don't revive old issues... Make a new one if you have a question
Yes @Azoy
I will @abalabahaha
can someone help me? what im trying to do is so if someone types "@botname hi" the bot will say whatever back but how do you get teh prefix to be the bots @?
@ChlckenWings I got that to work by simply watching the message.content to include client.user which is my bot.
So, for example:
if(message.content.includes(client.user)){
message.channel.send('Yes?');
}
Hope that helps.
Most helpful comment
1) Learn JS
2) Read the Discord.JS documentation
3) Read what we said above.