fix: fixed .iam

fix: fixed .sclr not being respected on many different commands
change: .rps now also has the amount bet
This commit is contained in:
Kwoth
2024-11-27 02:35:58 +00:00
parent 231451f978
commit 62a16f3faf
9 changed files with 39 additions and 24 deletions

View File

@@ -21,7 +21,7 @@ public partial class Administration
{
var guildUser = (IGuildUser)ctx.User;
var group = await _service.GetRoleGroup(ctx.User.Id, role.Id);
var group = await _service.GetRoleGroup(ctx.Guild.Id, role.Id);
IUserMessage msg = null;
try
@@ -90,7 +90,7 @@ public partial class Administration
return;
}
var group = await _service.GetRoleGroup(role.Guild.Id, role.Id);
var group = await _service.GetRoleGroup(ctx.Guild.Id, role.Id);
if (group is null || group.Roles.All(x => x.RoleId != role.Id))
{

View File

@@ -390,7 +390,7 @@ public partial class Gambling : GamblingModule<GamblingService>
[Priority(0)]
public Task CurrencyTransactions([Leftover] IUser usr)
=> InternalCurrencyTransactions(usr.Id, 1);
[Cmd]
[OwnerOnly]
[Priority(-1)]
@@ -872,9 +872,6 @@ public partial class Gambling : GamblingModule<GamblingService>
}
else if (result.Result == RpsResultType.Win)
{
if ((long)result.Won > 0)
embed.AddField(GetText(strs.won), N((long)result.Won));
msg = GetText(strs.rps_win(ctx.User.Mention,
GetRpsPick(pick),
GetRpsPick((InputRpsPick)result.ComputerPick)));
@@ -890,6 +887,13 @@ public partial class Gambling : GamblingModule<GamblingService>
.WithOkColor()
.WithDescription(msg);
if (amount > 0)
{
embed
.AddField(GetText(strs.bet), N(amount), true)
.AddField(GetText(strs.won), $"{N((long)result.Won)}", true);
}
await Response().Embed(embed).SendAsync();
}

View File

@@ -14,7 +14,7 @@ public partial class Utility
}
private string GetCommandString(NadekoCommandCallModel res)
=> $"{_bcs.Data.Prefix}{res.Name} {res.Arguments.Select((x, i) => GetParamString(x, i + 1 == res.Arguments.Count)).Join(" ")}";
=> $"{prefix}{res.Name} {res.Arguments.Select((x, i) => GetParamString(x, i + 1 == res.Arguments.Count)).Join(" ")}";
private static string GetParamString(string val, bool isLast)
=> isLast ? val : "\"" + val + "\"";