File tree Expand file tree Collapse file tree 1 file changed +13
-6
lines changed
Expand file tree Collapse file tree 1 file changed +13
-6
lines changed Original file line number Diff line number Diff line change @@ -125,14 +125,21 @@ async def claim_channel(self, message: discord.Message) -> None:
125125 """
126126 log .info (f"Channel #{ message .channel } was claimed by `{ message .author .id } `." )
127127 await self .move_to_in_use (message .channel )
128- await self ._handle_role_change (message .author , message .author .add_roles )
129128
130- await _message .pin (message )
129+ # Handle odd edge case of `message.author` not being a `discord.Member` (see bot#1839)
130+ if not isinstance (message .author , discord .Member ):
131+ log .warning (
132+ f"{ message .author } ({ message .author .id } ) isn't a member. Not giving cooldown role or sending DM."
133+ )
134+ else :
135+ await self ._handle_role_change (message .author , message .author .add_roles )
131136
132- try :
133- await _message .dm_on_open (message )
134- except Exception as e :
135- log .warning ("Error occurred while sending DM:" , exc_info = e )
137+ try :
138+ await _message .dm_on_open (message )
139+ except Exception as e :
140+ log .warning ("Error occurred while sending DM:" , exc_info = e )
141+
142+ await _message .pin (message )
136143
137144 # Add user with channel for dormant check.
138145 await _caches .claimants .set (message .channel .id , message .author .id )
You can’t perform that action at this time.
0 commit comments