66# # create form
77class MyModal (disnake .ui .Modal ):
88 def __init__ (self ) -> None :
9+ self .add_role = 997142096836304896
10+ self .remove_role = 997143448484315247
11+ self .error_channel = 997858250106089632
912 components = [
1013 disnake .ui .TextInput (
1114 label = "شماره تلفن خود به انگلیسی" ,
@@ -40,8 +43,8 @@ async def callback(self, inter: disnake.ModalInteraction) -> None:
4043 await inter .response .send_message (embed = embed , ephemeral = True )
4144 # add and remove roles
4245 # set your personal role id for add and remove
43- Add_Role_id = inter .guild .get_role (997142096836304896 )
44- Remove_role_id = inter .guild .get_role (997143448484315247 )
46+ Add_Role_id = inter .guild .get_role (self . add_role )
47+ Remove_role_id = inter .guild .get_role (self . remove_role )
4548 await asyncio .sleep (3 )
4649 await inter .author .add_roles (Add_Role_id )
4750 await inter .author .remove_roles (Remove_role_id )
@@ -67,7 +70,7 @@ async def callback(self, inter: disnake.ModalInteraction) -> None:
6770 except Exception as e :
6871 #error Log
6972 # set your personal channel for errors
70- channel = inter .guild .get_channel (997858250106089632 )
73+ channel = inter .guild .get_channel (self . error_channel )
7174 await channel .send (e )
7275 # agar api moshkel bokhore ya az discord javab nayad in execute mishe
7376 # if there is a problem in api or no response from discord this message will be shown
@@ -82,16 +85,18 @@ def __init__(self):
8285 async def authenticate (self , button :disnake .ui .Button , inter : disnake .MessageInteraction ):
8386 await inter .response .send_modal (MyModal ())
8487
88+
8589class check (commands .Cog ):
8690 def __init__ (self , bot :commands .Bot ):
8791 self .bot = bot
92+ self .lobby_channel = 997144260501569599
8893
8994
9095 @commands .Cog .listener ()
9196 async def on_ready (self ):
9297 # lobby channel
9398 # set your personal channel
94- channel = self .bot .get_channel (997144260501569599 )
99+ channel = self .bot .get_channel (self . lobby_channel )
95100 # delete last 10 message from channel
96101 await channel .purge (limit = 10 )
97102 embed = disnake .Embed (color = 0x14db4c )
0 commit comments