1212from bot .constants import Categories , Channels , Colours , Icons , MODERATION_ROLES , STAFF_AND_COMMUNITY_ROLES
1313from bot .converters import DurationOrExpiry , MemberOrUser
1414from bot .errors import InvalidInfractedUserError
15- from bot .exts .moderation .infraction ._views import BanConfirmationView
15+ from bot .exts .moderation .infraction ._views import InfractionConfirmationView
1616from bot .log import get_logger
1717from bot .utils import time
1818from bot .utils .channel import is_in_category , is_mod_channel
@@ -328,9 +328,9 @@ def cap_timeout_duration(duration: datetime.datetime | relativedelta) -> tuple[b
328328 return capped , duration
329329
330330
331- async def confirm_elevated_user_ban (ctx : Context , user : MemberOrUser ) -> bool :
331+ async def confirm_elevated_user_infraction (ctx : Context , user : MemberOrUser ) -> bool :
332332 """
333- If user has an elevated role, require confirmation before banning .
333+ If user has an elevated role, require confirmation before issuing infraction .
334334
335335 A member with the staff or community roles are considered elevated.
336336
@@ -339,24 +339,24 @@ async def confirm_elevated_user_ban(ctx: Context, user: MemberOrUser) -> bool:
339339 if not isinstance (user , Member ) or not any (role .id in STAFF_AND_COMMUNITY_ROLES for role in user .roles ):
340340 return True
341341
342- confirmation_view = BanConfirmationView (
342+ confirmation_view = InfractionConfirmationView (
343343 allowed_users = (ctx .author .id ,),
344344 allowed_roles = MODERATION_ROLES ,
345345 timeout = 10 ,
346346 )
347347 confirmation_view .message = await ctx .send (
348- f"{ user .mention } has an elevated role. Are you sure you want to ban them?" ,
348+ f"{ user .mention } has an elevated role. Are you sure you want to infract them?" ,
349349 view = confirmation_view ,
350350 allowed_mentions = discord .AllowedMentions .none (),
351351 )
352352
353353 timed_out = await confirmation_view .wait ()
354354 if timed_out :
355- log .trace (f"Attempted ban of user { user } by moderator { ctx .author } cancelled due to timeout." )
355+ log .trace (f"Attempted infraction of user { user } by moderator { ctx .author } cancelled due to timeout." )
356356 return False
357357
358358 if confirmation_view .confirmed is False :
359- log .trace (f"Attempted ban of user { user } by moderator { ctx .author } cancelled due to manual cancel." )
359+ log .trace (f"Attempted infraction of user { user } by moderator { ctx .author } cancelled due to manual cancel." )
360360 return False
361361
362362 return True
0 commit comments