From 0ec2bd00db019d03afa182e66df038a20a2b02ec Mon Sep 17 00:00:00 2001 From: Jonas Leder Date: Fri, 10 Apr 2020 20:41:29 +0200 Subject: [PATCH] if user sends private a string with time, send the time --- bot.py | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/bot.py b/bot.py index 916d1e1..e1509be 100644 --- a/bot.py +++ b/bot.py @@ -58,6 +58,11 @@ async def on_ready(): @bot.event async def on_message(message):#this will run on every message + if (message.guild == None) and "time" in message.content: + current_time = datetime.now().strftime("%H:%M:%S") + await message.author.send("Current time: " + current_time) + return + print(str(message.author) + " sent: " + str(message.content) + ", latency: " + str(bot.latency) + " ms, Bot: " + str(message.author.bot)) #print some information about the message to the console if(message.author.bot) or (message.author.id == bot.user.id): #check if the bot has written the message, if yes stop parsing it return @@ -417,7 +422,7 @@ async def skip(ctx): player.stop() await ctx.message.channel.send("Skipped current song") -@bot.command(brief="Prints the current que") +@bot.command(brief="Prints the current music que") async def que(ctx): global titleQue message = "**Musicbot Que:**\n **[current]** " + titleQue[0] @@ -427,8 +432,7 @@ async def que(ctx): await ctx.message.channel.send(message) - - + async def checkForNextSong(): global player global playerQue