whatsrhyno

package module
v0.0.0-...-6a4b17f Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jun 17, 2022 License: GPL-3.0 Imports: 13 Imported by: 0

README

Whatsrhyno

Go Reference

A simple whatsapp message router for handling incoming message programmaticly. This library are using the great whatsapp web api implementation by tulir on whatsmeow.

Usage

To use whatsrhyno on your project, Use the command below.

go get -u go.ramdanhere.dev/whatsrhyno

You can see the simple example here

Warning

This library is intended for research purposes only and not for continued use. I am completely not responsible for the risks that may occur in the use of this library.

As described on whatsapp faq, that's any automated or bulk messaging on whatsapp was unauthorized and break the whatsapp Terms Of Service

Documentation

Overview

Package whatsrhyno is a package that can simplify usage of whatsmeow https://go.mau.fi/whatsmeow.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Client

type Client struct {
	// contains filtered or unexported fields
}

Client is a wrapper for whatsmeow client with some additional features.

func NewClient

func NewClient(dbFile, loglevel string) (*Client, error)

NewClient initializes a new client. dbFile is the file path that will be used to store session and other data. whatsrhyno will use `sqlite3` as the sql dialect. loglevel is the log level of the underlying client. e.g "WARN", "INFO", "DEBUG", "ERROR"

func (*Client) Connect

func (cli *Client) Connect() error

Connect connects the client to whatsapp web websocket.

func (*Client) Disconnect

func (cli *Client) Disconnect()

Disconnect disconnects the client from whatsapp web websocket.

func (*Client) GetCli

func (cli *Client) GetCli() *whatsmeow.Client

GetCli returns the underlying client.

func (*Client) GetCommandPrefix

func (cli *Client) GetCommandPrefix() string

GetCommandPrefix returns the command prefix.

func (*Client) RegisterEventHandler

func (cli *Client) RegisterEventHandler(evtHandler func(evt any))

RegisterEventHandler registers a handler for events.

func (*Client) SetCommandPrefix

func (cli *Client) SetCommandPrefix(prefix string)

SetCommandPrefix sets the command prefix.

Directories

Path Synopsis
Package router includes the router for handling events from whatsapp web api.
Package router includes the router for handling events from whatsapp web api.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL