#Posting a image

1 messages · Page 1 of 1 (latest)

cold radish
#

I have this code to post and image to discord

`async def getTeam(ctx: interactions.CommandContext, teamname: str):
teamid = tournamentFunctions.getTeamID(teamname)
team = tournamentFunctions.getTeam(teamid)

for image in team:
    image_path = f"folder/{image}.png"

    await ctx.send(file=interactions.File(image_path))`

I get the error: TypeError: _Context.send() got an unexpected keyword argument 'file'
file needs to be defined right?

tardy ivyBOT
#

Hey! Once your issue is solved, press the button below to close this thread!

queen wharf
#

@cold radish it’s files=

cold radish
#

Thank you so much! It works now