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