Skip to content

Commit 262f7eb

Browse files
committed
fix: various bugs, closes #24 as well
1 parent 51feaf6 commit 262f7eb

File tree

11 files changed

+27
-22
lines changed

11 files changed

+27
-22
lines changed

.gitignore

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
venv
22
*__pycache__*
33
.env
4-
.ruff_cache
4+
*.ruff_cache*

CHANGELOG.md

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -49,5 +49,8 @@ Added the VERSION variable in the config and updated listeners.ping_response to
4949
#### 1.5.1
5050
Made the maintainer only command reload_exts reload the config.
5151

52-
#### 1.6.0
53-
As I started using ruff and uv here, I also formatted everything and addressed the hundreds and hundreds of errors ruff so joyfully raised.
52+
### 1.6.0
53+
As I started using ruff and uv here, I also formatted everything and addressed the hundreds and hundreds of errors ruff so joyfully raised.
54+
55+
#### 1.6.1
56+
Fixes various bugs introduced in 1.6.0, and also see #24.

CONTRIBUTING.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ Takina does not currently follow *all* of these standards, but as of now does fo
55
First of all, thanks for considering contributing to Takina! I appreciate it. Please make sure that what you're contributing follows Discord's [Terms of Service](https://discord.com/terms). Please follow the standards after this section, and lastly, if it's a new feature, please contact me ([orangc](https://orangc.net)) or in the least open an issue before starting to write code; confirming that I'll approve your idea is better than wasting your time and finding out later that I can't merge your pull request because of x and y. 💖
66

77
### Formatting/Linting & Commits
8-
- `ruff format .` and `ruff check .` should be run before committing. If `ruff check` raises any errors, they must be addressed.
8+
- `ruff format` and `ruff check` should be run before committing. If `ruff check` raises any errors, they must be addressed.
99
- Each commit should follow the Conventional Commits standard, for example: `fix(mod): mute command did not check for perms`. The scope should be the subfolder affected in the cogs dir, and if there is none, use (core) as a scope.
1010
- Every command should have a description and help information.
1111

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,4 +47,4 @@ Please see [CONTRIBUTING.md](CONTRIBUTING.md).
4747
## Specifications
4848
- This project follows the [Semantic Versioning 2.0.0](https://semver.org/) specification as of 14.04.2025. You may see the current version and changelog [here](./CHANGELOG.md).
4949
- This project follows the [Conventional Commits](https://www.conventionalcommits.org/en/v1.0.0/) specification as of 01.10.2024.
50-
<!-- note to self: count takina loc with: `git ls-files | grep '\.py$' | xargs wc -l | tail -n 1`, 9,839 as of 14.04.2025 -->
50+
<!-- note to self: count takina loc with: `git ls-files | grep '\.py$' | xargs wc -l | tail -n 1`, 10,148 as of 25.04.2025 -->

takina/cogs/listeners/github.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
GITHUB_BASE_URL = "https://api.github.com"
1515

1616
REPO_PATTERN = re.compile(r"repo:([A-Za-z0-9_.-]+)/([A-Za-z0-9_.-]+)")
17-
PR_ISSUE_PATTERN = re.compile(r"([A-Za-z0-9_.-]+)/([A-Za-z0-9_.-]+)#(\d+)")
17+
PR_ISSUE_PATTERN = re.compile(r"^[a-zA-Z0-9-]+/[a-zA-Z0-9-]+#[0-9]+$")
1818

1919

2020
def format_timestamp(iso_timestamp: str) -> str:

takina/cogs/mod/reports.py

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -48,18 +48,16 @@ async def report(
4848
):
4949
await interaction.response.defer()
5050
guild_id = interaction.guild.id
51-
config = await self.get_server_config(guild_id)
51+
guild_config = await self.get_server_config(guild_id)
5252

53-
if not config:
53+
if not guild_config:
5454
embed = nextcord.Embed(color=config.ERROR_COLOR)
55-
embed.description = (
56-
":x: Reports system is not set up. Please contact an admin."
57-
)
55+
embed.description = ":x: The reports system has not been configured for this server. In order to set it up, run `/admin_report`."
5856
await interaction.send(embed=embed, ephemeral=True)
5957
return
6058

61-
moderator_role_id = config.get("moderator_role_id")
62-
reports_channel_id = config.get("reports_channel_id")
59+
moderator_role_id = guild_config.get("moderator_role_id")
60+
reports_channel_id = guild_config.get("reports_channel_id")
6361

6462
reports_channel = self.bot.get_channel(reports_channel_id)
6563
if not reports_channel:
@@ -115,7 +113,9 @@ async def admin_report(
115113
await self.set_server_config(guild_id, mod_role.id, reports_channel.id)
116114

117115
embed = nextcord.Embed(color=config.EMBED_COLOR)
118-
embed.description = f"✅ Successfully set up the report system. Moderator role: {mod_role.mention}, reports channel: {reports_channel.mention}"
116+
embed.description = "✅ Successfully set up the report system.\n"
117+
embed.description += f"\n**Moderator role**: {mod_role.mention}"
118+
embed.description += f"\n**Reports channel**: {reports_channel.mention}"
119119

120120
await interaction.send(
121121
embed=embed,

takina/cogs/util/info.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -86,10 +86,10 @@ async def userinfo(self, ctx: commands.Context, *, member: str = None):
8686

8787
@commands.command(
8888
name="roleinfo",
89-
help="Fetch information about a role. \nUsage: `Usage: roleinfo <role>`.",
89+
help="Fetch information about a role. \nUsage: `Usage: roleinfo <role>`. Note that this command is ***case-sensitive***.",
9090
aliases=["ri"],
9191
)
92-
async def roleinfo(self, ctx: commands.Context, *, role: str):
92+
async def roleinfo(self, ctx: commands.Context, *, role: nextcord.Role):
9393
emoji = await oclib.fetch_random_emoji()
9494
embed = nextcord.Embed(
9595
title=f"{emoji}{role.name}",

takina/cogs/util/reminders.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
# SPDX-License-Identifier: AGPL-3.0-or-later
22
# SPDX-FileCopyrightText: orangc
3-
from datetime import datetime, timedelta
4-
3+
from datetime import timedelta
4+
import datetime
55
import nextcord
66
from bson.objectid import ObjectId
77
import config
@@ -30,6 +30,7 @@ async def remindme(self, ctx: commands.Context):
3030
name="reminder",
3131
invoke_without_command=True,
3232
help="Manage your reminders. Use `reminder set`, `reminder list`, or `reminder delete`.",
33+
aliases=["reminders"],
3334
)
3435
async def reminder(self, ctx: commands.Context):
3536
embed = nextcord.Embed(

takina/cogs/util/time.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,13 @@
11
# SPDX-License-Identifier: AGPL-3.0-or-later
22
# SPDX-FileCopyrightText: orangc
33
import datetime
4-
54
import geopy
65
import nextcord
76
import pytz
87
import tzfpy
98
import config
109
from nextcord.ext import commands
10+
import geopy.extra
1111

1212

1313
async def find_time(location: str):
@@ -16,7 +16,7 @@ async def find_time(location: str):
1616
embed.color = config.ERROR_COLOR
1717
embed.description = ":x: The location name you specified is too long. Please enter a shorter name."
1818

19-
async with geopy.geocoders.Photon(
19+
async with geopy.geocoders.Nominatim(
2020
user_agent=config.BOT_NAME, adapter_factory=geopy.adapters.AioHTTPAdapter
2121
) as geolocator:
2222
geocode = geopy.extra.rate_limiter.AsyncRateLimiter(

takina/cogs/util/weather.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
import config
66
from nextcord.ext import commands
77
from open_meteo import OpenMeteo
8+
import geopy.extra
89

910

1011
async def find_weather(location: str):
@@ -13,7 +14,7 @@ async def find_weather(location: str):
1314
embed.color = config.ERROR_COLOR
1415
embed.description = ":x: The location specified was not recognized."
1516

16-
async with geopy.geocoders.Photon(
17+
async with geopy.geocoders.Nominatim(
1718
user_agent=config.BOT_NAME, adapter_factory=geopy.adapters.AioHTTPAdapter
1819
) as geolocator:
1920
geocode = geopy.extra.rate_limiter.AsyncRateLimiter(

0 commit comments

Comments
 (0)