Better help, better organization of aliases and commands names, a lot of commandnames changed.

This commit is contained in:
Master Kwoth 2016-06-18 00:02:03 +02:00
parent 8944df8478
commit 1feddabce1
7 changed files with 80 additions and 70 deletions

View File

@ -56,7 +56,7 @@ namespace NadekoBot.Modules.Administration
Environment.Exit(0); Environment.Exit(0);
}); });
cgb.CreateCommand(Prefix + "sr").Alias(Prefix + "setrole") cgb.CreateCommand(Prefix + "setrole").Alias(Prefix + "sr")
.Description("Sets a role for a given user.\n**Usage**: .sr @User Guest") .Description("Sets a role for a given user.\n**Usage**: .sr @User Guest")
.Parameter("user_name", ParameterType.Required) .Parameter("user_name", ParameterType.Required)
.Parameter("role_name", ParameterType.Unparsed) .Parameter("role_name", ParameterType.Unparsed)
@ -99,7 +99,7 @@ namespace NadekoBot.Modules.Administration
} }
}); });
cgb.CreateCommand(Prefix + "rr").Alias(Prefix + "removerole") cgb.CreateCommand(Prefix + "removerole").Alias(Prefix + "rr")
.Description("Removes a role from a given user.\n**Usage**: .rr @User Admin") .Description("Removes a role from a given user.\n**Usage**: .rr @User Admin")
.Parameter("user_name", ParameterType.Required) .Parameter("user_name", ParameterType.Required)
.Parameter("role_name", ParameterType.Unparsed) .Parameter("role_name", ParameterType.Unparsed)
@ -136,8 +136,8 @@ namespace NadekoBot.Modules.Administration
} }
}); });
cgb.CreateCommand(Prefix + "renr") cgb.CreateCommand(Prefix + "renamerole")
.Alias(Prefix + "renamerole") .Alias(Prefix + "renr")
.Description($"Renames a role. Role you are renaming must be lower than bot's highest role.\n**Usage**: `{Prefix}renr \"First role\" SecondRole`") .Description($"Renames a role. Role you are renaming must be lower than bot's highest role.\n**Usage**: `{Prefix}renr \"First role\" SecondRole`")
.Parameter("r1", ParameterType.Required) .Parameter("r1", ParameterType.Required)
.Parameter("r2", ParameterType.Required) .Parameter("r2", ParameterType.Required)
@ -170,7 +170,7 @@ namespace NadekoBot.Modules.Administration
} }
}); });
cgb.CreateCommand(Prefix + "rar").Alias(Prefix + "removeallroles") cgb.CreateCommand(Prefix + "removeallroles").Alias(Prefix + "rar")
.Description("Removes all roles from a mentioned user.\n**Usage**: .rar @User") .Description("Removes all roles from a mentioned user.\n**Usage**: .rar @User")
.Parameter("user_name", ParameterType.Unparsed) .Parameter("user_name", ParameterType.Unparsed)
.AddCheck(SimpleCheckers.CanManageRoles) .AddCheck(SimpleCheckers.CanManageRoles)
@ -196,7 +196,7 @@ namespace NadekoBot.Modules.Administration
} }
}); });
cgb.CreateCommand(Prefix + "r").Alias(Prefix + "role").Alias(Prefix + "cr") cgb.CreateCommand(Prefix + "createrole").Alias(Prefix + "cr")
.Description("Creates a role with a given name.**Usage**: `.r Awesome Role`") .Description("Creates a role with a given name.**Usage**: `.r Awesome Role`")
.Parameter("role_name", ParameterType.Unparsed) .Parameter("role_name", ParameterType.Unparsed)
.AddCheck(SimpleCheckers.CanManageRoles) .AddCheck(SimpleCheckers.CanManageRoles)
@ -278,7 +278,7 @@ namespace NadekoBot.Modules.Administration
await e.Channel.SendMessage("`List of roles:` \n• " + string.Join("\n• ", e.Server.Roles)).ConfigureAwait(false); await e.Channel.SendMessage("`List of roles:` \n• " + string.Join("\n• ", e.Server.Roles)).ConfigureAwait(false);
}); });
cgb.CreateCommand(Prefix + "b").Alias(Prefix + "ban") cgb.CreateCommand(Prefix + "ban").Alias(Prefix + "b")
.Parameter("user", ParameterType.Required) .Parameter("user", ParameterType.Required)
.Parameter("msg", ParameterType.Optional) .Parameter("msg", ParameterType.Optional)
.Description("Bans a user by id or name with an optional message.\n**Usage**: .b \"@some Guy\" Your behaviour is toxic.") .Description("Bans a user by id or name with an optional message.\n**Usage**: .b \"@some Guy\" Your behaviour is toxic.")
@ -313,7 +313,7 @@ namespace NadekoBot.Modules.Administration
} }
}); });
cgb.CreateCommand(Prefix + "sb").Alias(Prefix + "softban") cgb.CreateCommand(Prefix + "softban").Alias(Prefix + "sb")
.Parameter("user", ParameterType.Required) .Parameter("user", ParameterType.Required)
.Parameter("msg", ParameterType.Optional) .Parameter("msg", ParameterType.Optional)
.Description("Bans and then unbans a user by id or name with an optional message.\n**Usage**: .sb \"@some Guy\" Your behaviour is toxic.") .Description("Bans and then unbans a user by id or name with an optional message.\n**Usage**: .sb \"@some Guy\" Your behaviour is toxic.")
@ -349,7 +349,7 @@ namespace NadekoBot.Modules.Administration
} }
}); });
cgb.CreateCommand(Prefix + "k").Alias(Prefix + "kick") cgb.CreateCommand(Prefix + "kick").Alias(Prefix + "k")
.Parameter("user") .Parameter("user")
.Parameter("msg", ParameterType.Unparsed) .Parameter("msg", ParameterType.Unparsed)
.Description("Kicks a mentioned user.") .Description("Kicks a mentioned user.")
@ -462,7 +462,7 @@ namespace NadekoBot.Modules.Administration
}); });
cgb.CreateCommand(Prefix + "undeafen") cgb.CreateCommand(Prefix + "undeafen")
.Alias(Prefix + "undeaf") .Alias(Prefix + "undef")
.Description("Undeafens mentioned user or users") .Description("Undeafens mentioned user or users")
.Parameter("throwaway", ParameterType.Unparsed) .Parameter("throwaway", ParameterType.Unparsed)
.Do(async e => .Do(async e =>
@ -488,8 +488,9 @@ namespace NadekoBot.Modules.Administration
} }
}); });
cgb.CreateCommand(Prefix + "rvch") cgb.CreateCommand(Prefix + "delvoichanl")
.Description("Removes a voice channel with a given name.") .Alias(Prefix + "dvch")
.Description("Deletes a voice channel with a given name.")
.Parameter("channel_name", ParameterType.Required) .Parameter("channel_name", ParameterType.Required)
.Do(async e => .Do(async e =>
{ {
@ -510,7 +511,8 @@ namespace NadekoBot.Modules.Administration
} }
}); });
cgb.CreateCommand(Prefix + "vch").Alias(Prefix + "cvch") cgb.CreateCommand(Prefix + "creatvoichanl")
.Alias(Prefix + "cvch")
.Description("Creates a new voice channel with a given name.") .Description("Creates a new voice channel with a given name.")
.Parameter("channel_name", ParameterType.Required) .Parameter("channel_name", ParameterType.Required)
.Do(async e => .Do(async e =>
@ -529,8 +531,9 @@ namespace NadekoBot.Modules.Administration
} }
}); });
cgb.CreateCommand(Prefix + "rch").Alias(Prefix + "rtch") cgb.CreateCommand(Prefix + "deltxtchanl")
.Description("Removes a text channel with a given name.") .Alias(Prefix + "dtch")
.Description("Deletes a text channel with a given name.")
.Parameter("channel_name", ParameterType.Required) .Parameter("channel_name", ParameterType.Required)
.Do(async e => .Do(async e =>
{ {
@ -550,7 +553,8 @@ namespace NadekoBot.Modules.Administration
} }
}); });
cgb.CreateCommand(Prefix + "ch").Alias(Prefix + "tch") cgb.CreateCommand(Prefix + "creatxtchanl")
.Alias(Prefix + "ctch")
.Description("Creates a new text channel with a given name.") .Description("Creates a new text channel with a given name.")
.Parameter("channel_name", ParameterType.Required) .Parameter("channel_name", ParameterType.Required)
.Do(async e => .Do(async e =>
@ -569,8 +573,8 @@ namespace NadekoBot.Modules.Administration
} }
}); });
cgb.CreateCommand(Prefix + "st").Alias(Prefix + "settopic") cgb.CreateCommand(Prefix + "settopic")
.Alias(Prefix + "topic") .Alias(Prefix + "st")
.Description($"Sets a topic on the current channel.\n**Usage**: `{Prefix}st My new topic`") .Description($"Sets a topic on the current channel.\n**Usage**: `{Prefix}st My new topic`")
.AddCheck(SimpleCheckers.ManageChannels()) .AddCheck(SimpleCheckers.ManageChannels())
.Parameter("topic", ParameterType.Unparsed) .Parameter("topic", ParameterType.Unparsed)
@ -581,8 +585,8 @@ namespace NadekoBot.Modules.Administration
await e.Channel.SendMessage(":ok: **New channel topic set.**").ConfigureAwait(false); await e.Channel.SendMessage(":ok: **New channel topic set.**").ConfigureAwait(false);
}); });
cgb.CreateCommand(Prefix + "schn").Alias(Prefix + "setchannelname") cgb.CreateCommand(Prefix + "setchanlname")
.Alias(Prefix + "topic") .Alias(Prefix + "schn")
.Description("Changed the name of the current channel.") .Description("Changed the name of the current channel.")
.AddCheck(SimpleCheckers.ManageChannels()) .AddCheck(SimpleCheckers.ManageChannels())
.Parameter("name", ParameterType.Unparsed) .Parameter("name", ParameterType.Unparsed)
@ -595,7 +599,7 @@ namespace NadekoBot.Modules.Administration
await e.Channel.SendMessage(":ok: **New channel name set.**").ConfigureAwait(false); await e.Channel.SendMessage(":ok: **New channel name set.**").ConfigureAwait(false);
}); });
cgb.CreateCommand(Prefix + "uid").Alias(Prefix + "userid") cgb.CreateCommand(Prefix + "userid").Alias(Prefix + "uid")
.Description("Shows user ID.") .Description("Shows user ID.")
.Parameter("user", ParameterType.Unparsed) .Parameter("user", ParameterType.Unparsed)
.Do(async e => .Do(async e =>
@ -607,11 +611,11 @@ namespace NadekoBot.Modules.Administration
await e.Channel.SendMessage($"Id of the user { usr.Name } is { usr.Id }").ConfigureAwait(false); await e.Channel.SendMessage($"Id of the user { usr.Name } is { usr.Id }").ConfigureAwait(false);
}); });
cgb.CreateCommand(Prefix + "cid").Alias(Prefix + "channelid") cgb.CreateCommand(Prefix + "channelid").Alias(Prefix + "cid")
.Description("Shows current channel ID.") .Description("Shows current channel ID.")
.Do(async e => await e.Channel.SendMessage("This channel's ID is " + e.Channel.Id).ConfigureAwait(false)); .Do(async e => await e.Channel.SendMessage("This channel's ID is " + e.Channel.Id).ConfigureAwait(false));
cgb.CreateCommand(Prefix + "sid").Alias(Prefix + "serverid") cgb.CreateCommand(Prefix + "serverid").Alias(Prefix + "sid")
.Description("Shows current server ID.") .Description("Shows current server ID.")
.Do(async e => await e.Channel.SendMessage("This server's ID is " + e.Server.Id).ConfigureAwait(false)); .Do(async e => await e.Channel.SendMessage("This server's ID is " + e.Server.Id).ConfigureAwait(false));
@ -639,7 +643,7 @@ namespace NadekoBot.Modules.Administration
}); });
cgb.CreateCommand(Prefix + "prune") cgb.CreateCommand(Prefix + "prune")
.Alias(".clr") .Alias(Prefix + "clr")
.Description( .Description(
"`.prune` removes all nadeko's messages in the last 100 messages.`.prune X` removes last X messages from the channel (up to 100)`.prune @Someone` removes all Someone's messages in the last 100 messages.`.prune @Someone X` removes last X 'Someone's' messages in the channel.\n**Usage**: `.prune` or `.prune 5` or `.prune @Someone` or `.prune @Someone X`") "`.prune` removes all nadeko's messages in the last 100 messages.`.prune X` removes last X messages from the channel (up to 100)`.prune @Someone` removes all Someone's messages in the last 100 messages.`.prune @Someone X` removes last X 'Someone's' messages in the channel.\n**Usage**: `.prune` or `.prune 5` or `.prune @Someone` or `.prune @Someone X`")
.Parameter("user_or_num", ParameterType.Optional) .Parameter("user_or_num", ParameterType.Optional)
@ -709,7 +713,6 @@ namespace NadekoBot.Modules.Administration
}); });
cgb.CreateCommand(Prefix + "die") cgb.CreateCommand(Prefix + "die")
.Alias(Prefix + "graceful")
.Description("Shuts the bot down and notifies users about the restart. **Bot Owner Only!**") .Description("Shuts the bot down and notifies users about the restart. **Bot Owner Only!**")
.AddCheck(SimpleCheckers.OwnerOnly()) .AddCheck(SimpleCheckers.OwnerOnly())
.Do(async e => .Do(async e =>
@ -719,8 +722,8 @@ namespace NadekoBot.Modules.Administration
Environment.Exit(0); Environment.Exit(0);
}); });
cgb.CreateCommand(Prefix + "newname") cgb.CreateCommand(Prefix + "setname")
.Alias(Prefix + "setname") .Alias(Prefix + "newnm")
.Description("Give the bot a new name. **Bot Owner Only!**") .Description("Give the bot a new name. **Bot Owner Only!**")
.Parameter("new_name", ParameterType.Unparsed) .Parameter("new_name", ParameterType.Unparsed)
.AddCheck(SimpleCheckers.OwnerOnly()) .AddCheck(SimpleCheckers.OwnerOnly())
@ -839,8 +842,8 @@ namespace NadekoBot.Modules.Administration
await e.Channel.SendMessage("Failed. Make sure you've specified server and [channel or user]").ConfigureAwait(false); await e.Channel.SendMessage("Failed. Make sure you've specified server and [channel or user]").ConfigureAwait(false);
}); });
cgb.CreateCommand(Prefix + "menrole") cgb.CreateCommand(Prefix + "mentionrole")
.Alias(Prefix + "mentionrole") .Alias(Prefix + "menro")
.Description("Mentions every person from the provided role or roles (separated by a ',') on this server. Requires you to have mention everyone permission.") .Description("Mentions every person from the provided role or roles (separated by a ',') on this server. Requires you to have mention everyone permission.")
.Parameter("roles", ParameterType.Unparsed) .Parameter("roles", ParameterType.Unparsed)
.Do(async e => .Do(async e =>
@ -924,8 +927,7 @@ namespace NadekoBot.Modules.Administration
}).ConfigureAwait(false); }).ConfigureAwait(false);
}); });
cgb.CreateCommand(Prefix + "adddon") cgb.CreateCommand(Prefix + "donadd")
.Alias(Prefix + "donadd")
.Description("Add a donator to the database.") .Description("Add a donator to the database.")
.Parameter("donator") .Parameter("donator")
.Parameter("amount") .Parameter("amount")
@ -951,28 +953,6 @@ namespace NadekoBot.Modules.Administration
}).ConfigureAwait(false); }).ConfigureAwait(false);
}); });
cgb.CreateCommand(Prefix + "videocall")
.Description("Creates a private <http://www.appear.in> video call link for you and other mentioned people. The link is sent to mentioned people via a private message.")
.Parameter("arg", ParameterType.Unparsed)
.Do(async e =>
{
try
{
var allUsrs = e.Message.MentionedUsers.Union(new User[] { e.User });
var allUsrsArray = allUsrs as User[] ?? allUsrs.ToArray();
var str = allUsrsArray.Aggregate("http://appear.in/", (current, usr) => current + Uri.EscapeUriString(usr.Name[0].ToString()));
str += new Random().Next();
foreach (var usr in allUsrsArray)
{
await usr.SendMessage(str).ConfigureAwait(false);
}
}
catch (Exception ex)
{
Console.WriteLine(ex);
}
});
cgb.CreateCommand(Prefix + "announce") cgb.CreateCommand(Prefix + "announce")
.Description($"Sends a message to all servers' general channel bot is connected to.**Bot Owner Only!**\n**Usage**: {Prefix}announce Useless spam") .Description($"Sends a message to all servers' general channel bot is connected to.**Bot Owner Only!**\n**Usage**: {Prefix}announce Useless spam")
.Parameter("msg", ParameterType.Unparsed) .Parameter("msg", ParameterType.Unparsed)

