Update app.py
Browse files
app.py
CHANGED
@@ -53,8 +53,8 @@ class ButtonView(discord.ui.View):
|
|
53 |
self.stop()
|
54 |
#-------------------------------------------
|
55 |
async def invoke_dfif2(self, image_path):
|
56 |
-
ctx = await self.
|
57 |
-
await ctx.invoke(ctx.bot.get_command('dfif2'), image_path=image_path, stage_1_result_path=self.stage_1_result_path)
|
58 |
|
59 |
@discord.ui.button(label='Image 1', style=discord.ButtonStyle.blurple)
|
60 |
async def image1_button(self, button: discord.ui.Button, interaction: discord.Interaction):
|
@@ -186,7 +186,7 @@ class MyClient(discord.Client):
|
|
186 |
|
187 |
# Send the combined image file as a discord attachment with the button view
|
188 |
with open(combined_image_path, 'rb') as f:
|
189 |
-
view = ButtonView(
|
190 |
await message.reply('Here is the combined image', file=discord.File(f, 'combined_image.png'), view=view)
|
191 |
|
192 |
|
|
|
53 |
self.stop()
|
54 |
#-------------------------------------------
|
55 |
async def invoke_dfif2(self, image_path):
|
56 |
+
ctx = await self.get_context(message, cls=commands.Context)
|
57 |
+
await self.ctx.invoke(self.ctx.bot.get_command('dfif2'), image_path=image_path, stage_1_result_path=self.stage_1_result_path)
|
58 |
|
59 |
@discord.ui.button(label='Image 1', style=discord.ButtonStyle.blurple)
|
60 |
async def image1_button(self, button: discord.ui.Button, interaction: discord.Interaction):
|
|
|
186 |
|
187 |
# Send the combined image file as a discord attachment with the button view
|
188 |
with open(combined_image_path, 'rb') as f:
|
189 |
+
view = ButtonView(ctx, [first_png_path, second_png_path, third_png_path, fourth_png_path], stage_1_result_path)
|
190 |
await message.reply('Here is the combined image', file=discord.File(f, 'combined_image.png'), view=view)
|
191 |
|
192 |
|