This commit is contained in:
2022-06-08 19:59:58 +03:00
parent 531edcd3cc
commit 51324f6dca
8 changed files with 47 additions and 21 deletions

View File

@@ -23,6 +23,12 @@ internal class Level : DBCommand
public async void Execute(SocketCommandContext context, SocketMessage message, DiscordSocketClient client, bool isDM)
{
if (!File.Exists(Config.GetValue<string>("LevelingSystemPath") + $"/{message.Author.Id}.dat"))
{
await context.Channel.SendMessageAsync("You are now unranked !");
return;
}
var user = await Functions.ConvertFromJson<User>(Config.GetValue<string>("LevelingSystemPath") + $"/{message.Author.Id}.dat");
if (user == null)
{

View File

@@ -1,9 +1,18 @@
namespace CMD_LevelingSystem;
using Discord.WebSocket;
namespace CMD_LevelingSystem;
public class DiscordUser
{
public string Username { get; set; }
public ushort DiscordTag { get; set; }
public ulong userID { get; set; }
}
public class User
{
public string userID { get; set; }
public int CurrentLevel { get; set; }
public long CurrentEXP { get; set; }
public long RequiredEXPToLevelUp { get; set; }
public DiscordUser user { get; set; }
public int CurrentLevel { get; set; }
public long CurrentEXP { get; set; }
public long RequiredEXPToLevelUp { get; set; }
}