#editable commands

1 messages · Page 1 of 1 (latest)

gusty lichen
#

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?

wise cedarBOT
#

To help others find answers, you can mark your question as solved via Right click solution message -> Apps -> ✅ Mark Solution

vivid frost
#

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 thonk

worn loom
#

ah plugin, my bad

vivid frost
#

@gusty lichen 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
vivid frost
#

@small magnet

small magnet
#

The plugin works just fine. You can try it with @clever fjord in ##! /bot-commands .

vivid frost
#

So it does edit the response instead of sending a follow up message?

small magnet
#

Yes

gusty lichen
#

yeah i tested skyra too

#

and i saw it working fine

small magnet
#

You just have to register the plugin and use the send method of the plugin exclusively, so no message.channel.send / message.edit

gusty lichen
#

thats basically what im doing rn

#

is there any other setup i have to do?

vivid frost
#

Show your code

#

And make sure you register the plugin in your index

south topazBOT
gusty lichen
#

for example this is part of ping.ts

#

and this is part botinfo.ts

#

is it bc im editing the message after sending it?

vivid frost
#

I'd assume so

gusty lichen
#

i guess so

#

bc when i use these commands

#

and edit between them it works just fine

vivid frost
#

Probably then

gusty lichen
#

but i dont see why editing the message would be an issue tho? its still the same message

small magnet
#

You're calling editReply

#

Which part of "use send exclusively" was unclear pepeDaheck

gusty lichen
#

editReply is only for interaction tho

#

im not calling the interaction

#

so it never gets called

small magnet
#

Edit then

#

Whatever

#

You know what I mean

gusty lichen
#

how do i edit the message then

#

just delete and resend?

small magnet
#

No you call send again

gusty lichen
#

oh wait recalling send also edits the message?

vivid frost
#

From skyra

gusty lichen
#

yeah i didnt know that

small magnet
#

Yes

gusty lichen
#

i just checked skyras ping command too

#

my bad

wise cedarBOT
small magnet
#

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