diff --git a/.vscode/settings.json b/.vscode/settings.json index f0242a5..1dcc1b9 100644 --- a/.vscode/settings.json +++ b/.vscode/settings.json @@ -1,3 +1,3 @@ { - "python.pythonPath": "C:\\Users\\jonas\\AppData\\Local\\Programs\\Python\\Python38\\python.exe" + "python.pythonPath": "C:\\Users\\jonasled\\AppData\\Local\\Programs\\Python\\Python39\\python.exe" } \ No newline at end of file diff --git a/bot.py b/bot.py index e91187e..3b08b21 100644 --- a/bot.py +++ b/bot.py @@ -1,6 +1,6 @@ #!/usr/bin/env python3 import discord -from discord.ext import commands +from discord.ext import commands, tasks from discord.utils import get from sqlite3 import connect from datetime import datetime @@ -771,6 +771,12 @@ async def checkForNextSong(): # background task, that runs every second and che except: pass +@tasks.loop(seconds=60) +async def hearBeat(): + if(heartBeatEnabled): + r = get(heartBeatURL) + +hearBeat.start() bot.loop.create_task(checkForNextSong()) # start the music bot task in background bot.run(token, bot=botAccount) # start the bot with the options in config.py diff --git a/config_example.py b/config_example.py index 325d55c..119d1cf 100644 --- a/config_example.py +++ b/config_example.py @@ -20,4 +20,8 @@ base = 10 factor = 1.1 messageXP = 2 #The XP you get for every message reactionXP = 1 #The XP you get for every reaction -minutesPerVcXP = 3 #The number of minutes you have to be online on the voicechat to get 1XP \ No newline at end of file +minutesPerVcXP = 3 #The number of minutes you have to be online on the voicechat to get 1XP + +# heart beat +heartBeatEnabled = False +heartBeatURL = "https://google.de" \ No newline at end of file