A demo bot that can lead you to create your
own bot with Konata.Core quickly.
Command | Description |
---|---|
/status | Print the status such as build, version, memory usage..etc |
/dbg <code> | Enable the debug output of your REPL expression |
any user-defined command start with '/' | / |
Trigger | Example | Description |
---|---|---|
Github | https://github.com/KonataDev/Kagami | Parse the GitHub repo image. |
Kagami offers a modern C# (Currently C# 11) interactive terminal,
type any valid C# expressions in the group then run the code.
Benefited from the REPL feature, Kagami supports user-defined commands.
You can define your command like the example below:
// define a command named 'example'
// it has 3 argument inputs a, b and c.
var example = string (int a, bool b, string c)
=> $"a is {a}, b is {b}, c is \"{c}\"";
After defined the command, you can send '/example 1 false Hello' in your group,
then Kagami will prints a "a is 1, b is False, c is Hello" string.
The script presets are stored in 'scripts' directory,
write down your code and save with '.cs' suffix name here and restart Kagami to take effect.
The normal output while Kagami starting:
[ *** ] REPL compiling script => scripts/ic.cs
[ *** ] REPL compiling script => scripts/help.cs
[ *** ] REPL compiling script => scripts/echo.cs
[ *** ] REPL compiling script => scripts/ping.cs
[ *** ] REPL compiling script => scripts/mute.cs
[ *** ] REPL scripts load finished.
See more examples in ScriptExample.
Sandbox environment are defined in ReplEnvironment.cs,
Contains fields, classes and methods as the script runtime context.
Name | Description |
---|---|
Bot | The Kagami bot instance, full access in REPL |
CurrentGroup | Current group uin |
CurrentMember | Current member uin |
JSON | The dynamic JSON parser, use JSON.Parse() |
Print a string | |
CanIDo | Bot do something with a probability |
Wget | Http request |
Random | Shared random |
- Sometimes offline.
- Sometimes stuck on some internal tasks.
- Stuck while the bot exit.
- Bot can trigger the command which sends by itself. (LMFAO)
Licensed in GNU GPLv3 with ❤.