Skip to content

Commit

Permalink
Bump to v0.2.6 #patch
Browse files Browse the repository at this point in the history
This release just fixes the blacklists and sync commands from being shown, and adds a command to reload all exts live. ~ Noelle
  • Loading branch information
No767 authored Sep 16, 2023
2 parents cd55d32 + bd41c16 commit 249e54e
Show file tree
Hide file tree
Showing 6 changed files with 48 additions and 38 deletions.
2 changes: 1 addition & 1 deletion bot/cogs/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,4 +13,4 @@ def __str__(self) -> str:


EXTENSIONS = [module.name for module in iter_modules(__path__, f"{__package__}.")]
VERSION: VersionInfo = VersionInfo(major=0, minor=2, micro=5, releaselevel="final")
VERSION: VersionInfo = VersionInfo(major=0, minor=2, micro=6, releaselevel="final")
8 changes: 4 additions & 4 deletions bot/cogs/blacklist.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,8 @@ def __init__(self, bot: Catherine) -> None:

@is_owner()
@app_commands.guild_only()
@app_commands.guilds(HANGOUT_GUILD_ID)
@app_commands.command(name="view")
@app_commands.guilds(HANGOUT_GUILD_ID)
async def view(self, interaction: discord.Interaction):
"""View the global blacklist"""
blacklist = await get_or_fetch_full_blacklist(interaction.client, self.pool)
Expand All @@ -38,8 +38,8 @@ async def view(self, interaction: discord.Interaction):

@is_owner()
@app_commands.guild_only()
@app_commands.guilds(HANGOUT_GUILD_ID)
@app_commands.command(name="add")
@app_commands.guilds(HANGOUT_GUILD_ID)
@app_commands.describe(id=ID_DESCRIPTION)
async def add(self, interaction: discord.Interaction, id: str):
"""Add to global blacklist"""
Expand All @@ -55,8 +55,8 @@ async def add(self, interaction: discord.Interaction, id: str):

@is_owner()
@app_commands.guild_only()
@app_commands.guilds(HANGOUT_GUILD_ID)
@app_commands.command(name="remove")
@app_commands.guilds(HANGOUT_GUILD_ID)
@app_commands.describe(id=ID_DESCRIPTION)
async def remove(self, interaction: discord.Interaction, id: str):
"""Remove from global blacklist"""
Expand All @@ -73,8 +73,8 @@ async def remove(self, interaction: discord.Interaction, id: str):

@is_owner()
@app_commands.guild_only()
@app_commands.guilds(HANGOUT_GUILD_ID)
@app_commands.command(name="status")
@app_commands.guilds(HANGOUT_GUILD_ID)
@app_commands.describe(id=ID_DESCRIPTION, status="New status")
async def status(self, interaction: discord.Interaction, id: int, status: bool):
"""Update from global blacklist"""
Expand Down
15 changes: 13 additions & 2 deletions bot/cogs/dev_tools.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

import discord
from catherinecore import Catherine
from cogs import EXTENSIONS
from discord import app_commands
from discord.ext import commands
from discord.ext.commands import Context, Greedy
Expand All @@ -19,10 +20,10 @@ def __init__(self, bot: Catherine):
def display_emoji(self) -> discord.PartialEmoji:
return discord.PartialEmoji(name="\U0001f6e0")

@app_commands.guilds(HANGOUT_GUILD_ID)
@commands.hybrid_command(name="sync", hidden=True)
@commands.guild_only()
@commands.is_owner()
@commands.hybrid_command(name="sync", hidden=True)
@app_commands.guilds(HANGOUT_GUILD_ID)
async def sync(
self,
ctx: Context,
Expand Down Expand Up @@ -66,6 +67,16 @@ async def sync(

await ctx.send(f"Synced the tree to {ret}/{len(guilds)}.")

@commands.guild_only()
@commands.is_owner()
@commands.hybrid_command(name="reload-all", hidden=True)
@app_commands.guilds(HANGOUT_GUILD_ID)
async def reload_all(self, ctx: commands.Context) -> None:
"""Reloads all cogs. Used in production to not produce any downtime"""
for extension in EXTENSIONS:
await self.bot.reload_extension(extension)
await ctx.send("Successfully reloaded all extensions live")


async def setup(bot: Catherine):
await bot.add_cog(DevTools(bot))
11 changes: 5 additions & 6 deletions changelog.md
Original file line number Diff line number Diff line change
@@ -1,19 +1,18 @@
# 🛠️ Catherine-Chan 0.2.5 🛠️
# 🛠️ Catherine-Chan 0.2.6 🛠️

A even smaller bug fix in order to ensure that the pronouns suggestion system now works properly
More smaller bugfix to ensure that the blacklist and dev tools commands are not being synced globally.

## ✨ TD;LR

- Fixed the pronouns suggestion command not working when you start it
- Fixed blacklist and sync commands showing up in public commands

## 🛠️ Changes

- Added a finish button to the `/pronouns suggest-examples` command
- All views now have proper interactions checks (take an L Lala)
- Fixed blacklist and sync commands showing up in public commands

## ✨ Additions

- None
- Reload all extensions cmd. This allows for essentially 0 downtime when all needs to be done is to pull the changes, reload all extensions, and then sync as needed

## ➖ Removals

Expand Down
44 changes: 22 additions & 22 deletions poetry.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 3 additions & 3 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[tool.poetry]
name = "catherine-chan"
version = "0.2.5"
version = "0.2.6"
description = "An informational LGBTQ based discord bot"
authors = ["No767 <73260931+No767@users.noreply.github.com>"]
readme = "README.md"
Expand All @@ -24,8 +24,8 @@ psutil = "^5.9.5"

[tool.poetry.group.dev.dependencies]
pre-commit = "^3.4.0"
pyright = "^1.1.326"
ruff = "^0.0.287"
pyright = "^1.1.327"
ruff = "^0.0.289"
watchfiles = "^0.20.0"
pyinstrument = "^4.5.3"
jishaku = "^2.5.1"
Expand Down

0 comments on commit 249e54e

Please sign in to comment.