Skip to content

Commit 10aeb21

Browse files
committed
Fix format error
1 parent bfda6e3 commit 10aeb21

1 file changed

Lines changed: 9 additions & 6 deletions

File tree

src/extensions/agenda.py

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66
import arc
77
import hikari
88
import miru
9+
from hikari.impl.special_endpoints import PollBuilder
910

1011
from src.config import AGENDA_TEMPLATE_URL, CHANNEL_IDS, ROLE_IDS, UID_MAPS, Feature
1112
from src.hooks import restrict_to_channels, restrict_to_roles
@@ -93,8 +94,6 @@ async def post_reaction_poll(*, question: str, options: list[str]) -> None:
9394

9495
async def post_poll(*, question: str, options: list[str]) -> None:
9596
"""Post a native Discord poll, falling back to reactions if unavailable."""
96-
from hikari.impl.special_endpoints import PollBuilder
97-
9897
try:
9998
poll = PollBuilder(
10099
question_text=question,
@@ -140,7 +139,9 @@ async def on_timeout(self) -> None:
140139
await self.disable_all()
141140
self.stop()
142141

143-
@miru.button(label="Confirm", style=hikari.ButtonStyle.SUCCESS, custom_id="agenda_confirm")
142+
@miru.button(
143+
label="Confirm", style=hikari.ButtonStyle.SUCCESS, custom_id="agenda_confirm"
144+
)
144145
async def confirm_post(self, ctx: miru.ViewContext, _: miru.Button) -> None:
145146
if ctx.user.id != self.author_id:
146147
await ctx.respond(
@@ -162,7 +163,9 @@ async def confirm_post(self, ctx: miru.ViewContext, _: miru.Button) -> None:
162163
await ctx.edit_response(response_text, components=self)
163164
self.stop()
164165

165-
@miru.button(label="Cancel", style=hikari.ButtonStyle.DANGER, custom_id="agenda_cancel")
166+
@miru.button(
167+
label="Cancel", style=hikari.ButtonStyle.DANGER, custom_id="agenda_cancel"
168+
)
166169
async def cancel_post(self, ctx: miru.ViewContext, _: miru.Button) -> None:
167170
if ctx.user.id != self.author_id:
168171
await ctx.respond(
@@ -192,7 +195,7 @@ async def cancel_post(self, ctx: miru.ViewContext, _: miru.Button) -> None:
192195
"Generate a new agenda for committee meetings.",
193196
autodefer=arc.AutodeferMode.EPHEMERAL,
194197
)
195-
async def gen_agenda(
198+
async def gen_agenda( # noqa: PLR0911, PLR0915
196199
ctx: BlockbotContext,
197200
date: arc.Option[
198201
str,
@@ -347,7 +350,7 @@ async def send_agenda_and_poll() -> str:
347350
message=announce.id,
348351
emoji=hikari.CustomEmoji.parse("<:bigRed:634311607039819776>"),
349352
)
350-
except (hikari.BadRequestError, hikari.NotFoundError, hikari.ForbiddenError):
353+
except hikari.BadRequestError, hikari.NotFoundError, hikari.ForbiddenError:
351354
await plugin.client.rest.add_reaction(
352355
channel=announce.channel_id,
353356
message=announce.id,

0 commit comments

Comments
 (0)