mirror of
https://github.com/uhIgnacio/EmoteManager.git
synced 2024-08-15 02:23:13 +00:00
stats: fix reloading the cog (discord token is popped after launch)
This commit is contained in:
parent
e284b9ee62
commit
8739902754
2 changed files with 5 additions and 4 deletions
|
@ -23,10 +23,7 @@ class Stats(BotBinStats):
|
|||
super().__init__(bot)
|
||||
seq = [0] * self.bot.shard_count if self.is_opener() else None
|
||||
# Use our user ID as part of the shm name to allow running multiple instances of the bot on the same machine.
|
||||
# on_ready() hasn't run yet, so we don't have self.bot.user.
|
||||
token = self.bot.config['tokens']['discord']
|
||||
user_id = token.partition('.')[0]
|
||||
self.shlist = ShareableList(seq, name=f'emote-manager-{user_id}')
|
||||
self.shlist = ShareableList(seq, name=f'emote-manager-{self.bot.user_id}')
|
||||
|
||||
def is_opener(self):
|
||||
"""return whether this is the process that should open the shared memory"""
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue