Merge pull request #790 from samdivaio/dev

Update with more colours.
This commit is contained in:
Master Kwoth 2016-11-21 06:14:20 +01:00 committed by GitHub
commit 5776759281
5 changed files with 36 additions and 35 deletions

View File

@ -577,7 +577,7 @@ namespace NadekoBot.Modules.Administration
public async Task DelVoiChanl(IUserMessage umsg, [Remainder] IVoiceChannel voiceChannel) public async Task DelVoiChanl(IUserMessage umsg, [Remainder] IVoiceChannel voiceChannel)
{ {
await voiceChannel.DeleteAsync().ConfigureAwait(false); await voiceChannel.DeleteAsync().ConfigureAwait(false);
await umsg.Channel.SendMessageAsync($"❗️Removed voice channel **{voiceChannel.Name}** successfully.").ConfigureAwait(false); await umsg.Channel.SendMessageAsync($"🗑 Removed voice channel **{voiceChannel.Name}** successfully.").ConfigureAwait(false);
} }
[NadekoCommand, Usage, Description, Aliases] [NadekoCommand, Usage, Description, Aliases]
@ -587,7 +587,7 @@ namespace NadekoBot.Modules.Administration
{ {
var channel = (ITextChannel)umsg.Channel; var channel = (ITextChannel)umsg.Channel;
var ch = await channel.Guild.CreateVoiceChannelAsync(channelName).ConfigureAwait(false); var ch = await channel.Guild.CreateVoiceChannelAsync(channelName).ConfigureAwait(false);
await channel.SendMessageAsync($"✅ Created voice channel **{ch.Name}**, ID `{ch.Id}`.").ConfigureAwait(false); await channel.SendMessageAsync($"✅ Created voice channel **{ch.Name}**, ID: {ch.Id}.").ConfigureAwait(false);
} }
[NadekoCommand, Usage, Description, Aliases] [NadekoCommand, Usage, Description, Aliases]
@ -596,7 +596,7 @@ namespace NadekoBot.Modules.Administration
public async Task DelTxtChanl(IUserMessage umsg, [Remainder] ITextChannel toDelete) public async Task DelTxtChanl(IUserMessage umsg, [Remainder] ITextChannel toDelete)
{ {
await toDelete.DeleteAsync().ConfigureAwait(false); await toDelete.DeleteAsync().ConfigureAwait(false);
await umsg.Channel.SendMessageAsync($"Removed text channel **{toDelete.Name}**, ID `{toDelete.Id}`.").ConfigureAwait(false); await umsg.Channel.SendMessageAsync($"🗑 Removed text channel **{toDelete.Name}**, ID: {toDelete.Id}.").ConfigureAwait(false);
} }
[NadekoCommand, Usage, Description, Aliases] [NadekoCommand, Usage, Description, Aliases]
@ -606,7 +606,7 @@ namespace NadekoBot.Modules.Administration
{ {
var channel = (ITextChannel)umsg.Channel; var channel = (ITextChannel)umsg.Channel;
var txtCh = await channel.Guild.CreateTextChannelAsync(channelName).ConfigureAwait(false); var txtCh = await channel.Guild.CreateTextChannelAsync(channelName).ConfigureAwait(false);
await channel.SendMessageAsync($"✅ Added text channel **{txtCh.Name}**, ID `{txtCh.Id}`.").ConfigureAwait(false); await channel.SendMessageAsync($"✅ Added text channel **{txtCh.Name}**, ID: {txtCh.Id}.").ConfigureAwait(false);
} }
[NadekoCommand, Usage, Description, Aliases] [NadekoCommand, Usage, Description, Aliases]
@ -693,7 +693,7 @@ namespace NadekoBot.Modules.Administration
await (await NadekoBot.Client.GetCurrentUserAsync()).ModifyAsync(u => u.Username = newName).ConfigureAwait(false); await (await NadekoBot.Client.GetCurrentUserAsync()).ModifyAsync(u => u.Username = newName).ConfigureAwait(false);
await channel.SendMessageAsync($"🆒 Successfully changed name to **{newName}**").ConfigureAwait(false); await channel.SendMessageAsync($" Successfully changed name to **{newName}**").ConfigureAwait(false);
} }
[NadekoCommand, Usage, Description, Aliases] [NadekoCommand, Usage, Description, Aliases]

