Example Plugin
This commit is contained in:
commit
03899f8e5b
23 changed files with 1128 additions and 0 deletions
23
Commands/ExampleCommand.cs
Normal file
23
Commands/ExampleCommand.cs
Normal file
|
|
@ -0,0 +1,23 @@
|
|||
// Project Makoto Example Plugin
|
||||
// Copyright (C) 2023 Fortunevale
|
||||
// This code is licensed under MIT license (see 'LICENSE'-file for details)
|
||||
|
||||
using ProjectMakoto.Entities.Translation;
|
||||
using ProjectMakoto.Plugins.Example;
|
||||
using Translations = ProjectMakoto.Plugins.Example.Entities.Translations;
|
||||
|
||||
namespace ProjectMakoto.Commands;
|
||||
|
||||
internal class ExampleCommand : BaseCommand
|
||||
{
|
||||
public override Task ExecuteCommand(SharedCommandContext ctx, Dictionary<string, object> arguments)
|
||||
{
|
||||
return Task.Run(async () =>
|
||||
{
|
||||
ExamplePlugin.Plugin!.UserData![ctx.User.Id].ExampleValue1 = !ExamplePlugin.Plugin.UserData![ctx.User.Id].ExampleValue1;
|
||||
|
||||
_ = await this.RespondOrEdit(this.GetString(((Translations)ExamplePlugin.Plugin!.Translations).Commands.ValueSet,
|
||||
new TVar("Value", ExamplePlugin.Plugin.UserData![ctx.User.Id].ExampleValue1)));
|
||||
});
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue