mirror of
https://gitlab.com/Kwoth/nadekobot.git
synced 2025-09-12 10:18:27 -04:00
- Added a simple bank system. Users can deposit, withdraw and check the balance of their currency in the bank.
- Users can't check other user's bank balances. - Added a button on a .$ command which, when clicked, sends you a message with your bank balance that only you can see. - Updated pagination, it now uses buttons instead of reactions - using .h <command group> (atm only .bank is a proper group) will list commands with their descriptions in that group
This commit is contained in:
@@ -266,6 +266,20 @@ public partial class Help : NadekoModule<HelpService>
|
||||
await ctx.Channel.EmbedAsync(embed);
|
||||
}
|
||||
|
||||
private async Task Group(ModuleInfo group)
|
||||
{
|
||||
var eb = _eb.Create(ctx)
|
||||
.WithTitle(GetText(strs.cmd_group_commands(group.Name)))
|
||||
.WithOkColor();
|
||||
|
||||
foreach (var cmd in group.Commands)
|
||||
{
|
||||
eb.AddField(prefix + cmd.Aliases.First(), cmd.RealSummary(_strings, _medusae, Culture, prefix));
|
||||
}
|
||||
|
||||
await ctx.Channel.EmbedAsync(eb);
|
||||
}
|
||||
|
||||
[Cmd]
|
||||
[Priority(0)]
|
||||
public async partial Task H([Leftover] string fail)
|
||||
@@ -278,6 +292,20 @@ public partial class Help : NadekoModule<HelpService>
|
||||
return;
|
||||
}
|
||||
|
||||
if (fail.StartsWith(prefix))
|
||||
fail = fail.Substring(prefix.Length);
|
||||
|
||||
var group = _cmds.Modules
|
||||
.SelectMany(x => x.Submodules)
|
||||
.Where(x => !string.IsNullOrWhiteSpace(x.Group))
|
||||
.FirstOrDefault(x => x.Group.Equals(fail, StringComparison.InvariantCultureIgnoreCase));
|
||||
|
||||
if (group is not null)
|
||||
{
|
||||
await Group(group);
|
||||
return;
|
||||
}
|
||||
|
||||
await ReplyErrorLocalizedAsync(strs.command_not_found);
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user