mirror of
https://gitlab.jonasled.de/jonasled/discordbot
synced 2024-05-21 01:35:55 +02:00
add heart beat
This commit is contained in:
parent
dafa9bcf1f
commit
c7ee751fcc
2
.vscode/settings.json
vendored
2
.vscode/settings.json
vendored
|
@ -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
8
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
|
||||
|
|
|
@ -21,3 +21,7 @@ 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
|
||||
|
||||
# heart beat
|
||||
heartBeatEnabled = False
|
||||
heartBeatURL = "https://google.de"
|
Loading…
Reference in a new issue