6
6
# # create form
7
7
class MyModal (disnake .ui .Modal ):
8
8
def __init__ (self ) -> None :
9
+ self .add_role = 997142096836304896
10
+ self .remove_role = 997143448484315247
11
+ self .error_channel = 997858250106089632
9
12
components = [
10
13
disnake .ui .TextInput (
11
14
label = "شماره تلفن خود به انگلیسی" ,
@@ -40,8 +43,8 @@ async def callback(self, inter: disnake.ModalInteraction) -> None:
40
43
await inter .response .send_message (embed = embed , ephemeral = True )
41
44
# add and remove roles
42
45
# 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 )
45
48
await asyncio .sleep (3 )
46
49
await inter .author .add_roles (Add_Role_id )
47
50
await inter .author .remove_roles (Remove_role_id )
@@ -67,7 +70,7 @@ async def callback(self, inter: disnake.ModalInteraction) -> None:
67
70
except Exception as e :
68
71
#error Log
69
72
# set your personal channel for errors
70
- channel = inter .guild .get_channel (997858250106089632 )
73
+ channel = inter .guild .get_channel (self . error_channel )
71
74
await channel .send (e )
72
75
# agar api moshkel bokhore ya az discord javab nayad in execute mishe
73
76
# if there is a problem in api or no response from discord this message will be shown
@@ -82,16 +85,18 @@ def __init__(self):
82
85
async def authenticate (self , button :disnake .ui .Button , inter : disnake .MessageInteraction ):
83
86
await inter .response .send_modal (MyModal ())
84
87
88
+
85
89
class check (commands .Cog ):
86
90
def __init__ (self , bot :commands .Bot ):
87
91
self .bot = bot
92
+ self .lobby_channel = 997144260501569599
88
93
89
94
90
95
@commands .Cog .listener ()
91
96
async def on_ready (self ):
92
97
# lobby channel
93
98
# set your personal channel
94
- channel = self .bot .get_channel (997144260501569599 )
99
+ channel = self .bot .get_channel (self . lobby_channel )
95
100
# delete last 10 message from channel
96
101
await channel .purge (limit = 10 )
97
102
embed = disnake .Embed (color = 0x14db4c )
0 commit comments