gohubsbot

package module
v0.0.0-...-90e52da Latest Latest
Warning

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

Go to latest
Published: Feb 16, 2021 License: GPL-3.0 Imports: 12 Imported by: 0

README

GoHubsBot

package to create bots for mozilla hubs rooms and bridge mozilla hubs chat to matrix and viceversa

open to git merge requests

  • Changed all the bot to use websockets instead of chromedp, so no resources problems anymore
  • listen() to listen for chat and do something with the text
  • Add e2ee to matrix client
  • bridged mozilla hubs to matrix:
    • chat
    • Joins
    • leaves
    • hash presence_state joins and leaves to match id with nick
    • use presence joins leaves hash to sent nick of chat msg to matrix
    • add and remove presence from hash to keep hash updated
  • Rename bot name mozilla hubs side
  • Bridge matrix to Mozilla hubs
  • Add non-bridge related bot things like
    • RSSfeeds
    • News
    • MOTD

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GoHubsBot

func GoHubsBot(site, origin, goHubsName string) *websocket.Conn

func Heartbeat

func Heartbeat(ws *websocket.Conn)

func Matrix

func Matrix(url, user, password string, channel id.RoomID) *mautrix.Client

func MatrixSay

func MatrixSay(client *mautrix.Client, message string, channel id.RoomID)

func WebsocketsListen

func WebsocketsListen(ws *websocket.Conn, matrixClient *mautrix.Client, matrixChannel id.RoomID, goHubsName string)

Types

type Message

type Message struct {
	SessionID string `json:"session_id"`
	Body      string // we get the msg body
	Type      string
}

type Meta

type Meta struct {
	Context     struct{}
	Permissions struct{}
	PhxRef      []byte `json:"phx_ref"`
	PhxRefPrev  []byte `json:"phx_ref_prev"`
	Presence    string `json:"presence"`
	Profile     Profile
	Roles       struct{}
}

type Presence

type Presence struct {
	Metas []*Meta
}

type PresenceDiff

type PresenceDiff struct {
	Joins  map[string]*Presence // map to grab dynamic value
	Leaves map[string]*Presence // map to grab dynamic value
}

type PresenceState

type PresenceState map[string]Presence

type Profile

type Profile struct {
	AvatarID    string
	DisplayName string
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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