#Best way to send messages via a bot?

20 messages · Page 1 of 1 (latest)

crystal gulchBOT
#

• What's your exact discord.js npm list discord.js and node node -v version?
• Post the full error stack trace, not just the top part!
• Show your code!
• Explain what exactly your issue is.
• Not a discord.js issue? Check out #useful-servers.

pearl raft
#

modals perhaps?

vagrant pasture
#

Use a modal or prepare the message in a txt file and send it as a AttachmentOption

pearl raft
#

no. On modalsubmit you would send the contents of the modal paragraph

desert geyser
#

I feel sorry for that one guy

vagrant pasture
#

Sure you can <@&guildId> and enable the parse everyone in allowedMentions

pearl raft
#

for role mentions, use the mention syntax. and for everyone ^

vagrant pasture
desert geyser
#

Oh, I see

#

Yeah sorry mb

pearl raft
#

yeah. For ease maybe make a message have a button called “new announcement” and have that show a modal.

vagrant pasture
#

Those were two possibilities, either modal or txt file

pearl raft
#

Modals are forms you fill out

#

you can write your announcement inside a modal paragraph input

vagrant pasture
#

You write your announcement message in a .txt file. With markdown and everything. Then send it as AttachmentOption with a slashcommand for /announcement or something

desert geyser
#

Discord.js always has a great, in-depth guide for everything that makes it really easy to understand

vagrant pasture
#

If you just send it as attachment in your announcement message it would. But if you instead read the content of the file and put it as content: in your send then it would send the actual message

vagrant pasture
#

Nope. content: yourFavoriteFileReadingFunctionOrFetch(file)

#

depending on function might need an await of course