示例#1
0
        private async Task MainAsync(string[] args)
        {
            Utils.InitFemaleSpriteLookup();
            ReplaySaver.RemoveOldReplays();
            PBEUtils.InitEngine(string.Empty);

            _client = new DiscordSocketClient();

            _commands = new CommandService(new CommandServiceConfig {
                DefaultRunMode = RunMode.Async
            });
            await _commands.AddModulesAsync(Assembly.GetEntryAssembly(), null);

            _client.Log                += LogMessage;
            _client.MessageReceived    += CommandMessageReceived;
            _client.ReactionAdded      += OnReactionAdded;
            _client.ChannelDestroyed   += OnChannelDeleted;
            _client.LeftGuild          += OnLeftGuild;
            _client.UserLeft           += OnUserLeft;
            _client.Connected          += OnConnected;
            _client.Disconnected       += OnDisconnected;
            _client.GuildMemberUpdated += OnGuildMemberUpdated;

            await _client.LoginAsync(TokenType.Bot, args[0]); // Token is passed in as args[0]

            await _client.StartAsync();

            await Task.Delay(-1);
        }
示例#2
0
 public static void Main(string[] args)
 {
     if (args.Length != 3)
     {
         PrintUsage();
     }
     else
     {
         PBEUtils.InitEngine(string.Empty);
         new BattleServer(args);
     }
 }
示例#3
0
 public static void SetWorkingDirectory(string workingDirectory)
 {
     PBEUtils.InitEngine(workingDirectory);
     WorkingDirectory = workingDirectory;
 }
 public TestUtils()
 {
     PBEUtils.InitEngine(string.Empty);
 }
示例#5
0
 private static void Main()
 {
     PBEUtils.InitEngine(string.Empty);
     BuildAvaloniaApp().StartWithClassicDesktopLifetime(null);
 }