Example #1
0
        protected override async Task OnFollowAsync(FollowEvent ev)
        {
            Log.WriteInfo($"SourceType:{ev.Source.Type}, SourceId:{ev.Source.Id}");

            await SourceState.AddAsync(ev.Source.Type.ToString(), ev.Source.Id);

            var userName = "";

            if (!string.IsNullOrEmpty(ev.Source.Id))
            {
                var userProfile = await MessagingClient.GetUserProfileAsync(ev.Source.Id);

                userName = userProfile?.DisplayName ?? "";
            }

            await MessagingClient.ReplyMessageAsync(ev.ReplyToken, $"Hello {userName}! Thank you for following !");
        }