Skip to content

Commit

Permalink
Bump to v0.4.1 #patch
Browse files Browse the repository at this point in the history
This release aims to add the missing features of the tonetags metrics and making it work. For more info, please see more info on the changelog. ~ Noelle
  • Loading branch information
No767 authored Oct 15, 2023
2 parents 514465c + 204bf18 commit 9e7c3e6
Show file tree
Hide file tree
Showing 5 changed files with 31 additions and 20 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=4, micro=0, releaselevel="final")
VERSION: VersionInfo = VersionInfo(major=0, minor=4, micro=1, releaselevel="final")
10 changes: 10 additions & 0 deletions bot/libs/ui/tonetags/modals.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
from __future__ import annotations

from typing import TYPE_CHECKING

import asyncpg
import discord
from libs.cog_utils.tonetags import (
Expand All @@ -8,6 +12,9 @@
)
from libs.utils import CatherineModal

if TYPE_CHECKING:
from bot.catherinecore import Catherine


class CreateToneTagModal(CatherineModal, title="Create a ToneTag"):
def __init__(self, interaction: discord.Interaction, pool: asyncpg.Pool):
Expand Down Expand Up @@ -36,6 +43,9 @@ async def on_submit(self, interaction: discord.Interaction) -> None:
await interaction.response.send_message("The tonetag is invalid.")
return

bot: Catherine = interaction.client # type: ignore
bot.metrics.created_tonetags.inc()

status = await create_tonetag(
self.indicator.value, self.definition.value, interaction.user.id, self.pool
)
Expand Down
12 changes: 12 additions & 0 deletions bot/libs/ui/tonetags/views.py
Original file line number Diff line number Diff line change
@@ -1,8 +1,16 @@
from __future__ import annotations

from typing import TYPE_CHECKING

import asyncpg
import discord
from libs.cog_utils.tonetags import parse_tonetag
from libs.utils import CatherineView, ErrorEmbed, SuccessEmbed

if TYPE_CHECKING:
from bot.catherinecore import Catherine


NO_CONTROL_MSG = "This menu cannot be controlled by you, sorry!"


Expand Down Expand Up @@ -30,6 +38,8 @@ async def confirm(
status = await self.pool.execute(query, parsed_tonetag, interaction.user.id)

if status[-1] != "0":
bot: Catherine = interaction.client # type: ignore
bot.metrics.deleted_tonetags.inc()
success_embed = SuccessEmbed()
success_embed.description = (
f"Successfully deleted the tonetag `{self.indicator}`"
Expand Down Expand Up @@ -82,6 +92,8 @@ async def confirm(
status = await self.pool.execute(query, self.tonetags_id, interaction.user.id)

if status[-1] != "0":
bot: Catherine = interaction.client # type: ignore
bot.metrics.deleted_tonetags.inc()
success_embed = SuccessEmbed()
success_embed.description = (
f"Successfully deleted the tonetag. (ID: `{self.tonetags_id}`)"
Expand Down
25 changes: 7 additions & 18 deletions changelog.md
Original file line number Diff line number Diff line change
@@ -1,31 +1,20 @@
# ✨ Catherine-Chan 0.4.0
# 🛠️ Catherine-Chan 0.4.1

An patch release to add something that was missed in v0.4.0. For more information about the v0.4.0, please see the changelog for (https://github.com/No767/Catherine-Chan/releases/tag/v0.4.0).

This should be one of the last versions (before the topgg stuff gets included) going into prod before the topgg release. This release aims to fix a ton of issues, and brings in several new features.

## ✨ TD;LR

- Completely reworked tonetags module
- HRT converter
- Use Pyright style of public exports for all packages
- Fix tonetag metrics not being counted

## 🛠️ Changes

- Restate usage of code
- Fixed errors related to no tonetags
- Moved error handling to on the `CommandTree` directly
- Move all views (except one) and all modals to `CatherineView` and `CatherineModal`, which are subclasses of `discord.ui.View` and `discord.ui.Modal` respectively. (this reduces on code duplication)
- Use Pyright style of public exports for all packages
- Fix `/tonetags all` json encoding and pretty print for json
- Fix tonetag metrics not being counted

## ✨ Additions

- HRT Converter
- Checks for invalid pronouns examples
- Checks for invalid tonetag names
- Subclassed views and modals
- Expose some more metrics

- None

## ➖ Removals

- Error Handler cog. Moved to `CatherineCommandTree`
- None
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[tool.poetry]
name = "catherine-chan"
version = "0.4.0"
version = "0.4.1"
description = "An informational LGBTQ based discord bot"
authors = ["No767 <73260931+No767@users.noreply.github.com>"]
readme = "README.md"
Expand Down

0 comments on commit 9e7c3e6

Please sign in to comment.