Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

FOD Pride 2024 Badge + Minor Fixes #530

Merged
merged 4 commits into from
Jun 1, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions charts/agimus/Chart.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,5 +2,5 @@ apiVersion: v2
name: agimus
description: A helm chart for a discord bot that also runs a mysql db
type: application
version: v2.8.8
appVersion: v2.8.8
version: v2.9.0
appVersion: v2.9.0
7 changes: 4 additions & 3 deletions cogs/badge_tags.py
Original file line number Diff line number Diff line change
Expand Up @@ -167,11 +167,11 @@ async def callback(self, interaction:discord.Interaction):


class TagBadgeView(discord.ui.View):
def __init__(self, cog, user_discord_id, badge_info):
def __init__(self, cog, user_discord_id, badge_info, associated_tags):
super().__init__()
self.cog = cog
self.tag_ids = []
self.add_item(TagSelector(user_discord_id, badge_info))
self.add_item(TagSelector(user_discord_id, associated_tags))
self.add_item(TagButton(user_discord_id, badge_info))


Expand Down Expand Up @@ -462,8 +462,9 @@ async def tag(self, ctx:discord.ApplicationContext, badge:str):
return

badge_info = await db_get_badge_info_by_name(badge)
associated_tags = await db_get_associated_badge_tags(ctx.author.id, badge_info['badge_filename'])

view = TagBadgeView(self, ctx.author.id, badge_info)
view = TagBadgeView(self, ctx.author.id, badge_info, associated_tags)
embed = discord.Embed(
title=badge,
color=discord.Color.dark_purple()
Expand Down
30 changes: 17 additions & 13 deletions cogs/quiz.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,22 @@

command_config = config["commands"]["quiz start"]

# Load JSON Data
f = open(command_config["data"])
info_data = json.load(f)
f.close()

show_choices = []
show_keys = sorted(list(info_data.keys()), key=lambda k: info_data[k]['name'])
for show_key in show_keys:
show_data = info_data[show_key]
if show_data["enabled"]:
show_choice = discord.OptionChoice(
name=show_data["name"],
value=show_key
)
show_choices.append(show_choice)

class HintButton(discord.ui.Button):
def __init__(self, cog):
self.cog = cog
Expand Down Expand Up @@ -46,19 +62,8 @@ def __init__(self, bot):

self.threshold = 72 # fuzz threshold

self.shows = command_config["parameters"][0]["allowed"]

quiz = discord.SlashCommandGroup("quiz", "Commands for interacting with the Quiz Game")

shows = command_config["parameters"][0]["allowed"]
show_choices = []
for show in shows:
show_choice = discord.OptionChoice(
name=show["name"],
value=show["value"]
)
show_choices.append(show_choice)

@quiz.command(
name="start",
description="Start a Quiz round"
Expand Down Expand Up @@ -186,8 +191,7 @@ async def quiz_start(self, ctx:discord.ApplicationContext, show:str):
try:
logger.info(f"{Fore.MAGENTA}Starting quiz!{Fore.RESET}")
if not show:
s = random.choice(self.shows)
show = s["value"]
show = random.choice(show_keys)

self.show = show

Expand Down
4 changes: 2 additions & 2 deletions commands/sub_rosa.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ async def reset(ctx:discord.ApplicationContext):

previous_reset = await db_get_previous_reset()
stats = await db_get_sub_rosa_stats()
total_watches = stats['total_watches']
total_watches = stats['total_watches'] + 1
if total_watches >= 30 and total_watches < 40:
total_watches = f"{total_watches}... *Thirties...*"

Expand Down Expand Up @@ -95,7 +95,7 @@ async def check(ctx:discord.ApplicationContext):
days = lifespan.days

embed = discord.Embed(
title=f"The Last Sub Rosa Watch Was...",
title=f"The Last Sub Rosa Watch...",
description=f"was {days} {'Day' if days == 1 else 'Days'} ago... {get_emoji('beverly_horny_ghost_orgasm')}",
color=discord.Color.dark_green()
)
Expand Down
73 changes: 3 additions & 70 deletions configuration.json
Original file line number Diff line number Diff line change
Expand Up @@ -339,7 +339,7 @@
"channels": [
"maquis-officers-club"
],
"crontab": "0 */12 * * *",
"crontab": "10 */6 * * *",
"enabled": true
},
"hoodiversary": {
Expand Down Expand Up @@ -642,75 +642,8 @@
"morns-nonstop-quiz"
],
"enabled": true,
"data": null,
"parameters": [
{
"name": "show",
"allowed": [
{
"name": "Star Trek: The Original Series",
"value": "tos"
},
{
"name": "Star Trek: The Animated Series",
"value": "tas"
},
{
"name": "Star Trek: The Next Generation",
"value": "tng"
},
{
"name": "Star Trek: Deep Space Nine",
"value": "ds9"
},
{
"name": "Star Trek: Voyager",
"value": "voy"
},
{
"name": "Star Trek: Enterprise",
"value": "enterprise"
},
{
"name": "Star Trek: Discovery",
"value": "disco"
},
{
"name": "Star Trek: Picard",
"value": "picard"
},
{
"name": "Star Trek: Prodigy",
"value": "prodigy"
},
{
"name": "Star Trek: Strange New Worlds",
"value": "snw"
},
{
"name": "Star Trek: Lower Decks",
"value": "lowerdecks"
},
{
"name": "Friends",
"value": "friends"
},
{
"name": "Firefly",
"value": "firefly"
},
{
"name": "It's Always Sunny in Philadelphia",
"value": "sunny"
},
{
"name": "The Simpsons",
"value": "simpsons"
}
],
"required": false
}
]
"data": "data/info.json",
"parameters": []
},
"quiz report": {
"channels": [
Expand Down
5 changes: 5 additions & 0 deletions data/drops.json
Original file line number Diff line number Diff line change
Expand Up @@ -464,6 +464,11 @@
"description": "The Hunt For Red October Sean Connery",
"url": "https://i.imgur.com/zGBAy0R.mp4"
},
"Paradise City": {
"file": "data/drops/paradisecity.mp4",
"description": "Paradise City Streaming Syboktacular Share Your Pain Song Guns n Roses",
"url": "https://i.imgur.com/caeUN3A.mp4"
},
"Photon Torpedos: Full Spread": {
"file": "data/drops/photontorpedos.mp4",
"description": "Photon Torpedos: Full Spread",
Expand Down
Binary file added images/badges/FOD_Pride_2024.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 2 additions & 0 deletions migrations/v2.9.0.sql
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
INSERT INTO badge_info (badge_name, badge_filename, badge_url, quadrant, time_period, franchise, reference, special) VALUES ("FOD Pride 2024", "FOD_Pride_2024.png", "https://drunkshimoda.com/", "Alpha", "2100s", "The USS Hood", "Commemorating Pride Month 2024 on The USS Hood!", 1) ON DUPLICATE KEY UPDATE badge_name = badge_name;
INSERT INTO badges (user_discord_id, badge_filename) SELECT discord_id, 'FOD_Pride_2024.png' FROM users;
1 change: 0 additions & 1 deletion tasks/channel_cleanup.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
import pytz
from common import *

def channel_cleanup_task(bot):
Expand Down
Loading