public override async Task Reply(SocialTipStatusResponse response)
        {
            try
            {
                if (response.Status == TransactionStatus.Ok)
                {
                    EmbedBuilder embedBuilder = new EmbedBuilder();
                    embedBuilder.Title  = "Tip Received";
                    embedBuilder.Color  = Color.DarkBlue;
                    embedBuilder.Footer = new EmbedFooterBuilder {
                        IconUrl = "https://kinny.io/favicon.ico"
                    };

                    embedBuilder.Description =
                        $"Received {SocialTipRequest.Amount} KIN from {Context.User.Username}. You can sign up and view your tip @ https://kinny.io.";
                    Embed embeded = embedBuilder.Build();

                    SocketUser dmUser =
                        Context.Message.MentionedUsers.FirstOrDefault(u => u.Id.ToString().Equals(SocialTipRequest.To));


                    await SendMessage(dmUser, embeded).ConfigureAwait(false);
                }

                if (response.Status != TransactionStatus.Ok)
                {
                    EmbedBuilder embedBuilder = new EmbedBuilder();
                    embedBuilder.Title  = "Tip Failed";
                    embedBuilder.Color  = Color.DarkRed;
                    embedBuilder.Footer = new EmbedFooterBuilder {
                        IconUrl = "https://kinny.io/favicon.ico"
                    };
                    embedBuilder.Description = $"{response.Message}!";

                    await Context.User.SendMessageAsync(null, false, embedBuilder.Build());
                }
                else
                {
                    EmbedBuilder embedBuilder = new EmbedBuilder();
                    embedBuilder.Title  = "Tip Sent";
                    embedBuilder.Color  = Color.DarkGreen;
                    embedBuilder.Footer = new EmbedFooterBuilder {
                        IconUrl = "https://kinny.io/favicon.ico"
                    };

                    embedBuilder.Description =
                        $"{SocialTipRequest.Amount} KIN sent to {SocialTipRequest.OfferParticipantsData.To.Username}!";
                    Embed embeded = embedBuilder.Build();

                    await SendMessage(Context.User, embeded).ConfigureAwait(false);
                }
            }
            catch (Exception e)
            {
                Console.WriteLine(e);
            }
        }
示例#2
0
        public override async Task Reply(SocialTipStatusResponse response)
        {
            try
            {
                ChatId fromChatId = new ChatId(SocialTipRequest.From);
                ChatId toChatId   = new ChatId(SocialTipRequest.To);

                // if (response.Message.Equals("Duplicate transaction"))
                // {
                //    return;
                // }

                if (response.Status != TransactionStatus.Ok)
                {
                    await SendMessage(fromChatId,
                                      $"Hello {SocialTipRequest.OfferParticipantsData.From.Username}," +
                                      $"\n\tTip failed to send to {SocialTipRequest.OfferParticipantsData.To.Username} with error {response.Message}.")
                    .ConfigureAwait(false);
                }
                else
                {
                    await SendMessage(fromChatId,
                                      $"Hello {SocialTipRequest.OfferParticipantsData.From.Username}, you sent {SocialTipRequest.Amount} KIN to {SocialTipRequest.OfferParticipantsData.To.Username}.")
                    .ConfigureAwait(false);
                }

                if (response.Status == TransactionStatus.Ok)
                {
                    await SendMessage(toChatId,
                                      $"Hello {SocialTipRequest.OfferParticipantsData.To.Username}, you received {SocialTipRequest.Amount} KIN from {SocialTipRequest.OfferParticipantsData.From.Username}." +
                                      " You can sign up and view your tip @ https://kinny.io.").ConfigureAwait(false);
                }
            }
            catch (Exception e)
            {
                Console.WriteLine(e);
            }
        }
示例#3
0
        public override async Task Reply(SocialTipStatusResponse response)
        {
            try
            {
                // if (response.Message.Equals("Duplicate transaction"))
                // {
                //     return;
                // }

                if (response.Status != TransactionStatus.Ok)
                {
                    await SendMessage($"Bleep Bloop! Tip failed send on {Comment.Subreddit}!",
                                      $"Hello u/{SocialTipRequest.OfferParticipantsData.From.Username}," +
                                      $"\n\tTip failed to send to u/{SocialTipRequest.OfferParticipantsData.To.Username} with error {response.Message}.",
                                      SocialTipRequest.OfferParticipantsData.From.Username).ConfigureAwait(false);
                }
                else
                {
                    await SendMessage($"Bleep Bloop! Tip sent on {Comment.Subreddit}!",
                                      $"Hello u/{SocialTipRequest.OfferParticipantsData.From.Username}, you sent {SocialTipRequest.Amount} KIN to u/{SocialTipRequest.OfferParticipantsData.To.Username}.",
                                      SocialTipRequest.OfferParticipantsData.From.Username).ConfigureAwait(false);
                }

                if (response.Status == TransactionStatus.Ok)
                {
                    await SendMessage($"Bleep Bloop! Tip recieved on {Comment.Subreddit}!",
                                      $"Hello u/{SocialTipRequest.OfferParticipantsData.To.Username}, you received {SocialTipRequest.Amount} KIN from u/{SocialTipRequest.OfferParticipantsData.From.Username}." +
                                      " You can sign up and view your tip @ https://kinny.io.",
                                      SocialTipRequest.OfferParticipantsData.To.Username).ConfigureAwait(false);
                }
            }
            catch (Exception e)
            {
                Console.WriteLine(e);
            }
        }