View File

@ -19,7 +19,7 @@ namespace NadekoBot.Modules.Administration.Commands
{ {
var Prefix = Module.Prefix; var Prefix = Module.Prefix;
cgb.CreateCommand(Prefix + "addcustomreaction") cgb.CreateCommand(Prefix + "addcustreact")
.Alias(Prefix + "acr") .Alias(Prefix + "acr")
.Description($"Add a custom reaction. Guide here: <https://github.com/Kwoth/NadekoBot/wiki/Custom-Reactions> **Bot Owner Only!** \n**Usage**: {Prefix}acr \"hello\" I love saying hello to %user%") .Description($"Add a custom reaction. Guide here: <https://github.com/Kwoth/NadekoBot/wiki/Custom-Reactions> **Bot Owner Only!** \n**Usage**: {Prefix}acr \"hello\" I love saying hello to %user%")
.AddCheck(SimpleCheckers.OwnerOnly()) .AddCheck(SimpleCheckers.OwnerOnly())
@ -43,7 +43,7 @@ namespace NadekoBot.Modules.Administration.Commands
}); });
cgb.CreateCommand(Prefix + "listcustomreactions") cgb.CreateCommand(Prefix + "listcustreact")
.Alias(Prefix + "lcr") .Alias(Prefix + "lcr")
.Description($"Lists all current custom reactions (paginated with 5 commands per page).\n**Usage**:{Prefix}lcr 1") .Description($"Lists all current custom reactions (paginated with 5 commands per page).\n**Usage**:{Prefix}lcr 1")
.Parameter("num", ParameterType.Required) .Parameter("num", ParameterType.Required)
@ -55,7 +55,7 @@ namespace NadekoBot.Modules.Administration.Commands
await e.Channel.SendMessage(result).ConfigureAwait(false); await e.Channel.SendMessage(result).ConfigureAwait(false);
}); });
cgb.CreateCommand(Prefix + "deletecustomreaction") cgb.CreateCommand(Prefix + "delcustreact")
.Alias(Prefix + "dcr") .Alias(Prefix + "dcr")
.Description("Deletes a custom reaction with given name (and index)") .Description("Deletes a custom reaction with given name (and index)")
.Parameter("name", ParameterType.Required) .Parameter("name", ParameterType.Required)

