/user add atr value member #179 #182

Merged
edraft merged 6 commits from #179 into 0.3.1 2023-01-13 23:28:37 +01:00
Showing only changes of commit 5d3ceff3bf - Show all commits

View File

@ -231,8 +231,8 @@ class UserGroup(DiscordCommandABC):
@commands.guild_only()
@CommandChecks.check_is_ready()
@CommandChecks.check_is_member_moderator()
async def remove(self, ctx: Context, atr: str, member: discord.Member = None):
self._logger.debug(__name__, f'Received command user-remove {atr} {ctx}:{member}')
async def reset(self, ctx: Context, atr: str, member: discord.Member = None):
self._logger.debug(__name__, f'Received command user-reset {atr} {ctx}:{member}')
if member is None or not isinstance(member, discord.Member):
member = ctx.author
@ -259,11 +259,11 @@ class UserGroup(DiscordCommandABC):
await self._message_service.send_interaction_msg(
ctx.interaction,
self._t.transform(f'modules.base.user.remove.{atr.lower()}').format(atr, member.mention)
self._t.transform(f'modules.base.user.reset.{atr.lower()}').format(atr, member.mention)
)
@remove.autocomplete('atr')
async def remove_autocomplete(self, interaction: discord.Interaction, current: str) -> List[
@reset.autocomplete('atr')
async def reset_autocomplete(self, interaction: discord.Interaction, current: str) -> List[
app_commands.Choice[str]
]:
return [app_commands.Choice(name=value, value=key) for key, value in self._atr_list]