mirror of
https://github.com/michivonah/themepark-alerts.git
synced 2025-12-22 20:36:27 +01:00
create discord bot test
This commit is contained in:
parent
7ccbf89b9f
commit
99d3cea8b0
3 changed files with 21 additions and 2 deletions
10
discord2.py
Normal file
10
discord2.py
Normal file
|
|
@ -0,0 +1,10 @@
|
|||
import os
|
||||
from dotenv import load_dotenv
|
||||
from discord_webhook import DiscordWebhook
|
||||
|
||||
load_dotenv()
|
||||
|
||||
webhookUrl = os.getenv('DISCORD_WEBHOOK')
|
||||
|
||||
webhook = DiscordWebhook(url=webhookUrl, content="Test")
|
||||
response = webhook.execute()
|
||||
10
main.py
10
main.py
|
|
@ -1,4 +1,9 @@
|
|||
import requests
|
||||
import os
|
||||
from dotenv import load_dotenv
|
||||
from discord_webhook import DiscordWebhook
|
||||
|
||||
load_dotenv()
|
||||
|
||||
endpoint = "https://api.wartezeiten.app/v1/waitingtimes"
|
||||
|
||||
|
|
@ -11,4 +16,7 @@ req = requests.get(url = endpoint, params = header)
|
|||
|
||||
result = req.json()
|
||||
|
||||
print(result)
|
||||
webhookUrl = os.getenv('DISCORD_WEBHOOK')
|
||||
|
||||
webhook = DiscordWebhook(url=webhookUrl, content=result)
|
||||
response = webhook.execute()
|
||||
|
|
|
|||
|
|
@ -1,3 +1,4 @@
|
|||
# requirements.txt
|
||||
python-dotenv
|
||||
discord.py
|
||||
discord.py
|
||||
discord-webhook
|
||||
Loading…
Add table
Add a link
Reference in a new issue