.setnick command added closes #1195

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

View File

@ -203,7 +203,7 @@ namespace NadekoBot.Modules.Administration
await ReplyConfirmLocalized("fwall_stop").ConfigureAwait(false);
}
[NadekoCommand, Usage, Description, Aliases]
[OwnerOnly]
public async Task ConnectShard(int shardid)
@ -281,6 +281,30 @@ namespace NadekoBot.Modules.Administration
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]
[OwnerOnly]
public async Task SetStatus([Remainder] SettableUserStatus status)

View File

@ -702,6 +702,15 @@
<data name="setname_usage" xml:space="preserve">
<value>`{0}newnm BotName`</value>
</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">
<value>setavatar setav</value>
</data>

File diff suppressed because it is too large Load Diff