public static async Task SetBaseTrainerRequest(Client client, CommandHandler command) { var trainerString = command.Data["trainer"].Base64Decode(); trainerString = trainerString.Replace("\t", ""); await DbFriendSafari.SetTrainer(client, trainerString); }
public static async Task ChangeBaseMessageRequest(Client client, CommandHandler command) { if (string.IsNullOrWhiteSpace(command.Data["message"]) || command.Data["message"] == "nil") { await DbFriendSafari.RemoveMessage(client.UserId); } else { await DbFriendSafari.SetMessage(client.UserId, command.Data["message"].Base64Decode()); } }
public static async Task GetBaseTrainerRequest(Client client, CommandHandler command) { try { await DbFriendSafari.GetTrainer(client, command.Data["username"]); } catch { await client.SendMessage($"<BASETRA result=0 trainer=nil>"); throw; } }
public static async Task GetGiftsRequest(Client client, CommandHandler command) { try { await DbFriendSafari.GetGifts(client); } catch { await client.SendMessage("<FSGIFTS gifts=nil>"); throw; } }
public static async Task AddGiftRequest(Client client, CommandHandler command) { var username = command.Data["username"]; var giftString = command.Data["gift"]; if (!uint.TryParse(giftString, out var gift)) { Logger.Logger.Log($"Invalid gift was attempted to be given: '{giftString}'"); } var i = await DbFriendSafari.AddGift(gift, username); await client.SendMessage($"<BASEGIFT result={i}>"); }
public static async Task UploadBaseRequest(Client client, CommandHandler command) { var b = command.Data["base"].Base64Decode(); if (!FsChecker.IsValid(client, b)) { await client.SendMessage("<UBASE result=0>"); return; } await DbFriendSafari.UploadBase(client.UserId, b); await client.SendMessage("<UBASE result=1>"); }
public static async Task VisitRandomBase(Client client, CommandHandler command) { await DbFriendSafari.GetRandomBase(client); }
public static async Task VisitBaseRequest(Client client, CommandHandler command) { await DbFriendSafari.GetBase(command.Data["user"], client); }