mirror of
https://github.com/oliverbooth/VpSharp
synced 2024-11-10 05:55:42 +00:00
34 lines
1.0 KiB
C#
34 lines
1.0 KiB
C#
using VpSharp.Commands;
|
|
using VpSharp.Extensions;
|
|
|
|
namespace VpSharp.CSharp_Sample;
|
|
|
|
internal static class Program
|
|
{
|
|
private static VirtualParadiseClient s_client = null!;
|
|
|
|
private static async Task Main()
|
|
{
|
|
var configuration = new VirtualParadiseConfiguration
|
|
{
|
|
Username = "YOUR_VP_USERNAME",
|
|
Password = "YOUR_VP_PASSWORD",
|
|
BotName = "Greeter",
|
|
Application = new Application("GreeterBot", "1.0")
|
|
};
|
|
|
|
s_client = new VirtualParadiseClient(configuration);
|
|
var commands = s_client.UseCommands(new CommandsExtensionConfiguration {Prefixes = new[] {"/"}});
|
|
commands.RegisterCommands<SayCommand>();
|
|
|
|
s_client.AvatarJoined.SubscribeAsync(async avatar => await s_client.SendMessageAsync($"Hello, {avatar.Name}!"));
|
|
|
|
await s_client.ConnectAsync();
|
|
await s_client.LoginAsync();
|
|
await s_client.EnterAsync("WORLD_NAME");
|
|
await s_client.CurrentAvatar!.TeleportAsync(Vector3d.Zero);
|
|
|
|
await Task.Delay(-1);
|
|
}
|
|
}
|