1
0
Fork 0
mirror of https://gitlab.jonasled.de/jonasled/discordbot synced 2024-05-17 22:15:52 +02:00

add heart beat

This commit is contained in:
jonasled 2021-03-11 21:15:02 +01:00
parent dafa9bcf1f
commit c7ee751fcc
3 changed files with 13 additions and 3 deletions

View file

@ -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"
} }

8
bot.py
View file

@ -1,6 +1,6 @@
#!/usr/bin/env python3 #!/usr/bin/env python3
import discord import discord
from discord.ext import commands from discord.ext import commands, tasks
from discord.utils import get from discord.utils import get
from sqlite3 import connect from sqlite3 import connect
from datetime import datetime from datetime import datetime
@ -771,6 +771,12 @@ async def checkForNextSong(): # background task, that runs every second and che
except: except:
pass 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.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 bot.run(token, bot=botAccount) # start the bot with the options in config.py

View file

@ -20,4 +20,8 @@ base = 10
factor = 1.1 factor = 1.1
messageXP = 2 #The XP you get for every message messageXP = 2 #The XP you get for every message
reactionXP = 1 #The XP you get for every reaction 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 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"