Stats Recorder, Redis, welcome on join

This commit is contained in:
dboerlage 2017-04-14 21:36:01 +02:00
parent 3ce207749f
commit 1fdbcaa471
No known key found for this signature in database
GPG key ID: BDA07B7D3FCF147F
4 changed files with 53 additions and 28 deletions

View file

@ -2,6 +2,7 @@
using System.Threading.Tasks;
using Discord;
using Discord.Commands;
using Geekbot.net.Lib;
namespace Geekbot.net.Modules
{
@ -15,9 +16,17 @@ namespace Geekbot.net.Modules
var age = Math.Floor((DateTime.Now - userInfo.CreatedAt).TotalDays);
await ReplyAsync($"{userInfo.Username}#{userInfo.Discriminator}\r\n" +
$"Account created at {userInfo.CreatedAt.Day}.{userInfo.CreatedAt.Month}.{userInfo.CreatedAt.Year}, that is {age} days ago\r\n" +
$"Currently {userInfo.Status}");
var redis = new RedisClient().Client;
var key = Context.Guild.Id + "-" + userInfo.Id + "-messages";
var messages = (int)redis.StringGet(key);
var level = GetLevelAtExperience(messages);
await ReplyAsync($"```\r\n" +
$"{userInfo.Username}#{userInfo.Discriminator}\r\n" +
$"Messages Sent: {messages}\r\n" +
$"Level: {level}\r\n" +
$"Discordian Since: {userInfo.CreatedAt.Day}/{userInfo.CreatedAt.Month}/{userInfo.CreatedAt.Year} ({age} days)" +
$"```");
}
[Command("level"), Summary("Get a level based on a number")]