editable commands

Is there anyway i can make it so that when someone edits the command it edits the original response and not send a new message everytime?
38 Replies
b1nzee
b1nzee16mo ago
No, it's a sapphire question since it's in relation to the plugin
b1nzee
b1nzee16mo ago
I'm looking at source code (never used the plugin myself) and it seems it will only send a new message if the edit fails for whatever reason thonk
No description
chillihero
chillihero16mo ago
Discord.js
Discord.js is a powerful node.js module that allows you to interact with the Discord API very easily. It takes a much more object-oriented approach than most other JS Discord libraries, making your bot's code significantly tidier and easier to comprehend.
chillihero
chillihero16mo ago
ah plugin, my bad
b1nzee
b1nzee16mo ago
@theoreotm you're using the plugin, right? But yeah, Favna / vladdy will have to clarify further since I've never used the plugin myself and I'm just looking at the GitHub repo + I'm on mobile
Oreo ™
Oreo ™16mo ago
yup
b1nzee
b1nzee16mo ago
@Favna
Favna
Favna16mo ago
The plugin works just fine. You can try it with @Skyra in ##! /bot-commands .
b1nzee
b1nzee16mo ago
So it does edit the response instead of sending a follow up message?
Favna
Favna16mo ago
Yes
Oreo ™
Oreo ™16mo ago
yeah i tested skyra too and i saw it working fine
Favna
Favna16mo ago
You just have to register the plugin and use the send method of the plugin exclusively, so no message.channel.send / message.edit
Oreo ™
Oreo ™16mo ago
thats basically what im doing rn is there any other setup i have to do?
b1nzee
b1nzee16mo ago
Show your code And make sure you register the plugin in your index
Oreo ™
Oreo ™16mo ago
for example this is part of ping.ts
No description
Oreo ™
Oreo ™16mo ago
and this is part botinfo.ts
No description
Oreo ™
Oreo ™16mo ago
is it bc im editing the message after sending it?
b1nzee
b1nzee16mo ago
I'd assume so
Oreo ™
Oreo ™16mo ago
i guess so bc when i use these commands
Oreo ™
Oreo ™16mo ago
No description
No description
Oreo ™
Oreo ™16mo ago
and edit between them it works just fine
b1nzee
b1nzee16mo ago
Probably then
Oreo ™
Oreo ™16mo ago
but i dont see why editing the message would be an issue tho? its still the same message
Favna
Favna16mo ago
You're calling editReply Which part of "use send exclusively" was unclear pepeDaheck
Oreo ™
Oreo ™16mo ago
editReply is only for interaction tho im not calling the interaction so it never gets called
Favna
Favna16mo ago
Edit then Whatever You know what I mean
Oreo ™
Oreo ™16mo ago
how do i edit the message then just delete and resend?
Favna
Favna16mo ago
No you call send again .
Oreo ™
Oreo ™16mo ago
oh wait recalling send also edits the message?
b1nzee
b1nzee16mo ago
No description
b1nzee
b1nzee16mo ago
From skyra
Oreo ™
Oreo ™16mo ago
yeah i didnt know that
Favna
Favna16mo ago
Oreo ™
Oreo ™16mo ago
i just checked skyras ping command too my bad
Favna
Favna16mo ago
Outside of prototype pollution there is no way to modify the DiscordJS methods for sending and editing And the data has to be tracked somewhere
Oreo ™
Oreo ™16mo ago
thanks
Want results from more Discord servers?
Add your server