@@ -122,6 +122,10 @@ def get_user_logs(self, user_id):
122
122
123
123
def get_log (self , channel_id ):
124
124
return self .request (self .logs + '/' + str (channel_id ))
125
+
126
+ async def get_log_link (self , channel_id ):
127
+ doc = await self .get_log (channel_id )
128
+ return f'https://logs.modmail.tk/{ doc ["key" ]} '
125
129
126
130
def get_config (self ):
127
131
return self .request (self .config )
@@ -131,7 +135,7 @@ def update_config(self, data):
131
135
data = {k : v for k , v in data .items () if k in valid_keys }
132
136
return self .request (self .config , method = 'PATCH' , payload = data )
133
137
134
- def get_log_url (self , recipient , channel , creator ):
138
+ def create_log_entry (self , recipient , channel , creator ):
135
139
return self .request (self .logs + '/key' , payload = {
136
140
'channel_id' : str (channel .id ),
137
141
'guild_id' : str (self .app .guild_id ),
@@ -218,8 +222,13 @@ async def get_user_logs(self, user_id):
218
222
219
223
async def get_log (self , channel_id ):
220
224
return await self .logs .find_one ({'channel_id' : str (channel_id )})
225
+
226
+ async def get_log_link (self , channel_id ):
227
+ doc = await self .get_log (channel_id )
228
+ key = doc ['key' ]
229
+ return f"{ self .app .config .log_url .strip ('/' )} /logs/{ key } "
221
230
222
- async def get_log_url (self , recipient , channel , creator ):
231
+ async def create_log_entry (self , recipient , channel , creator ):
223
232
key = secrets .token_hex (6 )
224
233
225
234
await self .logs .insert_one ({
0 commit comments