Skip to content

uopeydel/messenger-client

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

10 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Facebook Messenger .NET Client

A .NET Core client for Facebook Messenger platform.

Installation

Install-Package Messenger.Client

To use ASP.NET Core extensions use Messenger.Client.Extensions package.

Install-Package Messenger.Client.Extensions

Documentation

Configuration

To register the client add the following line in your Startup.cs file

public class Startup {
	public void ConfigureServices(IServiceCollection services)
    {
    	...
        services.AddMessengerClient("%ACCESS_TOKEN%");
    }
}

IMessengerMessageSender

IMessengerMessageSender allows you to send a message to specific Messenger user.

[Route("api/webhook")]
public class FacebookController() {
	private readonly IMessengerMessageSender messageSender;
  
    public FacebookController(IMessengerMessageSender messageSender) {
      this.messageSender = messageSender;
    }

    ...

    private Task SendMessage(String text, MessengerUser recipient)
    {
      var reply = new MessengerMessage {Text = text};
      return messageSender.SendAsync(reply, recipient);
    }
    ...
}

About

Facebook Messenger .NET Client

Resources

Stars

Watchers

Forks

Packages

No packages published

Languages

  • C# 77.0%
  • HTML 23.0%