View File

@ -16,8 +16,8 @@ namespace NadekoBot.Modules.Administration.Commands
internal override void Init(CommandGroupBuilder cgb) internal override void Init(CommandGroupBuilder cgb)
{ {
cgb.CreateCommand(Module.Prefix + "sinfo") cgb.CreateCommand(Module.Prefix + "serverinfo")
.Alias(Module.Prefix + "serverinfo") .Alias(Module.Prefix + "sinfo")
.Description($"Shows info about the server the bot is on. If no channel is supplied, it defaults to current one.\n**Usage**:{Module.Prefix}sinfo Some Server") .Description($"Shows info about the server the bot is on. If no channel is supplied, it defaults to current one.\n**Usage**:{Module.Prefix}sinfo Some Server")
.Parameter("server", ParameterType.Optional) .Parameter("server", ParameterType.Optional)
.Do(async e => .Do(async e =>
@ -47,8 +47,8 @@ namespace NadekoBot.Modules.Administration.Commands
await e.Channel.SendMessage(sb.ToString()).ConfigureAwait(false); await e.Channel.SendMessage(sb.ToString()).ConfigureAwait(false);
}); });
cgb.CreateCommand(Module.Prefix + "cinfo") cgb.CreateCommand(Module.Prefix + "channelinfo")
.Alias(Module.Prefix + "channelinfo") .Alias(Module.Prefix + "cinfo")
.Description($"Shows info about the channel. If no channel is supplied, it defaults to current one.\n**Usage**:{Module.Prefix}cinfo #some-channel") .Description($"Shows info about the channel. If no channel is supplied, it defaults to current one.\n**Usage**:{Module.Prefix}cinfo #some-channel")
.Parameter("channel", ParameterType.Optional) .Parameter("channel", ParameterType.Optional)
.Do(async e => .Do(async e =>
@ -69,8 +69,8 @@ namespace NadekoBot.Modules.Administration.Commands
await e.Channel.SendMessage(sb.ToString()).ConfigureAwait(false); await e.Channel.SendMessage(sb.ToString()).ConfigureAwait(false);
}); });
cgb.CreateCommand(Module.Prefix + "uinfo") cgb.CreateCommand(Module.Prefix + "userinfo")
.Alias(Module.Prefix + "userinfo") .Alias(Module.Prefix + "uinfo")
.Description($"Shows info about the user. If no user is supplied, it defaults a user running the command.\n**Usage**:{Module.Prefix}uinfo @SomeUser") .Description($"Shows info about the user. If no user is supplied, it defaults a user running the command.\n**Usage**:{Module.Prefix}uinfo @SomeUser")
.Parameter("user", ParameterType.Optional) .Parameter("user", ParameterType.Optional)
.Do(async e => .Do(async e =>

View File

@ -139,8 +139,8 @@ namespace NadekoBot.Modules.Administration.Commands
catch { } catch { }
}); });
cgb.CreateCommand(Module.Prefix + "iamn") cgb.CreateCommand(Module.Prefix + "iamnot")
.Alias(Module.Prefix + "iamnot") .Alias(Module.Prefix + "iamn")
.Description("Removes a role to you that you choose. " + .Description("Removes a role to you that you choose. " +
"Role must be on a list of self-assignable roles." + "Role must be on a list of self-assignable roles." +
"\n**Usage**: .iamn Gamer") "\n**Usage**: .iamn Gamer")

