Socket
Socket
Sign inDemoInstall

github.com/stevenxie/fbmsgr

Package Overview
Dependencies
4
Alerts
File Explorer

Install Socket

Detect and block malicious and high-risk dependencies

Install

    github.com/stevenxie/fbmsgr

Package fbmsgr provides an API for interacting with Facebook Messenger. The first step is to create a new Messenger session. Do this as follows, replacing "USER" and "PASS" with your Facebook login credentials: Once you are done with a session you have allocated, you should call Close() on it to clear any resources (e.g. goroutines) that it is using. When sending a message, you specify a receiver by their FBID. The receiver may be another user, or it may be a group. For most methods related to message sending, there is one version of the method for a user and one for a group: To send or retract a typing notification, you might do: To send an attachment such as an image or a video, you can do the following: It is easy to receive events such as incoming messages using the ReadEvent method: With the EventStream API, you can get more fine-grained control over how you receive events. For example, you can read the next minute's worth of events like so: You can also create multiple EventStreams and read from different streams in different places. To list the threads (conversations) a user is in, you can use the Threads method to fetch a subset of threads at a time. You can also use the AllThreads method to fetch all the threads at once.


Version published

Readme

Source

fbmsgr

Reverse engineering Facebook Messenger.

GoDoc: reference Tags

This is a fork of unixpickle/fbmsgr which contains a modified Session struct with an exposed http.Client, so that its cookies may be read by other packages.

Original README:

This is a wrapper around Facebook Messenger's internal AJAX protocol. This wrapper could be used for any number of cool things, such as:

  • Tracking your friends' Messenger activity.
  • Analyzing your conversations (e.g. keywords analysis)
  • Automating "Away" messages
  • Creating chat bots

Current status

Currently, the API is fairly reliable and can perform a bunch of basic functionalities. Here is a list of supported features (it may lag slightly behind the master branch):

  • Send textual messages to people or groups
  • Send attachments to people or groups
  • Receive messages with or without attachments
  • Send read receipts
  • Receive events for incoming messages
  • Receive events for friend "Last Active" updates
  • Set chat text colors (to arbitrary RGB colors)
  • List a user's threads.
  • List messages in a thread.
  • Send and receive typing events
  • Delete messages

TODOs

  • Support emojis in threads (i.e. the like button)
  • In FullActionLog, remove all duplicates, incase two messages have the same timestamp.
  • Emoji/sticker transmission
  • Modifying chat preferences (emoji, nicknames, etc.)
  • View pending message requests
  • Create new group chats

License

This is under a BSD 2-clause license. See LICENSE.

FAQs

Last updated on 12 Dec 2018

Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc