#(Hedwy) `discordmessage` / `discordinteraction` - attach image/gif

49 messages · Page 1 of 1 (latest)

near loom
#

Hey. I see that we have an ability to attach files in discordinteraction and discordmessage commands but its totally unclear for me, what exactly should I insert in attach_file_name: there to make that command recognize the file that I want to attach?

I tried to use ~fileread:

        - discordinteraction reply interaction:<context.interaction> "123" attach_file_name:<entry[image].data>```
there is debug:
https://paste.denizenscript.com/View/109339
mighty turretBOT
#

(Hedwy) discordmessage / discordinteraction - attach image/gif

#

Hi I'm AutoThreadBot! Don't mind me, I'll just be adding the helper team to this thread so they can see it. A human will get to you soon.
You can block this bot if you don't want to see these messages, I won't mind.
<@&525394568410038282>

bleak cobalt
#
#Use to send files in a single message, including an image file, using a MapTag.
- ~fileread path:my_information.yml save:info
- ~fileread path:my_image.png save:image
- definemap files:
    text.txt: Wow! Denizen is so cool!
    info.yml: <entry[info].data>
    my_image.png: <entry[image].data>
- ~discordmessage id:mybot channel:<[channel]> attach_files:<[files]>
#

According to the documentation for sending files

#

Looks like it needs to be in a map to send properly

rain merlin
#

!command discordmessage

upper fossilBOT
# rain merlin !command discordmessage
Required Plugins or Platforms

dDiscordBot

Group

external

Syntax

discordmessage (id:<id>) [reply:<message>/edit:<message>/channel:<channel>/user:<user>] (<message>) (no_mention) (rows:<rows>) (embed:<embed>|...) (attach_files:<map>)

Short Description

Sends a message to a Discord channel.

Description

Sends a message to a Discord channel.

Command may fail if the bot does not have permission within the Discord group to send a message in that channel.

You can send the message to: a channel, user, or in reply to a previous message.
If sending as a reply, optionally use "no_mention" to disable the default reply pinging the original user.

Channels can be specified as either a copied ID, or using any tag that returns a valid DiscordChannelTag.
To get IDs, enable "Developer Mode" in your Discord ...

rain merlin
# bleak cobalt Looks like it needs to be in a map to send properly
#Use to send files in a single message, including an image file, using a MapTag.
- ~fileread path:my_information.yml save:info
- ~fileread path:my_image.png save:image
- definemap files:
    text.txt: Wow! Denizen is so cool!
    info.yml: <entry[info].data>
    my_image.png: <entry[image].data>
- ~discordmessage id:mybot channel:<[channel]> attach_files:<[files]>```
#Use to send files in a single message, including an image file, using a MapTag.
- ~fileread path:my_information.yml save:info
- ~fileread path:my_image.png save:image
- definemap files:
    text.txt: Wow! Denizen is so cool!
    info.yml: <entry[info].data>
    my_image.png: <entry[image].data>
- ~discordmessage id:mybot channel:<[channel]> attach_files:<[files]>```

appears so, yeah

near loom
#

Oh, sorry, I forgot to disable ping

#

Eh no, still does nothing with map:

        - ~fileread path:data/gif.gif save:image
        - definemap files:
            gif.gif: <entry[image].data>
        - discordinteraction reply interaction:<context.interaction> "123" attach_file_name:<[files]>```
rain merlin
#

!command discordreply

upper fossilBOT
#
Possible Confusion

Did you mean to search for discordreact?

#
Possible Confusion

Did you mean to search for mechanism discover_recipe?

rain merlin
#

that isn't a thing or im confused what discordreply is

frail holly
#

they probably mean discordinteraction reply

near loom
#

pikasurprise oh yes, sorry

#

!c discordinteraction

upper fossilBOT
# near loom !c discordinteraction
Required Plugins or Platforms

dDiscordBot

Group

external

Syntax

discordinteraction [defer/reply/delete] [interaction:<interaction>] (ephemeral) (attach_file_name:<name>) (attach_file_text:<text>) (rows:<rows>) (<message>)

Short Description

Manages Discord interactions.

Description

Manages Discord interactions.

You can defer, reply to, edit, or delete an interaction. These instructions all require the "interaction" argument.

The "ephemeral" argument can be used to have the reply message be visible to that one user.

You can defer an interaction before replying, which is useful if your reply may take more than a few seconds to be selected.
If you defer, the 'ephemeral' option can only be set by the defer - you cannot change it with the later reply.
Replying to an interact...

near loom
#
    - discordinteraction reply interaction:<context.interaction> "123" attach_file_name:<[files]>
near loom
#

^ still a question 🫠
what exactly should be in a attach_file_name: in that command to make it send an image

coarse pewter
#

!c while usage

upper fossilBOT
# coarse pewter !c while usage
Group

queue

Syntax

while [stop/next/[<value>] (!)(<operator> <value>) (&&/|| ...)] [<commands>]

Short Description

Runs a series of braced commands until the tag returns false.

Use to loop until a player sneaks, or the player goes offline. (Note: generally use 'waituntil' for this instead)
- while !<player.is_sneaking> && <player.is_online>:
    - narrate "Waiting for you to sneak..."
    - wait 1s
frail holly
coarse pewter
#

Opss sorry

#

I didn't realize

near loom
#

pikasurprise still didn't figured it out how should input look like

fast aspen
#

That was added into discordmessage, but doesn't seem to be a thing for discordinteraction reply yet - can feature request that

near loom
#

There is attach_file_name in discordreply, is it the same? I need to attach only 1 file, but it's a .gif one

fast aspen
#

Which lets you pass in any file type

near loom
#

I see that file was successfully saved in debug but anyway it does not send anything with discordreply

#

there is also debug with error at the very beginning of that thread

near loom
#

Oh I see, misunderstood. Yeah, it'll be cool to have that as a feature

plain veldtBOT
#
Changed to Feature

Thread is now a Feature thread. This indicates a request for a new feature to the plugin, that both (A) does not already exist and (B) reasonably can be added. If you are unsure whether this applies, use </helpthread:1028674284870180883> to change back to a normal help thread.

real dome
#

@near loom ref #commit-log discordinteraction now uses discordmessage's argument handler, so should support this

plain veldtBOT
#
Thread Closing Reminder

Has your issue been resolved, or your question been answered?
If so, please use the </resolved:1028673926114594866> command to close your thread.
Or </invalid:1028673926898909185> if it's not possible to resolve.

If not yet resolved, please reply below to tell us what you still need.

(Note that if there is no reply for a few days, this thread will eventually close itself.)

#

@near loom