Example Plugin

This commit is contained in:
Mira 2025-01-27 17:26:51 +01:00
commit 03899f8e5b
Signed by untrusted user who does not match committer: Xorog
GPG key ID: 983798ED9C3E7C36
23 changed files with 1128 additions and 0 deletions

View 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)));
});
}
}