@@ -164,7 +164,7 @@ async def _close(self, ctx):
164
164
@commands .command ()
165
165
async def nsfw (self , ctx ):
166
166
"""Flags a modmail thread as nsfw."""
167
- thread = self .bot .threads .find (channel = ctx .channel )
167
+ thread = await self .bot .threads .find (channel = ctx .channel )
168
168
if thread is None :
169
169
return
170
170
await ctx .channel .edit (nsfw = True )
@@ -196,7 +196,9 @@ async def logs(self, ctx, *, member: discord.Member=None):
196
196
197
197
fmt = ''
198
198
199
- for index , entry in enumerate (logs ):
199
+ open_logs = [l for l in logs if not l ['open' ]]
200
+
201
+ for index , entry in enumerate (open_logs ):
200
202
if len (embeds [- 1 ].fields ) == 3 :
201
203
em = discord .Embed (color = discord .Color .green ())
202
204
em .set_author (name = 'Previous Logs' , icon_url = user .avatar_url )
@@ -209,12 +211,11 @@ async def logs(self, ctx, *, member: discord.Member=None):
209
211
user_id = entry ['user_id' ]
210
212
log_url = f"https://logs.modmail.tk/{ user_id } /{ key } "
211
213
212
- if not entry ['open' ]: # only list closed threads
213
- fmt += f"[`{ key } `]({ log_url } )\n "
214
+ fmt += f"[`{ key } `]({ log_url } )\n "
214
215
215
- if current_day != new_day or index == len (logs ) - 2 :
216
- embeds [- 1 ].add_field (name = current_day , value = fmt )
217
- current_day = new_day
216
+ if current_day != new_day or index == len (logs ) - 1 :
217
+ embeds [- 1 ].add_field (name = current_day , value = fmt )
218
+ current_day = new_day
218
219
fmt = ''
219
220
220
221
session = PaginatorSession (ctx , * embeds )
0 commit comments