@@ -122,6 +122,10 @@ def get_user_logs(self, user_id):
122122
123123 def get_log (self , channel_id ):
124124 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" ]} '
125129
126130 def get_config (self ):
127131 return self .request (self .config )
@@ -131,7 +135,7 @@ def update_config(self, data):
131135 data = {k : v for k , v in data .items () if k in valid_keys }
132136 return self .request (self .config , method = 'PATCH' , payload = data )
133137
134- def get_log_url (self , recipient , channel , creator ):
138+ def create_log_entry (self , recipient , channel , creator ):
135139 return self .request (self .logs + '/key' , payload = {
136140 'channel_id' : str (channel .id ),
137141 'guild_id' : str (self .app .guild_id ),
@@ -218,8 +222,13 @@ async def get_user_logs(self, user_id):
218222
219223 async def get_log (self , channel_id ):
220224 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 } "
221230
222- async def get_log_url (self , recipient , channel , creator ):
231+ async def create_log_entry (self , recipient , channel , creator ):
223232 key = secrets .token_hex (6 )
224233
225234 await self .logs .insert_one ({
0 commit comments