More emojis changed. Removed color from create role command (.cr)

This commit is contained in:
Master Kwoth 2016-02-08 20:55:53 +01:00
parent ca5f2a3d8f
commit a270f3c91a
3 changed files with 11 additions and 21 deletions

View File

@ -236,7 +236,7 @@ namespace NadekoBot.Commands {
AnnouncementsDictionary[e.Server.Id].ToggleByePM(); AnnouncementsDictionary[e.Server.Id].ToggleByePM();
if (AnnouncementsDictionary[e.Server.Id].ByePM) if (AnnouncementsDictionary[e.Server.Id].ByePM)
await e.Send("Bye messages will be sent in a PM from now on.\n :warning: Keep in mind this might fail if the user and the bot have no common servers after the user leaves."); await e.Send("Bye messages will be sent in a PM from now on.\n Keep in mind this might fail if the user and the bot have no common servers after the user leaves.");
else else
await e.Send("Bye messages will be sent in a bound channel from now on."); await e.Send("Bye messages will be sent in a bound channel from now on.");
if (!AnnouncementsDictionary[e.Server.Id].Bye) if (!AnnouncementsDictionary[e.Server.Id].Bye)

View File

@ -82,28 +82,18 @@ namespace NadekoBot.Modules {
}); });
cgb.CreateCommand(".r").Alias(".role").Alias(".cr") cgb.CreateCommand(".r").Alias(".role").Alias(".cr")
.Description("Creates a role with a given name, and color.\n**Usage**: .r AwesomeRole Orange") .Description("Creates a role with a given name.**Usage**: .r Awesome Role")
.Parameter("role_name", ParameterType.Required) .Parameter("role_name", ParameterType.Unparsed)
.Parameter("role_color", ParameterType.Optional)
.Do(async e => { .Do(async e => {
if (!e.User.ServerPermissions.ManageRoles) return; if (!e.User.ServerPermissions.ManageRoles) return;
if (string.IsNullOrWhiteSpace(e.GetArg("role_name")))
var color = Color.Blue;
if (e.GetArg("role_color") != null) {
try {
if (e.GetArg("role_color") != null && e.GetArg("role_color").Trim().Length > 0)
color = (typeof(Color)).GetField(e.GetArg("role_color")).GetValue(null) as Color;
} catch (Exception ex) {
Console.WriteLine(ex.ToString());
await e.Send("Please supply a proper color.\n Example: DarkBlue, Orange, Teal");
return; return;
}
}
try { try {
var r = await e.Server.CreateRole(e.GetArg("role_name")); var r = await e.Server.CreateRole(e.GetArg("role_name"));
await r.Edit(null, null, color); await e.Send($"Successfully created role **{r.Name}**.");
await e.Send($"Successfully created role **{r.ToString()}**."); } catch (Exception ex) {
} catch (Exception) { } await e.Send(":warning: Unspecified error.");
}
}); });
cgb.CreateCommand(".rolecolor").Alias(".rc") cgb.CreateCommand(".rolecolor").Alias(".rc")
@ -438,7 +428,7 @@ namespace NadekoBot.Modules {
await Task.Delay(500); await Task.Delay(500);
} }
}); });
} catch (Exception) {} } catch (Exception) { }
bool throwaway; bool throwaway;
clearDictionary.TryRemove(e.Server, out throwaway); clearDictionary.TryRemove(e.Server, out throwaway);
}); });

View File

@ -195,7 +195,7 @@ namespace NadekoBot.Modules {
images.Add(System.Drawing.Bitmap.FromStream(await GetResponseStream(item["img"].ToString()))); images.Add(System.Drawing.Bitmap.FromStream(await GetResponseStream(item["img"].ToString())));
} }
if (items.Count > 4) { if (items.Count > 4) {
await e.Send(":warning: Found over 4 images. Showing random 4."); await e.Send(" Found over 4 images. Showing random 4.");
} }
Console.WriteLine("Start"); Console.WriteLine("Start");
await e.Channel.SendFile(arg + ".png", (await images.MergeAsync()).ToStream(System.Drawing.Imaging.ImageFormat.Png)); await e.Channel.SendFile(arg + ".png", (await images.MergeAsync()).ToStream(System.Drawing.Imaging.ImageFormat.Png));