Example #1
0
        /// <summary>
        /// Sets the bot's status.
        /// </summary>
        /// <param name="status">The status.</param>
        /// <param name="message">The message.</param>
        public void SetStatus(Status status, string message)
        {
            // Ensure we're logged in
            if (!LoggedIn)
            {
                return;
            }

            switch (status)
            {
            case Status.Available:
                connection.Show = ShowType.NONE;
                break;

            case Status.Away:
                connection.Show = ShowType.away;
                break;

            case Status.Busy:
                connection.Show = ShowType.dnd;
                break;

            default:
                throw new ApplicationException("Unknown status type: " + status);
            }

            connection.Status = message;

            connection.SendMyPresence();
        }
Example #2
0
        /// <summary>
        /// Sets the bot's status.
        /// </summary>
        /// <param name="status">The status.</param>
        /// <param name="message">The message.</param>
        public void SetStatus(Status status, string message)
        {
            // Ensure we're logged in
            if (!LoggedIn) return;         

            switch (status)
            {
                case Status.Available:
                    connection.Show = ShowType.NONE;
                    break;

                case Status.Away:
                    connection.Show = ShowType.away;
                    break;
                    
                case Status.Busy:
                    connection.Show = ShowType.dnd;
                    break;

                default:
                    throw new ApplicationException("Unknown status type: " + status);

            }

            connection.Status = message;

            connection.SendMyPresence();
        }