File tree Expand file tree Collapse file tree 1 file changed +11
-6
lines changed
Expand file tree Collapse file tree 1 file changed +11
-6
lines changed Original file line number Diff line number Diff line change @@ -125,14 +125,19 @@ 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` being a `discord.User` (see bot#1839)
130+ if isinstance (message .author , discord .User ):
131+ log .warning ("`message.author` is a `discord.User` so not handling role change or sending DM." )
132+ else :
133+ await self ._handle_role_change (message .author , message .author .add_roles )
131134
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 )
135+ try :
136+ await _message .dm_on_open (message )
137+ except Exception as e :
138+ log .warning ("Error occurred while sending DM:" , exc_info = e )
139+
140+ await _message .pin (message )
136141
137142 # Add user with channel for dormant check.
138143 await _caches .claimants .set (message .channel .id , message .author .id )
You can’t perform that action at this time.
0 commit comments