Пример #1
0
        public ChatWindow(ChatEventsManager chatEventsManager, SteamChatHandler chatHandler, SteamUserHandler steamUserHandler)
        {
            chatEventsManager.ChatMessageReceived += OnChatMessage;
            SteamUserHandler = steamUserHandler;
            ChatHandler      = chatHandler;

            Loaded += ChatWindow_Loaded;
            InitializeComponent();
        }
        public FriendsListWindow(Account account, string apiKey)
        {
            _account = account;

            #region activate apis
            ChatHandler      = new SteamChatHandler(_account);
            SteamUserHandler = new SteamUserHandler(apiKey);
            #endregion

            InitializeComponent();
        }
        public ChatControl(ChatWindow window, TabItem containingTab, SteamChatHandler chatHandler, ChatUser friend)
        {
            ContainingTab = containingTab;
            Friend        = friend;
            ChatterId     = friend.Summary.SteamId;

            _window      = window;
            _chatHandler = chatHandler;

            Loaded += ChatControl_Loaded;

            InitializeComponent();
        }
Пример #4
0
        private static void Main()
        {
            Console.Title = "Chat Bot by sne4kyFox";
            Console.WriteLine("Welcome to the chat bot!");
            Console.WriteLine(
                "By using this software you agree to the terms in \"license.txt\".");

            LoadConfig();
            Login();

            SteamUserHandler = new SteamUserHandler(_config.ApiKey);

            //handles sending messages and such
            ChatHandler = new SteamChatHandler(_account);
            //allows you to use a built-in message loop without constructing your own. Non-blocking
            ChatEventsManager = new ChatEventsManager(ChatHandler);
            //non-blocking callback like in SteamKit2
            ChatEventsManager.ChatMessageReceived += OnChatMessage;
        }