Beispiel #1
0
        public PushMessage CreatePush(string text = null, TextMessage message = null)
        {
            PushMessage pushMessage = new PushMessage();

            pushMessage.To = this.Source.UserId ?? this.Source.GroupId ?? this.Source.RoomId;



            if (pushMessage.To == null || pushMessage.To == "")
            {
                pushMessage.To = "Ufcb9c1f6964aa42b06ef54e5ecde2cb8";
            }

            //if(message.Text.StartsWith())
            //message.Text = "I am a bot, You have been sent to me a message: \"" + message.Text + "\"";

            if (!string.IsNullOrEmpty(text))
            {
                pushMessage.Messages.Add(new TextMessage(text));
            }
            if (message != null)
            {
                pushMessage.Messages.Add(message);
            }
            return(pushMessage);
        }
Beispiel #2
0
        public PushMessage CreatePush(string text = null, List <Message> messages = null)
        {
            PushMessage pushMessage = new PushMessage();

            pushMessage.To = this.Source.UserId ?? this.Source.GroupId ?? this.Source.RoomId;

            if (!string.IsNullOrEmpty(text))
            {
                pushMessage.Messages.Add(new TextMessage(text));
            }
            if (messages != null)
            {
                pushMessage.Messages.AddRange(messages);
            }
            return(pushMessage);
        }