rich logging fix for userids, updated commandlist

added bot.date and changed bot.time placeholder. They use timestamp tags now.
fixed double log on server leave
This commit is contained in:
Toastie (DCS Team) 2024-11-07 19:22:18 +13:00
parent e40a458dc5
commit 2fe1b94cea
Signed by: toastie_t0ast
GPG key ID: 27F3B6855AFD40A4
5 changed files with 44 additions and 12 deletions

View file

@ -71,7 +71,6 @@ public sealed class SelfService : IExecNoCommand, IReadyExecutor, IEService
if (server.OwnerId != _client.CurrentUser.Id)
{
await server.LeaveAsync();
Log.Information("Left server {Name} [{Id}]", server.Name, server.Id);
}
else
{

View file

@ -159,14 +159,14 @@ public class XpSvc : GrpcXp.GrpcXpBase, IGrpcSvc, IEService
_xp.SetRoleReward(request.GuildId, request.Level, rid, request.Type == "RemoveRole");
success = true;
}
else if (request.Type == "Currency")
{
if (!int.TryParse(request.Value, out var amount))
throw new RpcException(new Status(StatusCode.InvalidArgument, "Invalid amount"));
_xp.SetCurrencyReward(request.GuildId, request.Level, amount);
success = true;
}
// else if (request.Type == "Currency")
// {
// if (!int.TryParse(request.Value, out var amount))
// throw new RpcException(new Status(StatusCode.InvalidArgument, "Invalid amount"));
//
// _xp.SetCurrencyReward(request.GuildId, request.Level, amount);
// success = true;
// }
return new()
{

View file

@ -12,7 +12,11 @@ public sealed partial class ReplacementPatternStore
{
Register("%bot.time%",
static ()
=> DateTime.Now.ToString("HH:mm " + TimeZoneInfo.Local.StandardName.GetInitials()));
=> TimestampTag.FromDateTime(DateTime.UtcNow, TimestampTagStyles.ShortTime).ToString());
Register("%bot.date%",
static ()
=> TimestampTag.FromDateTime(DateTime.UtcNow, TimestampTagStyles.ShortTime).ToString());
}
private void WithClient()

View file

@ -165,7 +165,7 @@ public class CommandHandler : IEService, IReadyExecutor, ICommandHandler
Log.Information("Succ | g:{GuildId} | c: {ChannelId} | u: {UserId} | msg: {Message}",
channel?.Guild.Id.ToString() ?? "-",
channel?.Id.ToString() ?? "-",
usrMsg.Author.Id,
usrMsg.Author.Id.ToString(),
usrMsg.Content.TrimTo(10));
}

View file

@ -3030,6 +3030,20 @@
"Bot Owner Only"
]
},
{
"Aliases": [
".rakeback",
".rb"
],
"Description": "Try to claim any rakeback that you have avaialable.\nRakeback is accumulated by betting (not by winning or losing).\nDefault rakeback is 0.05 * house edge\nHouse edge is defined per game",
"Usage": [
".rakeback"
],
"Submodule": "Gambling",
"Module": "Gambling",
"Options": null,
"Requirements": []
},
{
"Aliases": [
".race"
@ -3601,10 +3615,25 @@
"Options": null,
"Requirements": []
},
{
"Aliases": [
".waifuclaims",
".claims",
".wcs"
],
"Description": "Shows all of your currently claimed waifus.",
"Usage": [
".waifuclaims"
],
"Submodule": "WaifuClaimCommands",
"Module": "Gambling",
"Options": null,
"Requirements": []
},
{
"Aliases": [
".waifuclaim",
".claim"
".claim - wc"
],
"Description": "Claim a waifu for yourself by spending currency. You must spend at least 10% more than her current value unless she set `.affinity` towards you.",
"Usage": [