Skip to content

Commit 06b3e02

Browse files
committed
🐛 Fix some bugs
Fix boosterinfo erroring Fix uncaught 403 error Fix 8ball erroring on 4096+ char input
1 parent f3fea43 commit 06b3e02

File tree

4 files changed

+5
-7
lines changed

4 files changed

+5
-7
lines changed

killua/cogs/economy.py

-3
Original file line numberDiff line numberDiff line change
@@ -438,9 +438,6 @@ async def boxinfo(self, ctx: commands.Context, box: str):
438438
return await ctx.send("Invalid box name or id", ephemeral=True)
439439

440440
data = LOOTBOXES[int(box)]
441-
data["image"] = cast(str, data["image"]).format(
442-
self.client.api_url(to_fetch=self.client.is_dev)
443-
)
444441

445442
c_min, c_max = data["cards_total"]
446443
j_min, j_max = data["rewards"]["jenny"]

killua/cogs/events.py

+2-1
Original file line numberDiff line numberDiff line change
@@ -1018,8 +1018,9 @@ async def on_command_error(self, ctx: commands.Context, error):
10181018
not self.client.is_user_installed(ctx)
10191019
and ctx.channel.permissions_for(ctx.me).send_messages is False
10201020
and not self.client.is_dev
1021+
and not isinstance(error, discord.Forbidden)
10211022
):
1022-
# we don't want to raise an error inside the error handler when Killua ' send the error because that does not trigger `on_command_error`
1023+
# we don't want to raise an error inside the error handler when Killua sends the error message because that does not trigger `on_command_error`
10231024
return
10241025

10251026
if ctx.command:

killua/cogs/small_commands.py

+1
Original file line numberDiff line numberDiff line change
@@ -230,6 +230,7 @@ async def hi(self, ctx: commands.Context):
230230
@discord.app_commands.describe(question="The question to ask the magic 8 ball")
231231
async def _ball(self, ctx: commands.Context, *, question: str):
232232
"""Ask Killua anything and he will answer"""
233+
question = question if len(question) < 2000 else question[:2000] + "..."
233234
embed = discord.Embed.from_dict(
234235
{
235236
"title": f"8ball has spoken 🎱",

killua/cogs/web_scraping.py

+2-3
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,6 @@
1515
from killua.static.enums import Category
1616
from killua.static.constants import PXLAPI
1717

18-
1918
class WebScraping(commands.GroupCog, group_name="web"):
2019

2120
def __init__(self, client: BaseBot):
@@ -59,7 +58,7 @@ def _init_menus(self) -> None:
5958
extras={"category": Category.FUN, "id": 116},
6059
usage="book <title>",
6160
)
62-
@discord.app_commands.describe(book="The name of the book to loock for")
61+
@discord.app_commands.describe(book="The name of the book to look for")
6362
async def novel(self, ctx: commands.Context, *, book: str):
6463
"""With this command you can search for books! Just say the book title and look through the results"""
6564
await ctx.channel.typing()
@@ -256,7 +255,7 @@ async def get_bing_images(self, query: str) -> List[str]:
256255
async def img(self, ctx: commands.Context, *, query: str):
257256
"""Search for any image you want"""
258257
if ctx.interaction and not ctx.interaction.response.is_done():
259-
await ctx.defer() # I don't want this to fail, even if it takes < 3 secs most of the time
258+
await ctx.defer() # I don't want this to fail, even if it takes < 3 secs most of the time
260259

261260
links = await self.get_bing_images(query)
262261

0 commit comments

Comments
 (0)