From 0179e98135f1bc112a2a47c78a12574e3e6dbb87 Mon Sep 17 00:00:00 2001 From: strNophix Date: Sun, 31 Oct 2021 12:26:00 +0100 Subject: [PATCH] Using prefix from config for presence --- bot.py | 17 +++++++++++------ 1 file changed, 11 insertions(+), 6 deletions(-) diff --git a/bot.py b/bot.py index bbae001..11e334f 100644 --- a/bot.py +++ b/bot.py @@ -1,4 +1,5 @@ import discord +from discord import ActivityType from discord.colour import Color from discord.ext import commands, tasks import sys @@ -72,15 +73,19 @@ class ChristmasBot(commands.Bot): colour_dict[name] = Color(int(color, 16)) return colour_dict - @tasks.loop(seconds=20) + @tasks.loop(seconds=30) async def update_status(self): await self.wait_until_ready() - title = "ck!connect | ck!help" - if self.rpc_is_help_message: - title = "Tfoe broer" - self.rpc_is_help_message = not self.rpc_is_help_message - await self.change_presence(activity=discord.Game(title)) + bot_prefix = self.config["prefixes"][0] + if self.rpc_is_help_message: + title = f"for {bot_prefix}connect | {bot_prefix}help" + activity = discord.Activity(name=title, type=ActivityType.watching) + else: + activity = discord.Activity(name="Some song", type=ActivityType.playing) + + self.rpc_is_help_message = not self.rpc_is_help_message + await self.change_presence(activity=activity) if __name__ == "__main__":