fix (rolemenus): Better formatting for ack.

This commit is contained in:
2023-08-22 22:39:49 +03:00
parent f70c0269c5
commit 0a93dd0a5d

View File

@@ -479,8 +479,8 @@ class RoleMenu:
raise UserInputError( raise UserInputError(
t(_p( t(_p(
'rolemenu|deselect|error:sticky', 'rolemenu|deselect|error:sticky',
"{role} is a sticky role, you cannot remove it with this menu!" "**{role}** is a sticky role, you cannot remove it with this menu!"
)).format(role=role.mention) )).format(role=role.name)
) )
conn = await self.bot.db.get_connection() conn = await self.bot.db.get_connection()
@@ -534,25 +534,27 @@ class RoleMenu:
if total_refund: if total_refund:
embed.description = t(_p( embed.description = t(_p(
'rolemenu|deselect|success:refund|desc', 'rolemenu|deselect|success:refund|desc',
"You have removed {role}, and been refunded {coin} **{amount}**." "You have removed **{role}**, and been refunded {coin} **{amount}**."
)).format(role=role.mention, coin=self.bot.config.emojis.coin, amount=total_refund) )).format(role=role.name, coin=self.bot.config.emojis.coin, amount=total_refund)
else: else:
embed.description = t(_p( embed.description = t(_p(
'rolemenu|deselect|success:norefund|desc', 'rolemenu|deselect|success:norefund|desc',
"You have unequipped {role}." "You have unequipped **{role}**."
)).format(role=role.mention) )).format(role=role.name)
return embed return embed
else: else:
# Member does not have the role, selection case. # Member does not have the role, selection case.
required = self.config.required_role.value required = self.config.required_role.data
if required is not None: if required is not None:
# Check member has the required role # Check member has the required role
if required not in member.roles: if required not in [role.id for role in member.roles]:
role = guild.get_role(required)
name = role.name if role else required
raise UserInputError( raise UserInputError(
t(_p( t(_p(
'rolemenu|select|error:required_role', 'rolemenu|select|error:required_role',
"You need to have the {role} role to use this!" "You need to have the **{role}** role to use this!"
)).format(role=required.mention) )).format(role=name)
) )
obtainable = self.config.obtainable.value obtainable = self.config.obtainable.value
@@ -579,10 +581,10 @@ class RoleMenu:
raise UserInputError( raise UserInputError(
t(_p( t(_p(
'rolemenu|select|error:insufficient_funds', 'rolemenu|select|error:insufficient_funds',
"The role {role} costs {coin}**{cost}**," "The role **{role}** costs {coin}**{cost}**,"
"but you only have {coin}**{balance}**!" "but you only have {coin}**{balance}**!"
)).format( )).format(
role=role.mention, role=role.name,
coin=self.bot.config.emojis.coin, coin=self.bot.config.emojis.coin,
cost=price, cost=price,
balance=balance, balance=balance,
@@ -652,13 +654,13 @@ class RoleMenu:
if price > 0: if price > 0:
embed.description = t(_p( embed.description = t(_p(
'rolemenu|select|success:purchase|desc', 'rolemenu|select|success:purchase|desc',
"You have purchased the role {role} for {coin}**{amount}**" "You have purchased the role **{role}** for {coin}**{amount}**"
)).format(role=role.mention, coin=self.bot.config.emojis.coin, amount=price) )).format(role=role.name, coin=self.bot.config.emojis.coin, amount=price)
else: else:
embed.description = t(_p( embed.description = t(_p(
'rolemenu|select|success:nopurchase|desc', 'rolemenu|select|success:nopurchase|desc',
"You have equipped the role {role}" "You have equipped the role **{role}**"
)).format(role=role.mention) )).format(role=role.name)
if expiry is not None: if expiry is not None:
embed.description += '\n' + t(_p( embed.description += '\n' + t(_p(