Compare commits
4
Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
a4c02b2f77 | ||
|
|
8d8af9ab35 | ||
|
|
f70a7989ae | ||
|
|
fb909c009a |
@@ -1,6 +1,10 @@
|
||||
name: build_develop
|
||||
|
||||
on: [push]
|
||||
on:
|
||||
push:
|
||||
branches:
|
||||
- '*'
|
||||
- '!main'
|
||||
|
||||
jobs:
|
||||
build:
|
||||
@@ -18,7 +22,9 @@ jobs:
|
||||
registry: gitea.cheezers.org
|
||||
username: imcompiling
|
||||
password: ${{ secrets.PASSWORD }}
|
||||
- name: set env
|
||||
run: echo "GIT_BRANCH=${GITHUB_HEAD_REF:-${GITHUB_REF#refs/heads/}}" >> $GITHUB_ENV
|
||||
- name: Build Docker Image
|
||||
run: docker build -t gitea.cheezers.org/imcompiling/dakiny-bot:develop .
|
||||
run: docker build -t gitea.cheezers.org/imcompiling/dakiny-bot:${{env.GIT_BRANCH}} .
|
||||
- name: Push Docker Image
|
||||
run: docker push gitea.cheezers.org/imcompiling/dakiny-bot:develop
|
||||
run: docker push gitea.cheezers.org/imcompiling/dakiny-bot:${{env.GIT_BRANCH}}
|
||||
|
||||
@@ -20,16 +20,15 @@ class ElectionCycle:
|
||||
"""
|
||||
|
||||
def __init__(self, cycle: int, config: DakinyConfig, guild: nextcord.Guild) -> None:
|
||||
# TODO update
|
||||
"""
|
||||
Generates all dates relevant to the election cycle from input election start, term start and end dates.
|
||||
Generates all dates relevant to the election cycle determined by the config and cycle.
|
||||
|
||||
Args:
|
||||
election_start (datetime): Date the election cycle starts.
|
||||
term_start (datetime): Date the term being elected starts.
|
||||
term_end (datetime): Date the term being elected ends.
|
||||
bot: the discord bot instance
|
||||
cycle (int): Which election cycle this cycle is.
|
||||
config (DakinyConfig): The entire config object.
|
||||
guild (nextcord.Guild): The guild that this election is running in.
|
||||
"""
|
||||
|
||||
self.config: DakinyConfig = config
|
||||
self.cycle = cycle
|
||||
self.elecion_cycle = self.config.election_cycles[self.cycle]
|
||||
@@ -56,7 +55,9 @@ class ElectionCycle:
|
||||
with open("bot_messages/election_announcement.txt", mode="r", encoding="utf8") as file:
|
||||
message = file.read()
|
||||
|
||||
next_election = get_datetime(self.config.election_cycles[(self.cycle + 1) % 4].election_start)
|
||||
next_election = get_datetime(
|
||||
self.config.election_cycles[(self.cycle + 1) % len(self.config.election_cycles)].election_start
|
||||
)
|
||||
|
||||
message = message.format(
|
||||
clan_council_id=self.config.params.clan_council_role_id,
|
||||
|
||||
@@ -115,7 +115,7 @@ class DailyLoop(commands.Cog, name="Daily Loop"):
|
||||
|
||||
today = datetime.today()
|
||||
guild: nextcord.Guild = self.bot.get_guild(self.bot.config.params.guild_id)
|
||||
announce_channel: nextcord.TextChannel = guild.get_channel(self.bot.config.params.announcement_category_id)
|
||||
announce_channel: nextcord.TextChannel = guild.get_channel(self.bot.config.params.general_channel_id)
|
||||
|
||||
cakedays: list[nextcord.Member] = [
|
||||
human for human in guild.humans if human.joined_at.month == today.month and human.joined_at.day == today.day
|
||||
|
||||
Reference in New Issue
Block a user