fixes, ;pr , donators fixed

This commit is contained in:
Master Kwoth
2016-02-13 17:01:24 +01:00
parent 02953e84e4
commit ca52c29559
5 changed files with 69 additions and 33 deletions

View File

@ -580,8 +580,8 @@ namespace NadekoBot.Modules {
var rows = Classes.DBHandler.Instance.GetAllRows<Donator>();
var donatorsOrdered = rows.OrderBy(d => d.Amount);
string str = $"`Total number of people who donated is {donatorsOrdered.Count()}`\n";
await e.Channel.SendMessage(string.Join(", ", donatorsOrdered));
await e.Channel.SendMessage(string.Join(", ", donatorsOrdered.Select(d => d.UserName)));
});
});

View File

@ -20,7 +20,7 @@ namespace NadekoBot.Modules {
cgb.AddCheck(Classes.Permissions.PermissionChecker.Instance);
cgb.CreateCommand("~hentai")
.Description("Shows a random NSFW hentai image from gelbooru and danbooru with a given tag. Tag is optional but preffered.\n**Usage**: ~hentai yuri")
.Description("Shows a random NSFW hentai image from gelbooru and danbooru with a given tag. Tag is optional but preffered. (multiple tags are appended with +)\n**Usage**: ~hentai yuri")
.Parameter("tag", ParameterType.Unparsed)
.Do(async e => {
string tag = e.GetArg("tag");
@ -30,7 +30,7 @@ namespace NadekoBot.Modules {
await e.Send(":heart: Danbooru: " + await SearchHelper.GetDanbooruImageLink(tag));
});
cgb.CreateCommand("~danbooru")
.Description("Shows a random hentai image from danbooru with a given tag. Tag is optional but preffered.\n**Usage**: ~danbooru yuri")
.Description("Shows a random hentai image from danbooru with a given tag. Tag is optional but preffered. (multiple tags are appended with +)\n**Usage**: ~danbooru yuri+kissing")
.Parameter("tag", ParameterType.Unparsed)
.Do(async e => {
string tag = e.GetArg("tag");
@ -39,7 +39,7 @@ namespace NadekoBot.Modules {
await e.Send(await SearchHelper.GetDanbooruImageLink(tag));
});
cgb.CreateCommand("~gelbooru")
.Description("Shows a random hentai image from gelbooru with a given tag. Tag is optional but preffered.\n**Usage**: ~gelbooru yuri")
.Description("Shows a random hentai image from gelbooru with a given tag. Tag is optional but preffered. (multiple tags are appended with +)\n**Usage**: ~gelbooru yuri+kissing")
.Parameter("tag", ParameterType.Unparsed)
.Do(async e => {
string tag = e.GetArg("tag");

View File

@ -21,15 +21,39 @@ namespace NadekoBot.Modules {
commands.ForEach(cmd => cmd.Init(cgb));
cgb.CreateCommand(prefix + "permrole")
.Alias(prefix + "pr")
.Description("Sets a role which can change permissions. Or supply no parameters to find out the current one. Default one is 'Nadeko'.")
.Parameter("role", ParameterType.Unparsed)
.Do(async e => {
if (string.IsNullOrWhiteSpace(e.GetArg("role"))) {
await e.Send($"Current permissions role is `{PermsHandler.GetServerPermissionsRoleName(e.Server)}`");
return;
}
var arg = e.GetArg("role");
Discord.Role role = null;
try {
role = PermissionHelper.ValidateRole(e.Server, arg);
} catch (Exception ex) {
Console.WriteLine(ex.Message);
await e.Send($"Role `{arg}` probably doesn't exist. Create the role with that name first.");
return;
}
PermsHandler.SetPermissionsRole(e.Server, role.Name);
await e.Send($"Role `{role.Name}` is now required in order to change permissions.");
});
cgb.CreateCommand(prefix + "verbose")
.Description("Sets whether to show when a command/module is blocked.\n**Usage**: ;verbose true")
.Parameter("arg", ParameterType.Required)
.Do(async e => {
var arg = e.GetArg("arg");
bool val = PermissionHelper.ValidateBool(arg);
PermsHandler.SetVerbosity(e.Server, val);
await e.Send($"Verbosity set to {val}.");
});
.Alias(prefix + "v")
.Description("Sets whether to show when a command/module is blocked.\n**Usage**: ;verbose true")
.Parameter("arg", ParameterType.Required)
.Do(async e => {
var arg = e.GetArg("arg");
bool val = PermissionHelper.ValidateBool(arg);
PermsHandler.SetVerbosity(e.Server, val);
await e.Send($"Verbosity set to {val}.");
});
cgb.CreateCommand(prefix + "serverperms")
.Alias(prefix + "sp")