Options
All
  • Public
  • Public/Protected
  • All
Menu

Module login

Login API

Provides various utilities for managing the login process, including login/logout and import/export of appstate files.

Encapsulates the login by caching the appstate in memory.

Index

Functions

Const convert

  • Converts a (NodeJS) facebook-chat-api appstate into a (Python) fbchat session. See the examples/ directory for how this can be used to create an fbchat bot with BotCore.

    Parameters

    • filename: string

      Name of the file whose location contains the appstate data to be converted

    • callback: ErrDataCallback

      Callback to use after conversion completed, passed the converted session

    Returns void

Const convertToFile

  • A variant of convert that directly outputs the converted session to a file.

    Parameters

    • appstate: string

      Location of appstate to be converted

    • output: string

      Where to place the converted session

    • callback: GenericErrCallback

      Callback called after conversion

    Returns void

Const dumpLogin

  • Dumps the current login into a specified file.

    Parameters

    • filename: string

      Name of the file specifying where to store the login

    • callback: GenericErrCallback

      Callback to use after writing the file

    Returns void

Const getMemCache

  • getMemCache(): Client
  • Exposes the underlying memjs memcache instance, which can be used for temporary storage. Use wisely, or you may break your BotCore installation!

    NOTE: if you call this before logging in with login, it will return nothing; the memcache is not initialized until you log in.

    Returns Client

    The underlying BotCore memjs instance

Const loadLogin

  • Reads a new login into memory from a file.

    Parameters

    • filename: string

      Name of the file specifying where the imported login is stored

    • callback: GenericErrCallback

      Callback to use after reading the login

    Returns void

Const login

  • Call this to initialize the login module and log into Facebook using facebook-chat-api. See examples/ for example usage.

    Parameters

    • credentials: LoginCredentials
    • callback: LoginCallback

      called after login completed (successfully or unsuccessfully)

    • forceCreds: boolean = false
    • options: IOptions = ...

    Returns void

Const logout

Generated using TypeDoc