Skip to content

Commit

Permalink
Merge pull request #284 from SylteA/dev
Browse files Browse the repository at this point in the history
AOC migration ++
  • Loading branch information
SylteA authored Nov 30, 2023
2 parents fb79930 + 416e585 commit ab7ac58
Show file tree
Hide file tree
Showing 13 changed files with 439 additions and 498 deletions.
311 changes: 0 additions & 311 deletions bot/cogs/adventofcode.py

This file was deleted.

2 changes: 1 addition & 1 deletion bot/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
class AoC(BaseModel):
channel_id: int
role_id: int
leaderboard_code: str
session_cookie: str


Expand Down Expand Up @@ -97,7 +98,6 @@ class CustomRoles(BaseModel):

class YouTube(BaseModel):
channel_id: str

text_channel_id: int
role_id: int

Expand Down
9 changes: 9 additions & 0 deletions bot/extensions/adventofcode/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
from bot.core import DiscordBot

from .commands import AdventOfCode
from .tasks import AdventOfCodeTasks


async def setup(bot: DiscordBot) -> None:
await bot.add_cog(AdventOfCode(bot=bot))
await bot.add_cog(AdventOfCodeTasks(bot=bot))
18 changes: 18 additions & 0 deletions bot/extensions/adventofcode/commands.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
from discord import app_commands
from discord.ext import commands

from bot import core
from bot.extensions.adventofcode.utils import home_embed
from bot.extensions.adventofcode.views import CreateAdventOfCodeView


class AdventOfCode(commands.Cog):
def __init__(self, bot):
self.bot = bot
self._create_aoc_view = CreateAdventOfCodeView(timeout=None)
self.bot.add_view(self._create_aoc_view)

@app_commands.command(name="advent-of-code")
async def advent_of_code(self, interaction: core.InteractionType):
"""Returns information about the Advent of Code"""
await interaction.response.send_message(embed=home_embed(), ephemeral=True, view=self._create_aoc_view)
Loading

0 comments on commit ab7ac58

Please sign in to comment.