View File

@ -87,6 +87,7 @@ namespace NadekoBot.Modules.Administration.Commands
internal override void Init(CommandGroupBuilder cgb) internal override void Init(CommandGroupBuilder cgb)
{ {
cgb.CreateCommand(Module.Prefix + "cleanv+t") cgb.CreateCommand(Module.Prefix + "cleanv+t")
.Alias(Module.Prefix + "cv+t")
.Description("Deletes all text channels ending in `-voice` for which voicechannels are not found. **Use at your own risk.**") .Description("Deletes all text channels ending in `-voice` for which voicechannels are not found. **Use at your own risk.**")
.AddCheck(SimpleCheckers.CanManageRoles) .AddCheck(SimpleCheckers.CanManageRoles)
.AddCheck(SimpleCheckers.ManageChannels()) .AddCheck(SimpleCheckers.ManageChannels())
@ -116,8 +117,8 @@ namespace NadekoBot.Modules.Administration.Commands
await e.Channel.SendMessage("`Done.`"); await e.Channel.SendMessage("`Done.`");
}); });
cgb.CreateCommand(Module.Prefix + "v+t") cgb.CreateCommand(Module.Prefix + "voice+text")
.Alias(Module.Prefix + "voice+text") .Alias(Module.Prefix + "v+t")
.Description("Creates a text channel for each voice channel only users in that voice channel can see." + .Description("Creates a text channel for each voice channel only users in that voice channel can see." +
"If you are server owner, keep in mind you will see them all the time regardless.") "If you are server owner, keep in mind you will see them all the time regardless.")
.AddCheck(SimpleCheckers.ManageChannels()) .AddCheck(SimpleCheckers.ManageChannels())

