66import arc
77import hikari
88import miru
9+ from hikari .impl .special_endpoints import PollBuilder
910
1011from src .config import AGENDA_TEMPLATE_URL , CHANNEL_IDS , ROLE_IDS , UID_MAPS , Feature
1112from 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
9495async 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