Skip to content

Commit 4b1ef7a

Browse files
committed
feat(exts/fun): Add findblock command
1 parent 4c1e957 commit 4b1ef7a

File tree

5 files changed

+535
-1
lines changed

5 files changed

+535
-1
lines changed

.github/CHANGELOG.md

+1
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@
1010

1111
- [**Fixed**] `>colour` command always return incorrect value
1212
- [**Added**] Add loot table choice to `>barter` command
13+
- [**Added**] Add `>findblock` command
1314

1415
### Internal Changes
1516
- [**Added**] Add `ClampedRange` to revert some command's old range behaviour

src/zibot/exts/fun/fun.py

+24-1
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
from typing import get_args
1010

1111
import discord
12-
from discord import app_commands
12+
from discord import app_commands, PartialEmoji
1313
from discord.app_commands import Choice
1414
from discord.app_commands import locale_str as _
1515
from discord.ext import commands
@@ -23,6 +23,7 @@
2323
from ...core.mixin import CogMixin
2424
from ...utils.api import reddit
2525
from ...utils.piglin import Piglin
26+
from ...utils.ugbc import UGBC
2627
from ._flags import FINDSEED_MODES, FindseedFlags
2728

2829

@@ -35,6 +36,7 @@ class Fun(commands.Cog, CogMixin):
3536
def __init__(self, bot):
3637
super().__init__(bot)
3738
self.reddit = reddit.Reddit(self.bot.session)
39+
self.ugbc = UGBC()
3840

3941
@cmds.command(
4042
name=_("meme"),
@@ -457,3 +459,24 @@ def emoji(name: str):
457459
async def lootTableSuggestion(self, inter, choice):
458460
rps = (("Before Nerf", "before"), ("After Nerfed", "nerfed"))
459461
return [app_commands.Choice(name=i[0], value=i[1]) for i in rps]
462+
463+
@cmds.command(
464+
name=_("findblock"),
465+
description=_("findblock-desc"),
466+
aliases=("fblk"),
467+
hybrid=True,
468+
extras=dict(
469+
example=("findblock", "fblk"),
470+
),
471+
)
472+
@commands.cooldown(5, 25, commands.BucketType.user)
473+
async def findblock(self, ctx):
474+
result = self.ugbc.randomize()
475+
missing = PartialEmoji.from_str("<:missingtexture:807536928361545729>")
476+
e = ZEmbed(
477+
ctx,
478+
title="UGBC",
479+
description=f"{missing} ({result.id})",
480+
colour=discord.Color.yellow(),
481+
).set_footer(text="Work in Progress")
482+
await ctx.try_reply(embeds=[e])

src/zibot/locale/en-US.ftl

+2
Original file line numberDiff line numberDiff line change
@@ -168,6 +168,8 @@ findseed-result-classic = <@{ $userId }> -> Your seed is a { $eyeCount ->
168168
[one] **{ $eyeCount }** eye
169169
*[other] **{ $eyeCount }** eyes
170170
}
171+
findblock = findblock
172+
findblock-desc = Try your luck with MCBE's UGBC
171173
httpcat = httpcat
172174
httpcat-desc = Get http status code with cat in it
173175
pp = pp

0 commit comments

Comments
 (0)