예제 #1
0
        public CyberMorphy(string channel)
        {
            Console.WriteLine(channel);
            CyberMorphy temp = HELPER.loadSettings(channel);

            this.streamerName = temp.streamerName;
            this.greetings    = temp.greetings;
            this.welcomeBack  = temp.welcomeBack;
            this.greeting     = temp.greeting;
            this.modonly      = temp.modonly;
            this.commands     = HELPER.readCommands(channel);
            this.modcommands  = HELPER.readModCommands(channel);
            this.viewers      = HELPER.readViewer(channel);

            ConnectionCredentials credentials = new ConnectionCredentials(Secret.USERNAME, Secret.PASSWORD);

            client = new TwitchClient();
            client.Initialize(credentials, channel);
            client.OnLog             += Client_OnLog;
            client.OnJoinedChannel   += Client_OnJoinedChannel;
            client.OnMessageReceived += Client_OnMessageReceived;
            client.OnUserJoined      += Client_OnUserJoined;
            client.OnBeingHosted     += Client_OnBeingHosted;
            client.Connect();
        }
예제 #2
0
        public static bool saveAllSettings(String channel, CyberMorphy bot)
        {
            string save     = JsonConvert.SerializeObject(bot);
            String filePath = "settings/" + channel + "/settings.json";

            (new FileInfo(filePath)).Directory.Create();
            using (StreamWriter writer = new StreamWriter(filePath, false))
            {
                writer.WriteLine(save);
            }
            return(true);
        }
예제 #3
0
        static void Main(string[] args)
        {
            CyberMorphy bot = new CyberMorphy("slurpeeninja");

            Console.ReadLine();
        }