#error

1 messages · Page 1 of 1 (latest)

normal seal
#

I get an error with my code, not sure how to fix it
im pretty new to disnake and python so still learning, sorry if its something obvious

@commands.slash_command(name="dog", description=" Display a random image of a Dog!")
    async def dog(inter):
        with open("images/dog.txt", "r") as f:
            lines = f.readlines()
        line = random.choice(lines)
        image_link, description = line.strip().split("|")
        with open("facts/dog.txt", "r") as f:
            facts = f.readlines()
        fact = random.choice(facts)
        embed = disnake.Embed(colour=15660190)
        embed.title = ("**Heres an image of a delightful dog!**")
        embed.set_image(url=image_link)
        embed.set_footer(text=fact)
        embed.description = description
        await inter.send(embed=embed)
        print(f"User {inter.author.name} ({inter.author.id}) used command \"/dog\"")

https://pastebin.com/8cuKr3fK

still coral
#

interaction.defer() or response to a interaction

#

read this guide

white cloak
#

from what I can see, that code shouldn't raise that error

normal seal
#

the error happens maybe once every 10-20 times you use the command every other time is fine no error

still coral
#

after 15 minutes I think

marble hamlet
#

yeah the error doesn't seem related to the code you sent, that's rather odd

normal seal
#

:/

#

thats all the code for that command

white cloak
#

maybe it could be because of the outage last day

#

when did the error happen?

marble hamlet
#

which is odd; as the error relates to responding to the same interaction twice, which

  • your command clearly only does once, at the await inter.send(embed=embed) line
  • inter.send inherently avoids in the first place
normal seal
#

it's been happening for maybe a week

marble hamlet
#

so that's really odd

white cloak
#

what is your current disnake version by the way

normal seal
#

latest I'm pretty sure I'll check once I finish cooking

#

I installed it at the end of December

white cloak
#

can you print inter.response._response_type before the inter.send please

white cloak
normal seal
#

"none"

white cloak
#

that should be the normal behavior

normal seal
#

i tried spamming the command a few times but didnt get the error so cant say if it says something different when the error happens or not

lost brook
#

Where you running two instances of the bot at some point maybe?

normal seal
normal seal
white cloak
#

hmm that's weird

white cloak