I am making d-day count and notice bot in discord now. i need my bot to send d-day count message every 12 hours. how can i make that happen??
import discord
from discord.ext import commands
from bs4 import BeautifulSoup as bs
import asyncio
import requests
bot = commands.Bot(command_prefix='?')
html = requests.get('https://superkts.com/cal/d_day/20200504')
soup = bs(html.text, 'html.parser')
data1 = soup.find('article', {'class': 'result'}).text
html = requests.get('https://superkts.com/cal/d_day/20201203')
soup = bs(html.text, 'html.parser')
data2 = soup.find('article', {'class': 'result'}).text
html = requests.get('https://superkts.com/cal/d_day/20220105')
soup = bs(html.text, 'html.parser')
data3 = soup.find('article', {'class': 'result'}).text
@bot.event
async def on_ready():
print('Logged in as')
print(bot.user.name)
print(bot.user.id)
print('------')
@bot.command()
async def notice(ctx):
await ctx.send("문준영 입대" + data1)
await ctx.send("신원호 수능" + data2)
await ctx.send("김수한 전역" + data3)
bot.run('TOKEN')