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:
parent
e40a458dc5
commit
2fe1b94cea
5 changed files with 44 additions and 12 deletions
|
@ -71,7 +71,6 @@ public sealed class SelfService : IExecNoCommand, IReadyExecutor, IEService
|
||||||
if (server.OwnerId != _client.CurrentUser.Id)
|
if (server.OwnerId != _client.CurrentUser.Id)
|
||||||
{
|
{
|
||||||
await server.LeaveAsync();
|
await server.LeaveAsync();
|
||||||
Log.Information("Left server {Name} [{Id}]", server.Name, server.Id);
|
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
|
|
@ -159,14 +159,14 @@ public class XpSvc : GrpcXp.GrpcXpBase, IGrpcSvc, IEService
|
||||||
_xp.SetRoleReward(request.GuildId, request.Level, rid, request.Type == "RemoveRole");
|
_xp.SetRoleReward(request.GuildId, request.Level, rid, request.Type == "RemoveRole");
|
||||||
success = true;
|
success = true;
|
||||||
}
|
}
|
||||||
else if (request.Type == "Currency")
|
// else if (request.Type == "Currency")
|
||||||
{
|
// {
|
||||||
if (!int.TryParse(request.Value, out var amount))
|
// if (!int.TryParse(request.Value, out var amount))
|
||||||
throw new RpcException(new Status(StatusCode.InvalidArgument, "Invalid amount"));
|
// throw new RpcException(new Status(StatusCode.InvalidArgument, "Invalid amount"));
|
||||||
|
//
|
||||||
_xp.SetCurrencyReward(request.GuildId, request.Level, amount);
|
// _xp.SetCurrencyReward(request.GuildId, request.Level, amount);
|
||||||
success = true;
|
// success = true;
|
||||||
}
|
// }
|
||||||
|
|
||||||
return new()
|
return new()
|
||||||
{
|
{
|
||||||
|
|
|
@ -12,7 +12,11 @@ public sealed partial class ReplacementPatternStore
|
||||||
{
|
{
|
||||||
Register("%bot.time%",
|
Register("%bot.time%",
|
||||||
static ()
|
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()
|
private void WithClient()
|
||||||
|
|
|
@ -165,7 +165,7 @@ public class CommandHandler : IEService, IReadyExecutor, ICommandHandler
|
||||||
Log.Information("Succ | g:{GuildId} | c: {ChannelId} | u: {UserId} | msg: {Message}",
|
Log.Information("Succ | g:{GuildId} | c: {ChannelId} | u: {UserId} | msg: {Message}",
|
||||||
channel?.Guild.Id.ToString() ?? "-",
|
channel?.Guild.Id.ToString() ?? "-",
|
||||||
channel?.Id.ToString() ?? "-",
|
channel?.Id.ToString() ?? "-",
|
||||||
usrMsg.Author.Id,
|
usrMsg.Author.Id.ToString(),
|
||||||
usrMsg.Content.TrimTo(10));
|
usrMsg.Content.TrimTo(10));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -3030,6 +3030,20 @@
|
||||||
"Bot Owner Only"
|
"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": [
|
"Aliases": [
|
||||||
".race"
|
".race"
|
||||||
|
@ -3601,10 +3615,25 @@
|
||||||
"Options": null,
|
"Options": null,
|
||||||
"Requirements": []
|
"Requirements": []
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
"Aliases": [
|
||||||
|
".waifuclaims",
|
||||||
|
".claims",
|
||||||
|
".wcs"
|
||||||
|
],
|
||||||
|
"Description": "Shows all of your currently claimed waifus.",
|
||||||
|
"Usage": [
|
||||||
|
".waifuclaims"
|
||||||
|
],
|
||||||
|
"Submodule": "WaifuClaimCommands",
|
||||||
|
"Module": "Gambling",
|
||||||
|
"Options": null,
|
||||||
|
"Requirements": []
|
||||||
|
},
|
||||||
{
|
{
|
||||||
"Aliases": [
|
"Aliases": [
|
||||||
".waifuclaim",
|
".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.",
|
"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": [
|
"Usage": [
|
||||||
|
|
Loading…
Reference in a new issue