few more fixes, added .iamn

This commit is contained in:
Master Kwoth
2016-03-16 02:29:41 +01:00
parent 61fe84bbbc
commit 170be53e5d
3 changed files with 36 additions and 4 deletions

View File

@ -28,7 +28,7 @@ namespace NadekoBot.Modules {
manager.CreateCommands("", cgb => {
cgb.AddCheck(Classes.Permissions.PermissionChecker.Instance);
cgb.CreateCommand("e")
.Description("You did it.")
.Do(async e => {
@ -173,11 +173,14 @@ namespace NadekoBot.Modules {
.Description("Pat someone ^_^")
.Parameter("user", ParameterType.Unparsed)
.Do(async e => {
var user = e.GetArg("user");
if (string.IsNullOrWhiteSpace(user) || !e.Message.MentionedUsers.Any()) return;
var userStr = e.GetArg("user");
if (string.IsNullOrWhiteSpace(userStr) || !e.Message.MentionedUsers.Any()) return;
var user = e.Server.FindUsers(userStr).FirstOrDefault();
if (user == null)
return;
try {
await e.Channel.SendMessage(
$"{e.Message.MentionedUsers.First().Mention} " +
$"{user.Mention} " +
$"{NadekoBot.Config.PatResponses[rng.Next(0, NadekoBot.Config.PatResponses.Length)]}");
} catch {
await e.Channel.SendMessage("Error while handling PatResponses check your data/config.json");