mirror of
https://github.com/Matthww/TuneBot.git
synced 2026-09-21 20:47:44 +00:00
Using prefix from config for presence
This commit is contained in:
@@ -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__":
|
||||
|
||||
Reference in New Issue
Block a user