View File

@ -202,13 +202,13 @@ namespace NadekoBot.Modules.Administration
if (userThreshold < 2 || userThreshold > 30) if (userThreshold < 2 || userThreshold > 30)
{ {
await channel.SendMessageAsync("User threshold must be between 2 and 30").ConfigureAwait(false); await channel.SendMessageAsync("❗️User threshold must be between **2** and **30**.").ConfigureAwait(false);
return; return;
} }
if (seconds < 2 || seconds > 300) if (seconds < 2 || seconds > 300)
{ {
await channel.SendMessageAsync("Time must be between 2 and 300 seconds.").ConfigureAwait(false); await channel.SendMessageAsync("❗️Time must be between **2** and **300** seconds.").ConfigureAwait(false);
return; return;
} }
@ -218,7 +218,7 @@ namespace NadekoBot.Modules.Administration
} }
catch (Exception ex) catch (Exception ex)
{ {
await channel.SendMessageAsync("Failed creating a mute role. Give me ManageRoles permission" + await channel.SendMessageAsync("⚠️ Failed creating a mute role. Give me ManageRoles permission" +
"or create 'nadeko-mute' role with disabled SendMessages and try again.") "or create 'nadeko-mute' role with disabled SendMessages and try again.")
.ConfigureAwait(false); .ConfigureAwait(false);
_log.Warn(ex); _log.Warn(ex);
@ -233,7 +233,7 @@ namespace NadekoBot.Modules.Administration
}; };
antiRaidGuilds.AddOrUpdate(channel.Guild.Id, setting, (id, old) => setting); antiRaidGuilds.AddOrUpdate(channel.Guild.Id, setting, (id, old) => setting);
await channel.SendMessageAsync($"{imsg.Author.Mention} `If {userThreshold} or more users join within {seconds} seconds, I will {action} them.`") await channel.SendMessageAsync($" {imsg.Author.Mention} If **{userThreshold}** or more users join within **{seconds}** seconds, I will **{action}** them.")
.ConfigureAwait(false); .ConfigureAwait(false);
} }
@ -250,7 +250,7 @@ namespace NadekoBot.Modules.Administration
AntiSpamSetting throwaway; AntiSpamSetting throwaway;
if (antiSpamGuilds.TryRemove(channel.Guild.Id, out throwaway)) if (antiSpamGuilds.TryRemove(channel.Guild.Id, out throwaway))
{ {
await channel.SendMessageAsync("`Anti-Spam feature disabled on this server.`").ConfigureAwait(false); await channel.SendMessageAsync("🆗 **Anti-Spam feature** has been **disabled** on this server.").ConfigureAwait(false);
} }
else else
{ {
@ -260,7 +260,7 @@ namespace NadekoBot.Modules.Administration
} }
catch (Exception ex) catch (Exception ex)
{ {
await channel.SendMessageAsync("Failed creating a mute role. Give me ManageRoles permission" + await channel.SendMessageAsync("⚠️ Failed creating a mute role. Give me ManageRoles permission" +
"or create 'nadeko-mute' role with disabled SendMessages and try again.") "or create 'nadeko-mute' role with disabled SendMessages and try again.")
.ConfigureAwait(false); .ConfigureAwait(false);
_log.Warn(ex); _log.Warn(ex);
@ -272,7 +272,7 @@ namespace NadekoBot.Modules.Administration
Action = action, Action = action,
MessageThreshold = messageCount, MessageThreshold = messageCount,
})) }))
await channel.SendMessageAsync("`Anti-Spam feature enabled on this server.`").ConfigureAwait(false); await channel.SendMessageAsync("✅ **Anti-Spam feature** has been **enabled** on this server.").ConfigureAwait(false);
} }
} }

View File

