sides

package
v0.0.0-...-aafb61e Latest Latest
Warning

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

Go to latest
Published: Jan 22, 2024 License: AGPL-3.0 Imports: 1 Imported by: 0

Documentation

Overview

irc-discord-bridgebot - a puppeteer bridge to connect IRC and Discord * Copyright (C) 2021 Arsen Arsenović <arsen@aarsen.me> * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU Affero General Public License as published by * the Free Software Foundation, either version 3 of the License. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU Affero General Public License for more details. * * You should have received a copy of the GNU Affero General Public License * along with this program. If not, see <https://www.gnu.org/licenses/>.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Entity

type Entity struct {
	// stable ID, if possible
	ID string
	// entity nickname
	Nick string
	// entity username (optional)
	Username string
	// permitted mentions
	PermittedMentions []string
}

type EntityPriorityQueue

type EntityPriorityQueue []*PrioritizedEntity

func (EntityPriorityQueue) Len

func (pq EntityPriorityQueue) Len() int

func (EntityPriorityQueue) Less

func (pq EntityPriorityQueue) Less(i, j int) bool

func (*EntityPriorityQueue) Pop

func (pq *EntityPriorityQueue) Pop() interface{}

func (*EntityPriorityQueue) Push

func (pq *EntityPriorityQueue) Push(entity interface{})

func (EntityPriorityQueue) Swap

func (pq EntityPriorityQueue) Swap(i, j int)

type PrioritizedEntity

type PrioritizedEntity struct {
	Entity *Entity

	Priority int
}

type Receiver

type Receiver interface {
	// this might be called even for existing entities to update them,
	// which is only relevant on the Discord side (since it needs to update
	// a nick on the IRC side) so far. I might need to add some VIDs to the
	// IRC side if I intend to xpost nick update events and such, which
	// would be used in conjuction with AddEntity
	// channel optional, if it doesn't make sense to scope
	JoinEvent(entity Entity, channel string)
	LeaveEvent(entity Entity, channel string)
	ChangeEvent(entity Entity)

	MessageEvent(entity Entity, channel string, text string)
	Ready(*EntityPriorityQueue)
}

type Side

type Side interface {
	// channel is specific to this side, translation is to be done outside
	// sides
	SendMessage(sender Entity, channel string, text string)
	AddEntity(Entity, string)
	RemoveEntity(Entity, string)
	ChangeEntity(Entity)
}

Directories

Path Synopsis
irc-discord-bridgebot - a puppeteer bridge to connect IRC and Discord * Copyright (C) 2021 Arsen Arsenović <arsen@aarsen.me> * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU Affero General Public License as published by * the Free Software Foundation, either version 3 of the License.
irc-discord-bridgebot - a puppeteer bridge to connect IRC and Discord * Copyright (C) 2021 Arsen Arsenović <arsen@aarsen.me> * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU Affero General Public License as published by * the Free Software Foundation, either version 3 of the License.
irc-discord-bridgebot - a puppeteer bridge to connect IRC and Discord * Copyright (C) 2021 Arsen Arsenović <arsen@aarsen.me> * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU Affero General Public License as published by * the Free Software Foundation, either version 3 of the License.
irc-discord-bridgebot - a puppeteer bridge to connect IRC and Discord * Copyright (C) 2021 Arsen Arsenović <arsen@aarsen.me> * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU Affero General Public License as published by * the Free Software Foundation, either version 3 of the License.

Jump to

Keyboard shortcuts

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