4
4
from discord import ui , app_commands
5
5
from helpers .ai import get_image
6
6
7
- class DrawButton (ui .Button ):
7
+ class Button (ui .Button ):
8
8
def __init__ (self , label = 'Regenerate' , disabled = False ):
9
9
super ().__init__ (label = label , disabled = disabled )
10
10
@@ -14,16 +14,16 @@ async def callback(self, interaction: discord.Interaction):
14
14
await interaction .message .edit (view = self .view )
15
15
await self .view .draw_image ()
16
16
17
- class DrawView (ui .View ):
17
+ class View (ui .View ):
18
18
def __init__ (self , prompt , message ):
19
19
super ().__init__ ()
20
20
self .prompt = prompt
21
21
self .message = message
22
- self .add_item (DrawButton ())
22
+ self .add_item (Button ())
23
23
24
24
def button_state (self , label , disabled ):
25
25
self .clear_items ()
26
- self .add_item (DrawButton (label = label , disabled = disabled ))
26
+ self .add_item (Button (label = label , disabled = disabled ))
27
27
28
28
async def draw_image (self ):
29
29
try :
@@ -55,7 +55,7 @@ async def draw(self, interaction: discord.Interaction, prompt: str):
55
55
if response and isinstance (response , bytes ):
56
56
img_file = io .BytesIO (response )
57
57
await message .edit (content = None , attachments = [discord .File (img_file , "image.png" )])
58
- view = DrawView (prompt , message )
58
+ view = View (prompt , message )
59
59
await message .edit (view = view )
60
60
img_file .close ()
61
61
else :
0 commit comments