refactor repeated messages cog

This commit is contained in:
LBlend committed 2022-11-15 00:42:57 +01:00
1 parent 31e4397778
commit ae9853d522
1 file changed
+12 -16
+12 -16
View File
@@ -1,36 +1,32 @@
from discord.ext import commands
import aiocron
from discord.ext import commands
class RepeatedMessages(commands.Cog):
def __init__(self, bot):
self.bot = bot
uio_gaming = self.bot.get_guild(747542543750660178)
self.uiog_general = uio_gaming.get_channel(747542544291987597)
@aiocron.crontab("0 0 * * 5")
async def fredag():
guild = self.bot.get_guild(747542543750660178)
channel = guild.get_channel(747542544291987597)
await channel.send(
"NU ÄR DET FREDAG!\n"
+ "https://cdn.discordapp.com/attachments/750052141346979850/851216786259181578/video0.mp4"
await self.uiog_general.send(
"NU ÄR DET FREDAG!\n" + \
"https://cdn.discordapp.com/attachments/750052141346979850/851216786259181578/video0.mp4"
)
@aiocron.crontab("0 0 * * 1")
async def mandag():
guild = self.bot.get_guild(747542543750660178)
channel = guild.get_channel(747542544291987597)
await channel.send(
"ENDELIG MANDAG!\n\n"
+ "https://cdn.discordapp.com/attachments/678396498089738250/862853827278929940/hvorfor_de_rike_br_spises.mp4"
await self.uiog_general.send(
"ENDELIG MANDAG!\n\n" + \
"https://cdn.discordapp.com/attachments/678396498089738250/862853827278929940/hvorfor_de_rike_br_spises.mp4"
)
@aiocron.crontab("0 0 1 1 *")
async def new_year():
guild = self.bot.get_guild(747542543750660178)
channel = guild.get_channel(747542544291987597)
await channel.send(
"GODT NYTTÅR!\n\nNå, meld dere inn i UiO Gaming igjen <:ThisIsAThreat:874998234072903710>\nhttps://youtu.be/5qXkEvHrZ-0"
await self.uiog_general.send(
"GODT NYTTÅR!\n\nNå, meld dere inn i UiO Gaming igjen <:ThisIsAThreat:874998234072903710>"
)