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
b1nzee11mo ago
No, it's a sapphire question since it's in relation to the plugin
b1nzee
b1nzee11mo 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
chillihero11mo 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
chillihero11mo ago
ah plugin, my bad
b1nzee
b1nzee11mo 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 ™11mo ago
yup
b1nzee
b1nzee11mo ago
@Favna
Favna
Favna11mo ago
The plugin works just fine. You can try it with @Skyra in ##! /bot-commands .
b1nzee
b1nzee11mo ago
So it does edit the response instead of sending a follow up message?
Favna
Favna11mo ago
Yes
Oreo ™
Oreo ™11mo ago
yeah i tested skyra too and i saw it working fine
Favna
Favna11mo 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 ™11mo ago
thats basically what im doing rn is there any other setup i have to do?
b1nzee
b1nzee11mo ago
Show your code And make sure you register the plugin in your index
Oreo ™
Oreo ™11mo ago
for example this is part of ping.ts
No description
Oreo ™
Oreo ™11mo ago
and this is part botinfo.ts
No description
Oreo ™
Oreo ™11mo ago
is it bc im editing the message after sending it?
b1nzee
b1nzee11mo ago
I'd assume so
Oreo ™
Oreo ™11mo ago
i guess so bc when i use these commands
Oreo ™
Oreo ™11mo ago
No description
No description
Oreo ™
Oreo ™11mo ago
and edit between them it works just fine
b1nzee
b1nzee11mo ago
Probably then
Oreo ™
Oreo ™11mo ago
but i dont see why editing the message would be an issue tho? its still the same message
Favna
Favna11mo ago
You're calling editReply Which part of "use send exclusively" was unclear pepeDaheck
Oreo ™
Oreo ™11mo ago
editReply is only for interaction tho im not calling the interaction so it never gets called
Favna
Favna11mo ago
Edit then Whatever You know what I mean
Oreo ™
Oreo ™11mo ago
how do i edit the message then just delete and resend?
Favna
Favna11mo ago
No you call send again .
Oreo ™
Oreo ™11mo ago
oh wait recalling send also edits the message?
b1nzee
b1nzee11mo ago
No description
b1nzee
b1nzee11mo ago
From skyra
Oreo ™
Oreo ™11mo ago
yeah i didnt know that
Favna
Favna11mo ago
Oreo ™
Oreo ™11mo ago
i just checked skyras ping command too my bad
Favna
Favna11mo 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 ™11mo ago
thanks