Git Product home page Git Product logo

Comments (20)

khionu avatar khionu commented on May 12, 2024 4
  1. Learn JS
  2. Read the Discord.JS documentation
  3. Read what we said above.

from discord.js.

khionu avatar khionu commented on May 12, 2024 3

Using commands? Idk about.

Mentioning people? Here

var target = bot.getUser("username", stringWithUsername);
var response = target.mention + ", your message.";
bot.sendMessage(message.channel, response);

from discord.js.

amishshah avatar amishshah commented on May 12, 2024 3

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
#46 (comment)
.

from discord.js.

PastaAdventures avatar PastaAdventures commented on May 12, 2024

I'm getting this error now

http://i.imgur.com/aKIHSvE.png

from discord.js.

khionu avatar khionu commented on May 12, 2024

..... replace "stringWithUsername" so that it is a variable that has the username in in...

from discord.js.

amishshah avatar amishshah commented on May 12, 2024

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
#46 (comment)
.

from discord.js.

khionu avatar khionu commented on May 12, 2024

Good to know, re TTS

from discord.js.

PastaAdventures avatar PastaAdventures commented on May 12, 2024

so msg.sender.username?

from discord.js.

khionu avatar khionu commented on May 12, 2024

Or, if you want to mention the sender at the beginning bot.reply(message, "what you want to tell them");

from discord.js.

PastaAdventures avatar PastaAdventures commented on May 12, 2024

so this is suppose to send a tts msg?
if (msg.content === "!notice") {
bot.sendMessage(msg.channel, "Hey " + msg.sender.username + "!", true)
}

from discord.js.

PastaAdventures avatar PastaAdventures commented on May 12, 2024

ok, i think i'm good

from discord.js.

khionu avatar khionu commented on May 12, 2024

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.

from discord.js.

PastaAdventures avatar PastaAdventures commented on May 12, 2024

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

from discord.js.

amishshah avatar amishshah commented on May 12, 2024

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
#46 (comment)
.

from discord.js.

FedeCuci avatar FedeCuci commented on May 12, 2024

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!

from discord.js.

Azoy avatar Azoy commented on May 12, 2024

@FredyTek are you trying to send a message that mentions someone?

from discord.js.

abalabahaha avatar abalabahaha commented on May 12, 2024

Please don't revive old issues... Make a new one if you have a question

from discord.js.

FedeCuci avatar FedeCuci commented on May 12, 2024

Yes @Azoy
I will @abalabahaha

from discord.js.

ChlckenWings avatar ChlckenWings commented on May 12, 2024

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 @?

from discord.js.

saysora avatar saysora commented on May 12, 2024

@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.

from discord.js.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.