Compare commits
9
Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
e2e8d8de30 | ||
|
|
7f007ffa1f | ||
|
|
913f915bf0 | ||
|
|
02e7a6df3a | ||
|
|
7be869b2b6 | ||
|
|
15c4776918 | ||
|
|
d3102b57cc | ||
|
|
9bef20de5b | ||
|
|
9231c04c6a |
@@ -14,7 +14,13 @@ jobs:
|
|||||||
fetch-depth: 0
|
fetch-depth: 0
|
||||||
- name: Install Docker
|
- name: Install Docker
|
||||||
uses: https://github.com/papodaca/install-docker-action@v1
|
uses: https://github.com/papodaca/install-docker-action@v1
|
||||||
|
- name: Log into container registry
|
||||||
|
uses: docker/login-action@v2
|
||||||
|
with:
|
||||||
|
registry: gitea.cheezers.org
|
||||||
|
username: imcompiling
|
||||||
|
password: ${{ secrets.PASSWORD }}
|
||||||
- name: Build Docker Image
|
- name: Build Docker Image
|
||||||
run: docker build -t viker.cheezers.net:5000/agon:develop .
|
run: docker build -t gitea.cheezers.org/imcompiling/agon:develop .
|
||||||
- name: Push Docker Image
|
- name: Push Docker Image
|
||||||
run: docker push viker.cheezers.net:5000/agon:develop
|
run: docker push gitea.cheezers.org/imcompiling/agon:develop
|
||||||
|
|||||||
@@ -14,11 +14,17 @@ jobs:
|
|||||||
fetch-depth: 0
|
fetch-depth: 0
|
||||||
- name: Install Docker
|
- name: Install Docker
|
||||||
uses: https://github.com/papodaca/install-docker-action@v1
|
uses: https://github.com/papodaca/install-docker-action@v1
|
||||||
|
- name: Log into container registry
|
||||||
|
uses: docker/login-action@v2
|
||||||
|
with:
|
||||||
|
registry: gitea.cheezers.org
|
||||||
|
username: imcompiling
|
||||||
|
password: ${{ secrets.PASSWORD }}
|
||||||
- name: Set env
|
- name: Set env
|
||||||
run: echo "GIT_TAG=${GITHUB_REF#refs/*/}" >> $GITHUB_ENV
|
run: echo "GIT_TAG=${GITHUB_REF#refs/*/}" >> $GITHUB_ENV
|
||||||
- name: Build Docker Images
|
- name: Build Docker Images
|
||||||
run: docker build -t viker.cheezers.net:5000/agon:latest -t viker.cheezers.net:5000/agon:${{env.GIT_TAG}} .
|
run: docker build -t gitea.cheezers.org/imcompiling/agon:latest -t gitea.cheezers.org/imcompiling/agon:${{env.GIT_TAG}} .
|
||||||
- name: Push Latest Image
|
- name: Push Latest Image
|
||||||
run: docker push viker.cheezers.net:5000/agon:latest
|
run: docker push gitea.cheezers.org/imcompiling/agon:latest
|
||||||
- name: Push Tagged Image
|
- name: Push Tagged Image
|
||||||
run: docker push viker.cheezers.net:5000/agon:${{env.GIT_TAG}}
|
run: docker push gitea.cheezers.org/imcompiling/agon:${{env.GIT_TAG}}
|
||||||
|
|||||||
@@ -183,11 +183,13 @@ class Submission:
|
|||||||
if state is SubmissionState.CATEGORY:
|
if state is SubmissionState.CATEGORY:
|
||||||
description = "Step 1: Choose your category!"
|
description = "Step 1: Choose your category!"
|
||||||
elif state is SubmissionState.SCORE:
|
elif state is SubmissionState.SCORE:
|
||||||
description = "Step 2: Input your score!"
|
description = "Step 2: Send a message to input your score!"
|
||||||
elif state is SubmissionState.PROOF:
|
elif state is SubmissionState.PROOF:
|
||||||
description = "Step 3: Submit your proof!"
|
description = "Step 3: Send a message with a picture attached to submit your proof!"
|
||||||
elif state is SubmissionState.NAME:
|
elif state is SubmissionState.NAME:
|
||||||
description = "Step 4 (Optional): Change name on submission! (proceed to next if skipping)"
|
description = (
|
||||||
|
"Step 4 (Optional): Send a message to change name on submission! (proceed to next if skipping)"
|
||||||
|
)
|
||||||
elif state is SubmissionState.SUBMIT:
|
elif state is SubmissionState.SUBMIT:
|
||||||
description = "Step 5: Submit if everything looks correct!"
|
description = "Step 5: Submit if everything looks correct!"
|
||||||
elif state is SubmissionState.VERIFY:
|
elif state is SubmissionState.VERIFY:
|
||||||
|
|||||||
@@ -40,7 +40,7 @@ class CreateCog(commands.Cog, name="Create Cog"):
|
|||||||
interaction: nextcord.Interaction,
|
interaction: nextcord.Interaction,
|
||||||
group_id: str = nextcord.SlashOption(name="group", description="Group to add Category to.", required=True),
|
group_id: str = nextcord.SlashOption(name="group", description="Group to add Category to.", required=True),
|
||||||
category_name: str = nextcord.SlashOption(description="Name of new Category.", required=True),
|
category_name: str = nextcord.SlashOption(description="Name of new Category.", required=True),
|
||||||
is_ascending: bool = nextcord.SlashOption(description="If higher value is better score.", required=True),
|
is_ascending: bool = nextcord.SlashOption(description="If lower value is a better score.", required=True),
|
||||||
is_time_record: bool = nextcord.SlashOption(
|
is_time_record: bool = nextcord.SlashOption(
|
||||||
description="If the score should be shown in time format. Cannot be changed.", required=True
|
description="If the score should be shown in time format. Cannot be changed.", required=True
|
||||||
),
|
),
|
||||||
|
|||||||
@@ -42,6 +42,5 @@ This channel will be where all user submission messages are sent.
|
|||||||
|
|
||||||
3.) Set up your highscore tables! Use "/create group" to first create a group message in the channel you would like and then use "/create category" to create a category in that group message!"""
|
3.) Set up your highscore tables! Use "/create group" to first create a group message in the channel you would like and then use "/create category" to create a category in that group message!"""
|
||||||
# pylint: enable=line-too-long
|
# pylint: enable=line-too-long
|
||||||
print(help_str)
|
|
||||||
|
|
||||||
await interaction.response.send_message(content=help_str)
|
await interaction.response.send_message(content=help_str)
|
||||||
|
|||||||
@@ -3,6 +3,7 @@ Defines cog for on message listener.
|
|||||||
"""
|
"""
|
||||||
|
|
||||||
import re
|
import re
|
||||||
|
from datetime import datetime
|
||||||
|
|
||||||
import nextcord
|
import nextcord
|
||||||
from nextcord.ext import commands
|
from nextcord.ext import commands
|
||||||
@@ -28,6 +29,8 @@ class SubmissionListener(commands.Cog, name="Message Listener"):
|
|||||||
if message.author.id == self.bot.user.id:
|
if message.author.id == self.bot.user.id:
|
||||||
return
|
return
|
||||||
|
|
||||||
|
await birthday_action(message)
|
||||||
|
|
||||||
guild_id = message.guild.id
|
guild_id = message.guild.id
|
||||||
|
|
||||||
if submission_objects.has_user(message.author.id):
|
if submission_objects.has_user(message.author.id):
|
||||||
@@ -45,7 +48,6 @@ class SubmissionListener(commands.Cog, name="Message Listener"):
|
|||||||
if message.channel.id == submission_channel_id:
|
if message.channel.id == submission_channel_id:
|
||||||
state = submission.submission_state
|
state = submission.submission_state
|
||||||
if state == SubmissionState.SCORE and message.content:
|
if state == SubmissionState.SCORE and message.content:
|
||||||
|
|
||||||
stmt = select(Category.IsTimeRecord).where(Category.CategoryId == submission.category_id)
|
stmt = select(Category.IsTimeRecord).where(Category.CategoryId == submission.category_id)
|
||||||
|
|
||||||
# check with regex if score matches correctly
|
# check with regex if score matches correctly
|
||||||
@@ -102,3 +104,19 @@ class SubmissionListener(commands.Cog, name="Message Listener"):
|
|||||||
def setup(bot: commands.Bot):
|
def setup(bot: commands.Bot):
|
||||||
"""Adds function to bot"""
|
"""Adds function to bot"""
|
||||||
bot.add_cog(SubmissionListener(bot))
|
bot.add_cog(SubmissionListener(bot))
|
||||||
|
|
||||||
|
|
||||||
|
async def birthday_action(message: nextcord.Message) -> None:
|
||||||
|
"""
|
||||||
|
Does the birthday thing, currently for chris only.
|
||||||
|
|
||||||
|
Args:
|
||||||
|
message (nextcord.Message): The message to check for birthday thing.
|
||||||
|
"""
|
||||||
|
|
||||||
|
today = datetime.today()
|
||||||
|
birthday = datetime(today.year, 7, 31)
|
||||||
|
chris = 642330132958281750
|
||||||
|
if today.date() == birthday.date():
|
||||||
|
if message.author.id == chris or chris in message.raw_mentions:
|
||||||
|
await message.add_reaction("🎂")
|
||||||
|
|||||||
@@ -231,6 +231,6 @@ class SubmissionView(nextcord.ui.View):
|
|||||||
|
|
||||||
return check
|
return check
|
||||||
|
|
||||||
async def on_timeout(self) -> None:
|
# async def on_timeout(self) -> None:
|
||||||
# remove user from submission objects after time out. Allows user to start new submission.
|
# # remove user from submission objects after time out. Allows user to start new submission.
|
||||||
submission_objects.remove_user_submission(self._submission_user)
|
# submission_objects.remove_user_submission(self._submission_user)
|
||||||
|
|||||||
Reference in New Issue
Block a user