Exemple #1
0
        public async Task Start()
        {
            Looter.Init();

            string token = Config.Current.Token;

            client = new DiscordSocketClient();

            await client.SetGameAsync("mit deiner Mudda");

            commands = new CommandService();

            fallback = new ModuleFallback(ReactionLibrary.GetReactions());

            services = new ServiceCollection()
                       .AddSingleton(client)
                       .AddSingleton(commands)
                       .AddSingleton(fallback)
                       .BuildServiceProvider();

            await InstallCommands();

            client.Log += Log;

            await client.LoginAsync(TokenType.Bot, token);

            await client.StartAsync();

            await Task.Delay(-1);
        }
Exemple #2
0
    public Library(string jsonData)
    {
        _instance = this;

        var dataProxy = JsonConvert.DeserializeObject <LibraryDataProxy>(jsonData);

        _reagents  = new ReagentLibrary(dataProxy.Reagents);
        _reactions = new ReactionLibrary(dataProxy.Reactions);
    }