how to make bot handle external embed
How to handle embed created by external app?
- I wish to send an embed on behalf of the bot, thru my custom game (with btn components etc).
- I want my bot client to be able to handle those responses.
how do i do that?
basically: create embed from game, handle it thru bot
22 Replies
- What's your exact discord.js
npm list discord.js
and node node -v
version?
- Not a discord.js issue? Check out #other-js-ts.
- Consider reading #how-to-get-help to improve your question!
- Explain what exactly your issue is.
- Post the full error stack trace, not just the top part!
- Show your code!
- Issue solved? Press the button!
- ✅
Marked as resolved by OPWhat's your exact discord.js npm list discord.js and node node -v version?
14.14.1 already mentioned
I wish to send an embed on behalf of the bot, thru my custom game (with btn components etc).I'm not fully sure what you mean by this if your bot is what's handling the game, your bot can just send these messages
I want my bot client to be able to handle those responses.if you're referring to handling the components, components are handled via interactions (guide below) if you're simply looking to receive and respond to messages being sent by something else (in case your bot isn't what's handling the game), all messages can be handled via the
messageCreate
eventi know how to use components.
so let me make it simple:
is there a way to interact with the bot thru my game?
- some action happens in game
- i call some webhook or idk and it triggers some function in bot
this thing, i can make it by typing a command
but i also want to be able to make it from my game
now ican prolly do so via webhooks, but not sure how would i go about handling those interactions from the bot (eg: interaction when i click respond)
i hope i explained it better, english is not my native lang
these are some incredibly vague questions, but just focusing on this image, webhooks created by a bot can send message components
the interactions are sent as normal to the bot that created the webhook
for a broader functionality of "trigger some function in bot" that doesn't involve sending a message, you'd need to set up your own webhook api for your bot
uhm
like express or something?
sure
i think that isn't idea for my bot since i cant expose ports sadlyy
i basically wanted to be able to login as bot thru my game, if possible somehow and then send this embed
that would solve my issue
I have no idea how your game works, so I can't say anything regarding logging in
but your bot is able to just send messages whenever it likes (within reason for rate limits)
i'd assume i'd have to use some raw discord api? (not discord.js)
🤔
no, your bot can send messages through discord.js
i know but it can only send it via:
- the client my bot is running on
- a user interaction
nothin else
uhm im not a total newbie, i can do the basics
that's great, but every question you ask is incredibly vague, and I have no concept of what you know and what you don't know since you haven't given me very much information to work with
i'll try to explain:
- I can create embeds using a discord webhook (basically discord api)
- I can send embeds directly thru bot
1. my bot can responds to interactions from embeds sent thru itself
2. my bot can (possibly) NOT respond to interactions to the embed from webhook
is my point 2 possible?
as mentioned previously, webhooks created by bots can send message components
the interactions for these components are sent to the bot that created them as normal
which is to say, yes 2 is possible
ohhh, i'll try that thanks
:rs_sad: someone come in my tick and also help me to
ohk
well its samp, written in pawn
basically a server
its unnecessary. However it was solved by creating the component using the webhook from my app (which the bot created btw)
later i got the bot to respond to it (as it would normally)
Here's how i created the component:
Here's how i handled the event in bot:
thank you^