Compare commits
8
Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
0f05751ce8 | ||
|
|
d32c27c291 | ||
|
|
391c36e7f2 | ||
|
|
846df89510 | ||
|
|
1eaa90e9cf | ||
|
|
9d2382bf1d | ||
|
|
b8b10279cb | ||
|
|
9b9420d2a4 |
@@ -0,0 +1,18 @@
|
|||||||
|
name: build_develop
|
||||||
|
|
||||||
|
on: [push]
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
build:
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
steps:
|
||||||
|
- name: Checkout Code
|
||||||
|
uses: actions/checkout@v3
|
||||||
|
with:
|
||||||
|
fetch-depth: 0
|
||||||
|
- name: Install Docker
|
||||||
|
uses: https://github.com/papodaca/install-docker-action@v1
|
||||||
|
- name: Build Docker Image
|
||||||
|
run: docker build -t viker.cheezers.net:5000/dakiny-bot:develop .
|
||||||
|
- name: Push Docker Image
|
||||||
|
run: docker push viker.cheezers.net:5000/dakiny-bot:develop
|
||||||
@@ -0,0 +1,20 @@
|
|||||||
|
name: build_develop
|
||||||
|
|
||||||
|
on:
|
||||||
|
push:
|
||||||
|
branches: [main]
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
build:
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
steps:
|
||||||
|
- name: Checkout Code
|
||||||
|
uses: actions/checkout@v3
|
||||||
|
with:
|
||||||
|
fetch-depth: 0
|
||||||
|
- name: Install Docker
|
||||||
|
uses: https://github.com/papodaca/install-docker-action@v1
|
||||||
|
- name: Build Docker Image
|
||||||
|
run: docker build -t viker.cheezers.net:5000/dakiny-bot:latest .
|
||||||
|
- name: Push Docker Image
|
||||||
|
run: docker push viker.cheezers.net:5000/dakiny-bot:latest
|
||||||
@@ -137,3 +137,5 @@ deleted_backups/
|
|||||||
highscores_data/
|
highscores_data/
|
||||||
TODO.txt
|
TODO.txt
|
||||||
sql_tester.py
|
sql_tester.py
|
||||||
|
conf
|
||||||
|
outputs
|
||||||
|
|||||||
@@ -11,6 +11,7 @@ COPY cogs cogs/
|
|||||||
COPY dakiny_bot.py dakiny_bot.py
|
COPY dakiny_bot.py dakiny_bot.py
|
||||||
COPY requirements.txt requirements.txt
|
COPY requirements.txt requirements.txt
|
||||||
COPY config.py config.py
|
COPY config.py config.py
|
||||||
|
COPY config.yml config.yml
|
||||||
|
|
||||||
RUN pip install -r requirements.txt
|
RUN pip install -r requirements.txt
|
||||||
|
|
||||||
|
|||||||
@@ -1,8 +1,28 @@
|
|||||||
import os
|
from dataclasses import dataclass
|
||||||
|
from datetime import datetime
|
||||||
|
|
||||||
from dotenv.main import load_dotenv
|
|
||||||
|
|
||||||
load_dotenv()
|
@dataclass
|
||||||
|
class Params:
|
||||||
|
voting_emote_id: int
|
||||||
|
annoucement_channel_id: int
|
||||||
|
archive_channel_group_id: int
|
||||||
|
clan_council_role_id: int
|
||||||
|
clan_council_elect_role_id: int
|
||||||
|
discord_token: str
|
||||||
|
|
||||||
# Discord config
|
|
||||||
DISCORD_TOKEN = os.getenv("DISCORD_TOKEN", "")
|
@dataclass
|
||||||
|
class ElectionCycle:
|
||||||
|
election_start: datetime
|
||||||
|
voting_start: datetime
|
||||||
|
voting_end: datetime
|
||||||
|
term_start: datetime
|
||||||
|
term_end: datetime
|
||||||
|
name: str
|
||||||
|
|
||||||
|
|
||||||
|
@dataclass
|
||||||
|
class DakinyConfig:
|
||||||
|
params: Params
|
||||||
|
cycles: list[ElectionCycle]
|
||||||
|
|||||||
+11
-3
@@ -1,12 +1,19 @@
|
|||||||
import os
|
import os
|
||||||
|
import sys
|
||||||
|
|
||||||
|
import hydra
|
||||||
import nextcord
|
import nextcord
|
||||||
|
from hydra.core.config_store import ConfigStore
|
||||||
from nextcord.ext import commands
|
from nextcord.ext import commands
|
||||||
|
|
||||||
import config
|
from config import DakinyConfig
|
||||||
|
|
||||||
|
cs = ConfigStore.instance()
|
||||||
|
cs.store(name="dakiny_config", node=DakinyConfig)
|
||||||
|
|
||||||
|
|
||||||
def main():
|
@hydra.main(config_path="conf", config_name="config")
|
||||||
|
def main(cfg: DakinyConfig):
|
||||||
# Allows privledged intents for monitoring members joining, roles editing, and role assignments
|
# Allows privledged intents for monitoring members joining, roles editing, and role assignments
|
||||||
# These need to be enabled in the developer portal as well
|
# These need to be enabled in the developer portal as well
|
||||||
intents = nextcord.Intents.default()
|
intents = nextcord.Intents.default()
|
||||||
@@ -33,8 +40,9 @@ def main():
|
|||||||
print(f"{bot.user.name} has connected to Discord!")
|
print(f"{bot.user.name} has connected to Discord!")
|
||||||
|
|
||||||
# Run Discord bot
|
# Run Discord bot
|
||||||
bot.run(config.DISCORD_TOKEN)
|
bot.run(cfg.params.discord_token)
|
||||||
|
|
||||||
|
|
||||||
if __name__ == "__main__":
|
if __name__ == "__main__":
|
||||||
|
sys.argv.append("hydra.job.chdir=False")
|
||||||
main()
|
main()
|
||||||
|
|||||||
+2
-1
@@ -1,3 +1,4 @@
|
|||||||
nextcord==2.4.2
|
nextcord==2.4.2
|
||||||
python-dotenv==1.0.0
|
python-dotenv==1.0.0
|
||||||
pytz==2022.7.1
|
pytz==2022.7.1
|
||||||
|
hydra-core==1.3.2
|
||||||
Reference in New Issue
Block a user