first commit

This commit is contained in:
Boyan 2022-04-26 12:12:47 +03:00
parent 5b6a2d56a2
commit b25e4cfdca

22
main.py Normal file
View File

@ -0,0 +1,22 @@
import discord
import requests
from config import TOKEN
from time import sleep
bot = discord.Client()
@bot.event
async def on_ready():
print(f'{bot.user} has connected to Discord!')
channel = bot.get_channel(968428874268565516) # Gets channel from internal cache
emplist = []
while True:
r = requests.get("https://www.sshxl.nl/api/v1/offering/filters?ContingentId=9cf71a6e-5917-4227-8542-8a9821e282d2&DemographicId=d60a9752-8e1e-44e9-850b-8fd0de628005&MainPeriodId=8cfc9ef2-57b9-4193-8595-5e3ec2dbfd27",verify=False).json()
interest = r["RentalPeriods"]
if interest not in emplist:
emplist.append(interest)
await channel.send("New entry to the page!!!") # Sends message to channel
embed=discord.Embed(title=f"{interest[0].keys()}", description=f"{interest[0].values()}", color=0xFF5733)
await channel.send(embed=embed)
sleep(3600)
bot.run(TOKEN)