Merge remote-tracking branch 'refs/remotes/Kwoth/1.0' into math

This commit is contained in:
appelemac
2016-08-22 11:56:30 +02:00
13 changed files with 41 additions and 42 deletions

View File

@@ -23,7 +23,6 @@ namespace NadekoBot.Modules.Administration
{
}
////todo owner only
//[LocalizedCommand, LocalizedDescription, LocalizedSummary]
//[RequireContext(ContextType.Guild)]
@@ -445,6 +444,7 @@ namespace NadekoBot.Modules.Administration
public async Task Prune(IMessage msg, int count)
{
var channel = msg.Channel as ITextChannel;
await msg.DeleteAsync();
while (count > 0)
{
int limit = (count < 100) ? count : 100;
@@ -646,7 +646,7 @@ namespace NadekoBot.Modules.Administration
foreach (var role in roles)
{
send += $"\n`{role.Name}`\n";
send += string.Join(", ", (await channel.Guild.GetUsersAsync()).Where(u => u.Roles.Contains(role)).Distinct());
send += string.Join(", ", (await channel.Guild.GetUsersAsync()).Where(u => u.Roles.Contains(role)).Distinct().Select(u=>u.Mention));
}
while (send.Length > 2000)

View File

@@ -30,7 +30,7 @@ namespace NadekoBot.Modules.Administration
{
var channel = imsg.Channel as ITextChannel;
if (channel == null || await imsg.IsAuthor(_client))
if (channel == null || await imsg.IsAuthor())
return;
ConcurrentDictionary<ulong, DateTime> userTimePair;
if (!RatelimitingChannels.TryGetValue(channel.Id, out userTimePair)) return;

View File

@@ -196,7 +196,7 @@ namespace NadekoBot.Modules.Gambling
private async Task Client_MessageReceived(IMessage imsg)
{
if (await imsg.IsAuthor(NadekoBot.Client) || !(imsg.Channel is ITextChannel) || imsg.Channel != raceChannel)
if (await imsg.IsAuthor() || !(imsg.Channel is ITextChannel) || imsg.Channel != raceChannel)
return;
messagesSinceGameStarted++;
}

View File

@@ -27,7 +27,7 @@ namespace NadekoBot.Modules.Gambling
role = role ?? channel.Guild.EveryoneRole;
var members = (await role.Members()).Where(u => u.Status == UserStatus.Online);
var members = role.Members().Where(u => u.Status == UserStatus.Online);
var membersArray = members as IUser[] ?? members.ToArray();
var usr = membersArray[new Random().Next(0, membersArray.Length)];
await channel.SendMessageAsync($"**Raffled user:** {usr.Username} (id: {usr.Id})").ConfigureAwait(false);

View File

@@ -73,8 +73,8 @@ namespace NadekoBot.Modules.Searches
var channel = imsg.Channel as ITextChannel;
using (var http = new HttpClient())
{
var response = await http.GetStringAsync("http://tambal.azurewebsites.net/joke/random").ConfigureAwait(false);
await channel.SendMessageAsync("`" + JObject.Parse(response)["joke"].ToString() + "` 😆").ConfigureAwait(false);
var response = await http.GetStringAsync("http://api.icndb.com/jokes/random/").ConfigureAwait(false);
await channel.SendMessageAsync("`" + JObject.Parse(response)["value"]["joke"].ToString() + "` 😆").ConfigureAwait(false);
}
}

View File

@@ -59,8 +59,7 @@ $@"🌍 **Weather for** 【{obj["target"]}】
await channel.SendMessageAsync("No results found for that query.");
return;
}
var shortUrl = await result.ShortenUrl().ConfigureAwait(false);
await channel.SendMessageAsync(shortUrl).ConfigureAwait(false);
await channel.SendMessageAsync(result).ConfigureAwait(false);
}
[LocalizedCommand, LocalizedDescription, LocalizedSummary]