Bn102
DIAdiscord.js - Imagine an app
•Created by Bn102 on 9/16/2024 in #djs-questions
Get who used a /command on another bot
Hi,
I have a bot (Bot1) in our server that i'm trying to create a leaderboard of how many times each user has used a particular slash command (lets call it "/command")
The bot in question is a third party bot, so not one that we have control over unfortunately.
We have a custom bot (Bot2) that we use for a number of things in the server and I was wondering if there is a way to get the user ID of the person that triggered "/command" on Bot1, so that Bot2 can log the command use in "commandleaderboard.json"
----
To try to illustrate this a little bit better, what i'm after is:
<USER> uses /command on Bot 1
Bot 1 will respond to the /command interaction with <RESPONSE MESSAGE>
Bot 2 will see the message from Bot 1 and that the message starts with: "Command received" and then retrieve <USER.id> for the person that triggered the command
Bot 2 will then store this data in "commandleaderboard.json"
I know how to listen for the RESPONSE message, I'm just not sure how, or if it's possible for Bot 2 to get the ID of the user that used the command
Thank you
6 replies