Adds .rolehoist command
This commit is contained in:
@ -196,6 +196,18 @@ namespace NadekoBot.Modules.Administration
|
||||
await ReplyConfirmLocalized("cr", Format.Bold(r.Name)).ConfigureAwait(false);
|
||||
}
|
||||
|
||||
[NadekoCommand, Usage, Description, Aliases]
|
||||
[RequireContext(ContextType.Guild)]
|
||||
[RequireUserPermission(GuildPermission.ManageRoles)]
|
||||
[RequireBotPermission(GuildPermission.ManageRoles)]
|
||||
public async Task RoleHoist(string roleSearchName, bool targetState)
|
||||
{
|
||||
var roleName = roleSearchName.ToUpperInvariant();
|
||||
var role = Context.Guild.Roles.FirstOrDefault(r => r.Name.ToUpperInvariant() == roleName);
|
||||
|
||||
await role.ModifyAsync(r => r.Hoist = targetState).ConfigureAwait(false);
|
||||
}
|
||||
|
||||
[NadekoCommand, Usage, Description, Aliases]
|
||||
[RequireContext(ContextType.Guild)]
|
||||
[RequireUserPermission(GuildPermission.ManageRoles)]
|
||||
|
27
src/NadekoBot/Resources/CommandStrings.Designer.cs
generated
27
src/NadekoBot/Resources/CommandStrings.Designer.cs
generated
@ -6593,6 +6593,33 @@ namespace NadekoBot.Resources {
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Looks up a localized string similar to rolehoist rh.
|
||||
/// </summary>
|
||||
public static string rolehoist_cmd {
|
||||
get {
|
||||
return ResourceManager.GetString("rolehoist_cmd", resourceCulture);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Looks up a localized string similar to Toggles if this role is displayed in the sidebar or not.
|
||||
/// </summary>
|
||||
public static string rolehoist_desc {
|
||||
get {
|
||||
return ResourceManager.GetString("rolehoist_desc", resourceCulture);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Looks up a localized string similar to `{0}rh Guests true` or `{0}rh "Space Wizards" true.
|
||||
/// </summary>
|
||||
public static string rolehoist_usage {
|
||||
get {
|
||||
return ResourceManager.GetString("rolehoist_usage", resourceCulture);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Looks up a localized string similar to rolemdl rm.
|
||||
/// </summary>
|
||||
|
@ -3366,4 +3366,13 @@
|
||||
<data name="time_usage" xml:space="preserve">
|
||||
<value>`{0}time London, UK`</value>
|
||||
</data>
|
||||
<data name="rolehoist_cmd" xml:space="preserve">
|
||||
<value>rolehoist rh</value>
|
||||
</data>
|
||||
<data name="rolehoist_desc" xml:space="preserve">
|
||||
<value>Toggles if this role is displayed in the sidebar or not</value>
|
||||
</data>
|
||||
<data name="rolehoist_usage" xml:space="preserve">
|
||||
<value>`{0}rh Guests true` or `{0}rh "Space Wizards" true</value>
|
||||
</data>
|
||||
</root>
|
Reference in New Issue
Block a user