View File

@ -50,7 +50,12 @@ namespace NadekoBot.Modules.Help
return; return;
} }
var i = 0; var i = 0;
await e.Channel.SendMessage("`List Of Commands:`\n```xl\n" + string.Join("\n", cmdsArray.GroupBy(item => (i++) / 3).Select(ig => string.Join("", ig.Select(el => $"{el.Text,-22}")))) + $"\n``` `You can type \"{Prefix}h command_name\" to see the help about that specific command.`").ConfigureAwait(false); await e.Channel.SendMessage("`List Of Commands:`\n```xl\n" +
string.Join("\n", cmdsArray.GroupBy(item => (i++) / 3)
.Select(ig => string.Join("", ig.Select(el => $"{el.Text,-15}" + $"{"[" + el.Aliases.FirstOrDefault() + "]",-8}"))))
+ $"\n```")
.ConfigureAwait(false);
await e.Channel.SendMessage($"`You can type \"{Prefix}h command_name\" to see the help about that specific command.`").ConfigureAwait(false);
}); });
}); });
} }

View File

@ -1,4 +1,5 @@
using Discord.Commands; using Discord;
using Discord.Commands;
using Discord.Modules; using Discord.Modules;
using NadekoBot.Classes; using NadekoBot.Classes;
using NadekoBot.Classes.JSONModels; using NadekoBot.Classes.JSONModels;
@ -472,7 +473,7 @@ $@"🌍 **Weather for** 【{obj["target"]}】
var red = Convert.ToInt32(arg1.Substring(0, 2), 16); var red = Convert.ToInt32(arg1.Substring(0, 2), 16);
var green = Convert.ToInt32(arg1.Substring(2, 2), 16); var green = Convert.ToInt32(arg1.Substring(2, 2), 16);
var blue = Convert.ToInt32(arg1.Substring(4, 2), 16); var blue = Convert.ToInt32(arg1.Substring(4, 2), 16);
var brush = new SolidBrush(Color.FromArgb(red, green, blue)); var brush = new SolidBrush(System.Drawing.Color.FromArgb(red, green, blue));
using (Graphics g = Graphics.FromImage(img)) using (Graphics g = Graphics.FromImage(img))
{ {
@ -482,6 +483,29 @@ $@"🌍 **Weather for** 【{obj["target"]}】
await e.Channel.SendFile("arg1.png", img.ToStream()); await e.Channel.SendFile("arg1.png", img.ToStream());
}); });
cgb.CreateCommand(Prefix + "videocall")
.Description("Creates a private <http://www.appear.in> video call link for you and other mentioned people. The link is sent to mentioned people via a private message.")
.Parameter("arg", ParameterType.Unparsed)
.Do(async e =>
{
try
{
var allUsrs = e.Message.MentionedUsers.Union(new User[] { e.User });
var allUsrsArray = allUsrs as User[] ?? allUsrs.ToArray();
var str = allUsrsArray.Aggregate("http://appear.in/", (current, usr) => current + Uri.EscapeUriString(usr.Name[0].ToString()));
str += new Random().Next();
foreach (var usr in allUsrsArray)
{
await usr.SendMessage(str).ConfigureAwait(false);
}
}
catch (Exception ex)
{
Console.WriteLine(ex);
}
});
}); });
} }
} }