#discord.Attachment not working on Slash Command

1 messages · Page 1 of 1 (latest)

rapid nymph
#
async def upload_image(ctx: discord.ApplicationContext,
                       airframe: discord.Option(type=str, name="airframe", required=True),
                       livery: discord.Option(type=str, name="livery", required=True),
                       image: discord.Option(type=discord.Attachment, name="plane_image", required=True)
                       ):

Discord seems to just be treating the plane_image parameter as just text (str)?

rapid nymph
#

even though ive typed it as a discord.Attachment

#

whats goin on?

dark pollen
#

Its input_type

#

Not type

rapid nymph
#

thanks

rapid nymph
#

this still doesnt work though

rapid nymph
dark pollen
# rapid nymph

I mean at this point just do
async def upload_image(ctx: discord.ApplicationContext, airframe: str, livery: str, image: discord.Attachement):

#

You don’t need discord.Option in this case

#

And I think there is an issue in pycord about it so with discord.Option you can’t do attachement (I guess I saw that on pycord GitHub)

frigid pine
# rapid nymph

The problem is that input_type is positional only.

- discord.Option(input_type=str, ...)
+ discord.Option(str, ...)

You cannot specify the argument name

rapid nymph
stark crescent
#

not really, no

dark pollen
stark crescent
frigid pine