Use discord game status immediately after logging in

This commit is contained in:
Jeremy Zhang 2019-03-05 19:49:08 +00:00
parent ce205daa0e
commit 29c1d8bfda

View File

@ -28,7 +28,10 @@ except AttributeError:
class Titan(discord.AutoShardedClient): class Titan(discord.AutoShardedClient):
def __init__(self): def __init__(self):
super().__init__(max_messages=10000) super().__init__(
max_messages=10000,
activity=discord.Game(name="Embed your Discord server! Visit https://TitanEmbeds.com/")
)
self.aiosession = aiohttp.ClientSession(loop=self.loop) self.aiosession = aiohttp.ClientSession(loop=self.loop)
self.http.user_agent += ' TitanEmbeds-Bot' self.http.user_agent += ' TitanEmbeds-Bot'
self.redisqueue = RedisQueue(self, config["redis-uri"]) self.redisqueue = RedisQueue(self, config["redis-uri"])
@ -80,9 +83,6 @@ class Titan(discord.AutoShardedClient):
print("Shard count: " + str(self.shard_count)) print("Shard count: " + str(self.shard_count))
print("------") print("------")
game = discord.Game(name="Embed your Discord server! Visit https://TitanEmbeds.com/")
await self.change_presence(status=discord.Status.online, activity=game)
self.discordBotsOrg = DiscordBotsOrg(self.user.id, config.get("discord-bots-org-token", None)) self.discordBotsOrg = DiscordBotsOrg(self.user.id, config.get("discord-bots-org-token", None))
self.botsDiscordPw = BotsDiscordPw(self.user.id, config.get("bots-discord-pw-token", None)) self.botsDiscordPw = BotsDiscordPw(self.user.id, config.get("bots-discord-pw-token", None))
await self.postStats() await self.postStats()