77
88import discord
99from discord .ext import commands
10- from discord import ButtonStyle
10+ from discord . ui import Modal , InputText , View , Button
1111
1212from draft_database import DraftDatabase
1313
@@ -25,16 +25,16 @@ def log_vote(message: str) -> None:
2525 file .write (f"[{ timestamp } ] { message } \n " )
2626
2727
28- class ReviewModal (discord . Modal ):
28+ class ReviewModal (Modal ):
2929 def __init__ (self , is_approval : bool ) -> None :
3030 title = "Draft Review" if is_approval else "Draft Rejection"
3131 super ().__init__ (title = title )
3232
33- self .input = discord . TextInput (
33+ self .input = InputText (
3434 label = "Categories" if is_approval else "Rejection Reason" ,
3535 placeholder = ("Enter categories separated by commas" if is_approval
3636 else "Enter reason for rejection" ),
37- style = discord .TextStyle .paragraph ,
37+ style = discord .InputTextStyle .paragraph ,
3838 required = True ,
3939 row = 0
4040 )
@@ -46,7 +46,7 @@ async def callback(self, interaction: discord.Interaction):
4646 await interaction .response .defer ()
4747
4848
49- class VoteView (discord . ui . View ):
49+ class VoteView (View ):
5050 def __init__ (self ,
5151 author : str ,
5252 draft_name : str ,
@@ -79,11 +79,11 @@ def _create_status_embed(self) -> discord.Embed:
7979 return embed
8080
8181 @discord .ui .button (label = "Approve (0)" , style = discord .ButtonStyle .green , emoji = "✅" )
82- async def approve (self , button : discord . ui . Button , interaction : discord .Interaction ):
82+ async def approve (self , button : Button , interaction : discord .Interaction ):
8383 await self ._handle_vote (interaction , True )
8484
8585 @discord .ui .button (label = "Reject (0)" , style = discord .ButtonStyle .red , emoji = "❌" )
86- async def reject (self , button : discord . ui . Button , interaction : discord .Interaction ):
86+ async def reject (self , button : Button , interaction : discord .Interaction ):
8787 await self ._handle_vote (interaction , False )
8888
8989 async def _handle_vote (self , interaction : discord .Interaction , is_approve : bool ):
0 commit comments