#Give parameters to view (attachment) | SOLVED |

1 messages · Page 1 of 1 (latest)

lunar thunder
#

I want to make an confirmation view, and then use the file sent in the original message to do some stuff with it, how i can do it?

ruby pulsar
#

Subclass discord.ui.View and take a file as argument for init?

lunar thunder
#

i detect the message with

@bot.event
async def on_message(msj):

and then use
await msj.reply(text,view= TartaViews.newPreset())

lunar thunder
#

i have something like this:

class views():
  class view1(discord.ui.View):
    bla 
  class view2(discord.ui.View):
    bla 
zealous kelp
lunar thunder
#

i cant add an def __init__(self, file)inside the view1 class since it overdide it

#

also cant make view "return" something like

response = await msj.reply(text,view= TartaViews.newPreset())
if response:
  dothing(file)
zealous kelp
#

so you can still access the file without throwing it everywhere

lunar thunder
#

idk im the only one who need this lol

zealous kelp
lunar thunder
zealous kelp
ruby pulsar
lunar thunder
#

i mean, yea, i can do this inside the on_message

ruby pulsar
#

I do/did it for some of my views

zealous kelp
#

it’s like screwing a screw in and out and in again

lunar thunder
#

well... it works

#

Give parameters to view (attachment) | SOLVED |