@ -69,11 +69,11 @@ namespace NadekoBot.Modules.Administration
if (role == null) if (role == null)
{ {
await channel.SendMessageAsync("`Auto assign role on user join is now disabled.`").ConfigureAwait(false); await channel.SendMessageAsync("🆗 **Auto assign role** on user join is now **disabled**.").ConfigureAwait(false);
return; return;
} }
await channel.SendMessageAsync("`Auto assigned role is set.`").ConfigureAwait(false); await channel.SendMessageAsync("✅ **Auto assign role** on user join is now **enabled**.").ConfigureAwait(false);
} }
} }
} }

View File

@ -39,9 +39,9 @@ namespace NadekoBot.Modules.Administration
uow.Complete(); uow.Complete();
} }
if (ForwardDMs) if (ForwardDMs)
await channel.SendMessageAsync("`I will forward DMs from now on.`").ConfigureAwait(false); await channel.SendMessageAsync("✅ **I will forward DMs from now on.**").ConfigureAwait(false);
else else
await channel.SendMessageAsync("`I will stop forwarding DMs.`").ConfigureAwait(false); await channel.SendMessageAsync("🆗 **I will stop forwarding DMs from now on.**").ConfigureAwait(false);
} }
[NadekoCommand, Usage, Description, Aliases] [NadekoCommand, Usage, Description, Aliases]
@ -57,9 +57,9 @@ namespace NadekoBot.Modules.Administration
uow.Complete(); uow.Complete();
} }
if (ForwardDMsToAllOwners) if (ForwardDMsToAllOwners)
await channel.SendMessageAsync("`I will forward DMs to all owners.`").ConfigureAwait(false); await channel.SendMessageAsync(" **I will forward DMs to all owners.**").ConfigureAwait(false);
else else
await channel.SendMessageAsync("`I will forward DMs only to the first owner.`").ConfigureAwait(false); await channel.SendMessageAsync(" **I will forward DMs only to the first owner.**").ConfigureAwait(false);
} }
@ -67,7 +67,7 @@ namespace NadekoBot.Modules.Administration
{ {
if (ForwardDMs && ownerChannels.Any()) if (ForwardDMs && ownerChannels.Any())
{ {
var toSend = $"`I received a message from {msg.Author} ({msg.Author.Id})`: {msg.Content}"; var toSend = $"```markdown\n I received a message from [{msg.Author}]({msg.Author.Id}): {msg.Content}```";
if (ForwardDMsToAllOwners) if (ForwardDMsToAllOwners)
{ {
var msgs = await Task.WhenAll(ownerChannels.Where(ch => ch.Recipient.Id != msg.Author.Id) var msgs = await Task.WhenAll(ownerChannels.Where(ch => ch.Recipient.Id != msg.Author.Id)

View File

@ -37,9 +37,9 @@ namespace NadekoBot.Modules.Utility
int i = 0; int i = 0;
if (!arr.Any()) if (!arr.Any())
await channel.SendMessageAsync(_l["`Nobody is playing that game.`"]).ConfigureAwait(false); await channel.SendMessageAsync(_l["🚧 `Nobody is playing that game.`"]).ConfigureAwait(false);
else else
await channel.SendMessageAsync("```xl\n" + string.Join("\n", arr.GroupBy(item => (i++) / 3).Select(ig => string.Concat(ig.Select(el => $"• {el,-35}")))) + "\n```").ConfigureAwait(false); await channel.SendMessageAsync("```css\n" + string.Join("\n", arr.GroupBy(item => (i++) / 3).Select(ig => string.Concat(ig.Select(el => $"• {el,-35}")))) + "\n```").ConfigureAwait(false);
} }
[NadekoCommand, Usage, Description, Aliases] [NadekoCommand, Usage, Description, Aliases]
@ -50,20 +50,21 @@ namespace NadekoBot.Modules.Utility
return; return;
var channel = (ITextChannel)umsg.Channel; var channel = (ITextChannel)umsg.Channel;
var arg = roles.Split(',').Select(r => r.Trim().ToUpperInvariant()); var arg = roles.Split(',').Select(r => r.Trim().ToUpperInvariant());
string send = _l["`Here is a list of users in a specfic role:`"]; string send = _l[" **Here is a list of users in a specfic role:**"];
foreach (var roleStr in arg.Where(str => !string.IsNullOrWhiteSpace(str) && str != "@EVERYONE" && str != "EVERYONE")) foreach (var roleStr in arg.Where(str => !string.IsNullOrWhiteSpace(str) && str != "@EVERYONE" && str != "EVERYONE"))
{ {
var role = channel.Guild.Roles.Where(r => r.Name.ToUpperInvariant() == roleStr).FirstOrDefault(); var role = channel.Guild.Roles.Where(r => r.Name.ToUpperInvariant() == roleStr).FirstOrDefault();
if (role == null) continue; if (role == null) continue;
send += $"\n`{role.Name}`\n"; send += $"```css\n[{role.Name}]\n";
send += string.Join(", ", channel.Guild.GetUsers().Where(u => u.Roles.Contains(role)).Select(u => u.ToString())); send += string.Join(", ", channel.Guild.GetUsers().Where(u => u.Roles.Contains(role)).Select(u => u.ToString()));
send += $"\n```";
} }
var usr = umsg.Author as IGuildUser; var usr = umsg.Author as IGuildUser;
while (send.Length > 2000) while (send.Length > 2000)
{ {
if (!usr.GetPermissions(channel).ManageMessages) if (!usr.GetPermissions(channel).ManageMessages)
{ {
await channel.SendMessageAsync($"{usr.Mention} you are not allowed to use this command on roles with a lot of users in them to prevent abuse.").ConfigureAwait(false); await channel.SendMessageAsync($"⚠️ {usr.Mention} **you are not allowed to use this command on roles with a lot of users in them to prevent abuse.**").ConfigureAwait(false);
return; return;
} }
var curstr = send.Substring(0, 2000); var curstr = send.Substring(0, 2000);
@ -80,7 +81,7 @@ namespace NadekoBot.Modules.Utility
public async Task CheckMyPerms(IUserMessage msg) public async Task CheckMyPerms(IUserMessage msg)
{ {
StringBuilder builder = new StringBuilder("```\n"); StringBuilder builder = new StringBuilder("```http\n");
var user = msg.Author as IGuildUser; var user = msg.Author as IGuildUser;
var perms = user.GetPermissions((ITextChannel)msg.Channel); var perms = user.GetPermissions((ITextChannel)msg.Channel);
foreach (var p in perms.GetType().GetProperties().Where(p => !p.GetGetMethod().GetParameters().Any())) foreach (var p in perms.GetType().GetProperties().Where(p => !p.GetGetMethod().GetParameters().Any()))
@ -97,20 +98,20 @@ namespace NadekoBot.Modules.Utility
public async Task UserId(IUserMessage msg, IGuildUser target = null) public async Task UserId(IUserMessage msg, IGuildUser target = null)
{ {
var usr = target ?? msg.Author; var usr = target ?? msg.Author;
await msg.Reply($"Id of the user { usr.Username } is { usr.Id }").ConfigureAwait(false); await msg.Reply($"🆔 of the user **{ usr.Username }** is `{ usr.Id }`").ConfigureAwait(false);
} }
[NadekoCommand, Usage, Description, Aliases] [NadekoCommand, Usage, Description, Aliases]
public async Task ChannelId(IUserMessage msg) public async Task ChannelId(IUserMessage msg)
{ {
await msg.Reply($"This Channel's ID is {msg.Channel.Id}").ConfigureAwait(false); await msg.Reply($" This **Channel's ID** is `{msg.Channel.Id}`").ConfigureAwait(false);
} }
[NadekoCommand, Usage, Description, Aliases] [NadekoCommand, Usage, Description, Aliases]
[RequireContext(ContextType.Guild)] [RequireContext(ContextType.Guild)]
public async Task ServerId(IUserMessage msg) public async Task ServerId(IUserMessage msg)
{ {
await msg.Reply($"This server's ID is {((ITextChannel)msg.Channel).Guild.Id}").ConfigureAwait(false); await msg.Reply($" This **Server's ID** is `{((ITextChannel)msg.Channel).Guild.Id}`").ConfigureAwait(false);
} }
[NadekoCommand, Usage, Description, Aliases] [NadekoCommand, Usage, Description, Aliases]
@ -126,11 +127,11 @@ namespace NadekoBot.Modules.Utility
return; return;
if (target != null) if (target != null)
{ {
await msg.Reply($"`Page #{page} of roles for **{target.Username}**:` \n• " + string.Join("\n• ", target.Roles.Except(new[] { guild.EveryoneRole }).OrderBy(r => r.Position).Skip((page - 1) * RolesPerPage).Take(RolesPerPage)).SanitizeMentions()); await msg.Reply($"⚔ **Page #{page} of roles for {target.Username}:** ```css\n• " + string.Join("\n• ", target.Roles.Except(new[] { guild.EveryoneRole }).OrderBy(r => r.Position).Skip((page - 1) * RolesPerPage).Take(RolesPerPage)).SanitizeMentions() + "\n```");
} }
else else
{ {
await msg.Reply($"`Page #{page} of all roles on this server:` \n• " + string.Join("\n• ", guild.Roles.Except(new[] { guild.EveryoneRole }).OrderBy(r => r.Position).Skip((page - 1) * RolesPerPage).Take(RolesPerPage)).SanitizeMentions()); await msg.Reply($"⚔ **Page #{page} of all roles on this server:** ```css\n• " + string.Join("\n• ", guild.Roles.Except(new[] { guild.EveryoneRole }).OrderBy(r => r.Position).Skip((page - 1) * RolesPerPage).Take(RolesPerPage)).SanitizeMentions() + "\n```");
} }
} }
@ -147,9 +148,9 @@ namespace NadekoBot.Modules.Utility
var topic = channel.Topic; var topic = channel.Topic;
if (string.IsNullOrWhiteSpace(topic)) if (string.IsNullOrWhiteSpace(topic))
await channel.SendMessageAsync("`No topic set.`"); await channel.SendMessageAsync("❎ **No topic set.**");
else else
await channel.SendMessageAsync("`Topic:` " + topic); await channel.SendMessageAsync(" **Topic:** " + topic);
} }
[NadekoCommand, Usage, Description, Aliases] [NadekoCommand, Usage, Description, Aliases]
@ -167,7 +168,7 @@ namespace NadekoBot.Modules.Utility
var matches = emojiFinder.Matches(emojis); var matches = emojiFinder.Matches(emojis);
var result = string.Join("\n", matches.Cast<Match>() var result = string.Join("\n", matches.Cast<Match>()
.Select(m => $"`Name:` {m.Groups["name"]} `Link:` http://discordapp.com/api/emojis/{m.Groups["id"]}.png")); .Select(m => $"**Name:** {m.Groups["name"]} **Link:** http://discordapp.com/api/emojis/{m.Groups["id"]}.png"));
await msg.Channel.SendMessageAsync(result).ConfigureAwait(false); await msg.Channel.SendMessageAsync(result).ConfigureAwait(false);
} }
@ -188,11 +189,11 @@ namespace NadekoBot.Modules.Utility
if (!guilds.Any()) if (!guilds.Any())
{ {
await channel.SendMessageAsync("`No servers found on that page.`").ConfigureAwait(false); await channel.SendMessageAsync("❎ No servers found on that page.").ConfigureAwait(false);
return; return;
} }
await channel.SendMessageAsync(String.Join("\n", guilds.Select(g => $"`Name:` {g.Name} `Id:` {g.Id} `Members:` {g.GetUsers().Count} `OwnerId:`{g.OwnerId}"))).ConfigureAwait(false); await channel.SendMessageAsync(String.Join("\n", guilds.Select(g => $"```css\n Name: {g.Name} ID: {g.Id} Members: #{g.GetUsers().Count} OwnerID:{g.OwnerId} ```"))).ConfigureAwait(false);
} }
//[NadekoCommand, Usage, Description, Aliases] //[NadekoCommand, Usage, Description, Aliases]