@@ -171,16 +171,19 @@ def format_info(self, user):
171
171
'''Get information about a member of a server'''
172
172
server = self .guild
173
173
member = self .guild .get_member (user .id )
174
- avi = member .avatar_url
174
+ avi = user .avatar_url
175
175
time = datetime .datetime .utcnow ()
176
176
desc = 'Modmail thread started.'
177
177
color = 0
178
178
179
179
if member :
180
+ roles = sorted (member .roles , key = lambda c : c .position )
181
+ rolenames = ', ' .join ([r .name for r in roles if r .name != "@everyone" ]) or 'None'
182
+ member_number = sorted (server .members , key = lambda m : m .joined_at ).index (member ) + 1
180
183
for role in roles :
181
184
if str (role .color ) != "#000000" :
182
185
color = role .color
183
-
186
+
184
187
em = discord .Embed (colour = color , description = desc , timestamp = time )
185
188
186
189
em .add_field (name = 'Account Created' , value = str ((time - user .created_at ).days )+ ' days ago.' )
@@ -189,10 +192,6 @@ def format_info(self, user):
189
192
em .set_author (name = user , icon_url = server .icon_url )
190
193
191
194
if member :
192
- roles = sorted (member .roles , key = lambda c : c .position )
193
- rolenames = ', ' .join ([r .name for r in roles if r .name != "@everyone" ]) or 'None'
194
- member_number = sorted (server .members , key = lambda m : m .joined_at ).index (member ) + 1
195
-
196
195
em .add_field (name = 'Joined' , value = str ((time - member .joined_at ).days )+ ' days ago.' )
197
196
em .add_field (name = 'Member No.' ,value = str (member_number ),inline = True )
198
197
em .add_field (name = 'Nick' , value = member .nick , inline = True )
@@ -215,7 +214,10 @@ async def send_mail(self, message, channel):
215
214
await channel .send (fmt , embed = embed )
216
215
217
216
async def process_reply (self , message ):
218
- await message .delete ()
217
+ try :
218
+ await message .delete ()
219
+ except discord .errors .NotFound :
220
+ pass
219
221
await self .send_mail (message , message .channel )
220
222
user_id = int (message .channel .topic .split (': ' )[1 ])
221
223
user = self .get_user (user_id )
0 commit comments