diff --git a/bot.py b/bot.py index 08ca2a5..f787f79 100644 --- a/bot.py +++ b/bot.py @@ -292,7 +292,7 @@ logger.info("Done") # *=========================================== Create Client logger.info("Creating discord bot") client = commands.Bot(intents=intents, command_prefix="$") -client.add_cog(voice_recognition.Transcriber(client)) +client.load_extension("voice_recognition") logger.info("Done") logger.info("Creating flask app") logger.info("Done") diff --git a/voice_recognition.py b/voice_recognition.py index e11b5ab..1e18a74 100644 --- a/voice_recognition.py +++ b/voice_recognition.py @@ -30,7 +30,7 @@ class Transcriber(commands.Cog): if channel is not None: await channel.send(f'Witaj u Nas {member.mention}.') - @commands.command() + @commands.hybrid_command() async def witaj(self, ctx, *, member: discord.Member = None): """Says hello""" member = member or ctx.author @@ -49,3 +49,6 @@ class Transcriber(commands.Cog): ) for utterance in transcript.utterances: print(f"Speaker {utterance.speaker}: {utterance.text}") + +def setup(bot): + bot.add_cog(Transcriber(bot)) \ No newline at end of file