Skip to content

Commit 7cc41fd

Browse files
committed
feat(renaming): Change 'browser' and 'device' in IDENTIFY payload to 'discord4py'
Signed-off-by: Mathieu Corsham <McCuber04@outlook.de>
1 parent 1ded164 commit 7cc41fd

File tree

1 file changed

+9
-2
lines changed

1 file changed

+9
-2
lines changed

discord/gateway.py

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -59,6 +59,12 @@
5959
'ReconnectWebSocket',
6060
)
6161

62+
# if you want to show your bot as online on mobile, change this to
63+
# BROWSER = 'discord'
64+
# DEVICE = 'android'
65+
BROWSER = 'discord4py'
66+
DEVICE = 'discord4py'
67+
6268

6369
class ReconnectWebSocket(Exception):
6470
"""Signals to safely reconnect the websocket."""
@@ -388,8 +394,8 @@ async def identify(self):
388394
'token': self.token,
389395
'properties': {
390396
'os': sys.platform,
391-
'browser': 'discord.py-message-components',
392-
'device': 'discord.py-message-components',
397+
'browser': BROWSER,
398+
'device': DEVICE,
393399
'referrer': '',
394400
'referring_domain': ''
395401
},
@@ -550,6 +556,7 @@ async def received_message(self, msg: Union[bytes, str]):
550556
func = self._discord_parsers[event]
551557
except KeyError:
552558
log.debug('Unknown event %s.', event)
559+
log.info(f'Unknown event %s! Please report this to the library developers!', event)
553560
else:
554561
func(data)
555562

0 commit comments

Comments
 (0)