From 424117159112d143aaf533bd8832af4e3414efd9 Mon Sep 17 00:00:00 2001 From: WhatDidYouExpect <89535984+WhatDidYouExpect@users.noreply.github.com> Date: Wed, 26 Feb 2025 21:20:18 +0100 Subject: [PATCH] Create songchanger --- customcommands/songchanger | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) create mode 100644 customcommands/songchanger diff --git a/customcommands/songchanger b/customcommands/songchanger new file mode 100644 index 0000000..280e85d --- /dev/null +++ b/customcommands/songchanger @@ -0,0 +1,19 @@ +import discord +from discord.ext import commands +from config import RED, GREEN, RESET +class songchange(commands.Cog): + def __init__(self, bot): + self.bot = bot + + @commands.command() + async def changesong(self, ctx): + await ctx.send("Check the terminal! (this does not persist across restarts)") + song = input("\nEnter a song:\n") + try: + await self.bot.change_presence(activity=discord.Activity(type=discord.ActivityType.listening, name=f"{song}")) + print(f"{GREEN}Changed song to {song}") + except Exception as e: + print(f"{RED}An error occurred while changing songs..: {str(e)}{RESET}") + +async def setup(bot): + await bot.add_cog(songchange(bot))