9e47f98a23
* Added configurable command prefix * Added getting started, renamed files * Add nav order, add assests, add system example * Added a lot * Update Emojis * Add guide links to bot * Added Images
42 lines
1.3 KiB
C#
42 lines
1.3 KiB
C#
using System;
|
|
using System.Linq;
|
|
using System.Threading.Tasks;
|
|
using Discord;
|
|
using Humanizer;
|
|
using NodaTime;
|
|
using NodaTime.Text;
|
|
using NodaTime.TimeZones;
|
|
|
|
using PluralKit.Bot.CommandSystem;
|
|
using PluralKit.Core;
|
|
|
|
namespace PluralKit.Bot.Commands
|
|
{
|
|
public class System
|
|
{
|
|
private IDataStore _data;
|
|
private EmbedService _embeds;
|
|
|
|
public System(EmbedService embeds, IDataStore data)
|
|
{
|
|
_embeds = embeds;
|
|
_data = data;
|
|
}
|
|
|
|
public async Task Query(Context ctx, PKSystem system) {
|
|
if (system == null) throw Errors.NoSystemError;
|
|
|
|
await ctx.Reply(embed: await _embeds.CreateSystemEmbed(system, ctx.LookupContextFor(system)));
|
|
}
|
|
|
|
public async Task New(Context ctx)
|
|
{
|
|
ctx.CheckNoSystem();
|
|
|
|
var system = await _data.CreateSystem(ctx.RemainderOrNull());
|
|
await _data.AddAccount(system, ctx.Author.Id);
|
|
await ctx.Reply($"{Emojis.Success} Your system has been created. Type `pk;system` to view it, and type `pk;help` for more information about commands you can use now. Now that you have that set up, check out [the getting started guide on setting up members and proxies](https://pluralkit.me/start)!");
|
|
}
|
|
}
|
|
}
|