示例#1
0
 public void SetTasks()
 {
     GetChannelId();
     Tasks.SetTasks(ref TwitchClient);
     Events.SetEvents(ref TwitchClient);
     Events.SetFollowerService(AivaClient.Instance.TwitchApi);
 }
示例#2
0
        private void SetupTwitch()
        {
            // TwitchApi
            TwitchApi = new TwitchAPI(Config.Config.Instance.Storage.Credentials.TwitchClientID,
                                      Config.Config.Instance.Storage.Credentials.TwitchOAuth);

            // TwitchClient
            var TwitchCredentials = new TwitchLib.Models.Client.ConnectionCredentials(BotName,
                                                                                      Config.Config.Instance.Storage.Credentials.TwitchOAuth);

            TwitchClient = new TwitchClient(
                credentials: TwitchCredentials,
                channel: null,
                chatCommandIdentifier: Convert.ToChar(Config.Config.Instance.Storage.General.CommandIdentifier),
                whisperCommandIdentifier: '@',
                logging: false,
                logger: null,
                autoReListenOnExceptions: true);

            Tasks.SetTasks(ref TwitchClient);
            Events.SetEvents(ref TwitchClient);

            TwitchClient.OnConnected     += OnConnected;
            TwitchClient.OnJoinedChannel += OnJoinedChannel;

            TwitchClient.Connect();

            GetChannelId();
        }