Create loop, setup docker file for testing.
This commit is contained in:
@@ -0,0 +1,15 @@
|
||||
"""
|
||||
Initializing code for all loops.
|
||||
"""
|
||||
|
||||
from nextcord.ext import commands
|
||||
|
||||
from .daily_loop import DailyLoop
|
||||
|
||||
|
||||
def setup(bot: commands.Bot):
|
||||
"""
|
||||
Adds functions to bot.
|
||||
"""
|
||||
|
||||
bot.add_cog(DailyLoop(bot))
|
||||
@@ -0,0 +1,23 @@
|
||||
"""
|
||||
_summary_
|
||||
"""
|
||||
|
||||
import nextcord
|
||||
from nextcord.ext import commands, tasks
|
||||
from datetime import time
|
||||
from pytz import timezone
|
||||
|
||||
|
||||
class DailyLoop(commands.Cog, name="Daily Loop"):
|
||||
"""
|
||||
Class for performing daily functions.
|
||||
"""
|
||||
|
||||
def __init__(self, bot: commands.Bot) -> None:
|
||||
self.bot = bot
|
||||
|
||||
@tasks.loop(time=time(hour=0, tzinfo=timezone("GMT")))
|
||||
async def do_thing(self):
|
||||
""" """
|
||||
imcompiling: nextcord.User = await self.bot.fetch_user(206602713511886849)
|
||||
await imcompiling.send("its reset in runescape")
|
||||
Reference in New Issue
Block a user