.setnick command added

This commit is contained in:
Master Kwoth 2017-06-11 16:54:10 +02:00
parent 8b7b534619
commit 649c400cb7
3 changed files with 821 additions and 786 deletions

View File

@ -281,6 +281,30 @@ namespace NadekoBot.Modules.Administration
await ReplyConfirmLocalized("bot_name", Format.Bold(newName)).ConfigureAwait(false); await ReplyConfirmLocalized("bot_name", Format.Bold(newName)).ConfigureAwait(false);
} }
[NadekoCommand, Usage, Description, Aliases]
[RequireUserPermission(GuildPermission.ManageNicknames)]
[Priority(1)]
public async Task SetNick([Remainder] string newNick = null)
{
if (string.IsNullOrWhiteSpace(newNick))
return;
var curUser = await Context.Guild.GetCurrentUserAsync();
await curUser.ModifyAsync(u => u.Nickname = newNick).ConfigureAwait(false);
await ReplyConfirmLocalized("bot_nick", Format.Bold(newNick) ?? "-").ConfigureAwait(false);
}
[NadekoCommand, Usage, Description, Aliases]
[RequireBotPermission(GuildPermission.ManageNicknames)]
[RequireUserPermission(GuildPermission.ManageNicknames)]
[Priority(0)]
public async Task SetNick(IGuildUser gu, [Remainder] string newNick = null)
{
await gu.ModifyAsync(u => u.Nickname = newNick).ConfigureAwait(false);
await ReplyConfirmLocalized("user_nick", Format.Bold(gu.ToString()), Format.Bold(newNick) ?? "-").ConfigureAwait(false);
}
[NadekoCommand, Usage, Description, Aliases] [NadekoCommand, Usage, Description, Aliases]
[OwnerOnly] [OwnerOnly]
public async Task SetStatus([Remainder] SettableUserStatus status) public async Task SetStatus([Remainder] SettableUserStatus status)

View File

@ -702,6 +702,15 @@
<data name="setname_usage" xml:space="preserve"> <data name="setname_usage" xml:space="preserve">
<value>`{0}newnm BotName`</value> <value>`{0}newnm BotName`</value>
</data> </data>
<data name="setnick_cmd" xml:space="preserve">
<value>setnick</value>
</data>
<data name="setnick_desc" xml:space="preserve">
<value>Changes the nickname of the bot on this server. You can also target other users to change their nickname.</value>
</data>
<data name="setnick_usage" xml:space="preserve">
<value>`{0}setnick BotNickname` or `{0}setnick @SomeUser New Nickname`</value>
</data>
<data name="setavatar_cmd" xml:space="preserve"> <data name="setavatar_cmd" xml:space="preserve">
<value>setavatar setav</value> <value>setavatar setav</value>
</data> </data>

View File

@ -66,7 +66,9 @@
"administration_bandm": "You have been banned from {0} server.\nReason: {1}", "administration_bandm": "You have been banned from {0} server.\nReason: {1}",
"administration_banned_pl": "banned", "administration_banned_pl": "banned",
"administration_banned_user": "User Banned", "administration_banned_user": "User Banned",
"administration_bot_name": "Bot name changed to {0}", "administration_bot_name": "Bot's name changed to {0}",
"administration_bot_nick": "Bot's nickname changed to {0}",
"administration_user_nick": "Nickname of the user {0} changed to {1}",
"administration_bot_status": "Bot status changed to {0}", "administration_bot_status": "Bot status changed to {0}",
"administration_byedel_off": "Automatic deletion of bye messages has been disabled.", "administration_byedel_off": "Automatic deletion of bye messages has been disabled.",
"administration_byedel_on": "Bye messages will be deleted after {0} seconds.", "administration_byedel_on": "Bye messages will be deleted after {0} seconds.",