diff --git a/kabot/kabot/Audio/others/kadEtOlivier/Jean Charles Avous et Jean Michel Yaourt par Kad et O-xaddht.mp3 b/kabot/kabot/Audio/others/kadEtOlivier/Jean Charles Avous et Jean Michel Yaourt par Kad et O-xaddht.mp3 new file mode 100644 index 0000000..6abbb06 Binary files /dev/null and b/kabot/kabot/Audio/others/kadEtOlivier/Jean Charles Avous et Jean Michel Yaourt par Kad et O-xaddht.mp3 differ diff --git a/kabot/kabot/kabot.py b/kabot/kabot/kabot.py index 0cdf21f..a365a55 100644 --- a/kabot/kabot/kabot.py +++ b/kabot/kabot/kabot.py @@ -31,12 +31,11 @@ class Mybot(commands.Cog): async def disconnect(self, ctx): await ctx.guild.voice_client.disconnect() + @commands.guild_only() @commands.command() async def joke(self, ctx, folder=None): - if ctx.message.author.name == self.bot.user.name: - return user = ctx.message.author.name - if not folder: + if not folder or not ctx.message.content: audio_file = random.choice([f for f in Path('/home/mika/kabot/kabot/kabot/Audio/').glob('**/*.mp3')]) else: folder = folder.lower() @@ -152,11 +151,11 @@ def main(): for channel in bot.get_all_channels(): if channel.name == "Général" and\ len(channel.members) > 1 and\ - random.choice([True,False,False]): + random.choice([True,True,True]): for channel in bot.get_all_channels(): if channel.name == "général": current_chan = channel - sleep(choice(range(350))) + #sleep(random.choice(range(350))) ctx = await bot.get_context(current_chan.last_message) ctx.message.content = "" joke = bot.get_command('joke')