.adsarm added, not tested

This commit is contained in:
Kwoth 2016-10-20 04:45:44 +02:00
parent 7a4629c783
commit 83fe5dbce1
3 changed files with 334 additions and 982 deletions

View File

@ -20,6 +20,24 @@ namespace NadekoBot.Modules.Administration
public class SelfAssignedRolesCommands
{
[NadekoCommand, Usage, Description, Aliases]
[RequireContext(ContextType.Guild)]
[RequirePermission(GuildPermission.ManageMessages)]
public async Task AdSarm(IUserMessage imsg)
{
var channel = (ITextChannel)imsg.Channel;
bool newval;
using (var uow = DbHandler.UnitOfWork())
{
var config = uow.GuildConfigs.For(channel.Guild.Id);
newval = config.AutoDeleteSelfAssignedRoleMessages = !config.AutoDeleteSelfAssignedRoleMessages;
await uow.CompleteAsync().ConfigureAwait(false);
}
await channel.SendMessageAsync($"Automatic deleting of `iam` and `iamn` confirmations has been {(newval ? "enabled" : "disabled")}.")
.ConfigureAwait(false);
}
[NadekoCommand, Usage, Description, Aliases]
[RequireContext(ContextType.Guild)]
[RequirePermission(GuildPermission.ManageRoles)]

File diff suppressed because it is too large Load Diff

View File

@ -2466,4 +2466,13 @@
<data name="setmuterole_usage" xml:space="preserve">
<value>`{0}setmuterole Silenced`</value>
</data>
</root>
<data name="adsarm_cmd" xml:space="preserve">
<value>adsarm</value>
</data>
<data name="adsarm_desc" xml:space="preserve">
<value>Toggles the automatic deletion of confirmations for {0}iam and {0}iamn commands.</value>
</data>
<data name="adsarm_usage" xml:space="preserve">
<value>`{0}adsarm`</value>
</data>
</root>