Пример #1
0
        public async Task SenderAction(Friend friend, NonMessageAction action)
        {
            string senderAction = "";

            switch (action)
            {
            case NonMessageAction.MarkSeen: senderAction = "mark_seen"; break;

            case NonMessageAction.TypingOff:
                senderAction = "typing_off";
                friend.Speaking.EndTypingToHome();
                break;

            case NonMessageAction.TypingOn:
                senderAction = "typing_on";
                friend.Speaking.BeginTypingToHome();
                break;
            }
            if (friend.IsFacebook)
            {
                var contents = new
                {
                    Recipient = new
                    {
                        Id = friend.Memory.Persistent.FacebookId
                    },
                    Sender_action = senderAction
                };
                await PostJsonMessage(contents);
            }
        }
Пример #2
0
 public async Task SenderAction(Friend friend, NonMessageAction action)
 {
     if (action == NonMessageAction.TypingOn)
     {
         await PostJsonMessage("sendChatAction", new
         {
             ChatId = friend.Memory.Persistent.TelegramId,
             Action = "typing"
         });
     }
 }
Пример #3
0
        public Task SenderAction(Friend friend, NonMessageAction action)
        {
            switch (action)
            {
            case NonMessageAction.TypingOff:
                friend.Speaking.EndTypingToHome();
                break;

            case NonMessageAction.TypingOn:
                friend.Speaking.BeginTypingToHome();
                break;
            }
            return(Task.FromResult(0));
        }
Пример #4
0
 public async Task SenderAction(Friend friend, NonMessageAction action)
 {
     await friend.Endpoints.ForEachAsync(ep => ep.SenderAction(friend, action));
 }