Async Stuff, !rank doesn't mention anymore, setup finalizer, minor tweaks
This commit is contained in:
parent
b1f4e8ad93
commit
a549950ad9
4 changed files with 59 additions and 40 deletions
|
@ -22,12 +22,10 @@ namespace Geekbot.net.Modules
|
|||
public async Task getInfo()
|
||||
{
|
||||
var eb = new EmbedBuilder();
|
||||
// eb.WithAuthor(new EmbedAuthorBuilder()
|
||||
// .WithIconUrl(Context.Guild.IconUrl)
|
||||
// .WithName(Context.Guild.Name));
|
||||
eb.WithAuthor(new EmbedAuthorBuilder()
|
||||
.WithIconUrl(Context.Guild.IconUrl)
|
||||
.WithName(Context.Guild.Name));
|
||||
eb.WithColor(new Color(110, 204, 147));
|
||||
eb.Title = $":bar_chart: {Context.Guild.Name}";
|
||||
eb.ThumbnailUrl = Context.Guild.IconUrl;
|
||||
|
||||
var created = Context.Guild.CreatedAt;
|
||||
var age = Math.Floor((DateTime.Now - created).TotalDays);
|
||||
|
|
|
@ -53,7 +53,8 @@ namespace Geekbot.net.Modules
|
|||
var quote = createQuoteObject(lastMessage);
|
||||
var quoteStore = JsonConvert.SerializeObject(quote);
|
||||
redis.SetAdd($"{Context.Guild.Id}:Quotes", quoteStore);
|
||||
await ReplyAsync("Quote Added");
|
||||
var embed = quoteBuilder(quote);
|
||||
await ReplyAsync("**Quote Added**", false, embed.Build());
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
|
@ -71,7 +72,9 @@ namespace Geekbot.net.Modules
|
|||
var quote = createQuoteObject(message);
|
||||
var quoteStore = JsonConvert.SerializeObject(quote);
|
||||
redis.SetAdd($"{Context.Guild.Id}:Quotes", quoteStore);
|
||||
await ReplyAsync("Quote Added");
|
||||
var embed = quoteBuilder(quote);
|
||||
await ReplyAsync("**Quote Added**", false, embed.Build());
|
||||
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
|
|
|
@ -39,11 +39,9 @@ namespace Geekbot.net.Modules
|
|||
var percent = Math.Round((double) (100 * messages) / guildMessages, 2);
|
||||
|
||||
var eb = new EmbedBuilder();
|
||||
// eb.WithAuthor(new EmbedAuthorBuilder()
|
||||
// .WithIconUrl(userInfo.GetAvatarUrl())
|
||||
// .WithName(userInfo.Username));
|
||||
eb.Title = $":bar_chart: {userInfo.Username}#{userInfo.Discriminator}";
|
||||
eb.ThumbnailUrl = userInfo.GetAvatarUrl();
|
||||
eb.WithAuthor(new EmbedAuthorBuilder()
|
||||
.WithIconUrl(userInfo.GetAvatarUrl())
|
||||
.WithName(userInfo.Username));
|
||||
eb.WithColor(new Color(221, 255, 119));
|
||||
|
||||
eb.AddField("Discordian Since",
|
||||
|
@ -109,7 +107,7 @@ namespace Geekbot.net.Modules
|
|||
}
|
||||
|
||||
var highScore = new StringBuilder();
|
||||
if (failedToRetrieveUser) highScore.AppendLine(":warning: I couldn't get all userdata, i mentioned the missing ones, sorry!\n");
|
||||
if (failedToRetrieveUser) highScore.AppendLine(":warning: I couldn't get all userdata, sorry! (bugfix coming soon:tm:)\n");
|
||||
highScore.AppendLine($":bar_chart: **Highscore for {Context.Guild.Name}**");
|
||||
var highscorePlace = 1;
|
||||
foreach (var user in highscoreUsers)
|
||||
|
@ -123,7 +121,7 @@ namespace Geekbot.net.Modules
|
|||
else
|
||||
{
|
||||
highScore.AppendLine(
|
||||
$"{NumerToEmoji(highscorePlace)} **<@{user.Key.Id}>** - {percent}% of total - {user.Value} messages");
|
||||
$"{NumerToEmoji(highscorePlace)} **{user.Key.Id}** - {percent}% of total - {user.Value} messages");
|
||||
}
|
||||
highscorePlace++;
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue