minetest-go/mtui

Matterbridge service and configuration management

BuckarooBanzay opened this issue · 0 comments

package main

import (
	"fmt"

	"github.com/pelletier/go-toml"
)

func main() {
	t, err := toml.LoadFile("test.toml")
	if err != nil {
		panic(err)
	}

	fmt.Printf("irc.Libera.Server: %s\n", t.Get("irc.Libera.Server"))

	gws := t.Get("gateway").([]*toml.Tree)
	for _, tt := range gws {
		fmt.Printf("Key: %s\n", tt.Get("name"))
	}

}

Simple config:

[irc]
[irc.Libera]
Server="irc.libera.chat:6667"
Nick="pandorabot"
Password="{{irc_password}}"
RemoteNickFormat="[{BRIDGE}] <{NICK}> "
ColorNicks=true
JoinDelay=2000

[discord]
[discord.Discord]
Token="{{discord_token}}"
Server="513329453741637637"
RemoteNickFormat="[{BRIDGE}] <{NICK}> "
UseUserName=false
AllowMention=["users"]

[api.minetest]
BindAddress="0.0.0.0:4242"
Token="{{matterbridge_token}}"
Buffer=1000
RemoteNickFormat="[{BRIDGE}] {NICK}"

[[gateway]]
name="main"
enable=true
[[gateway.inout]]
account="irc.Libera"
channel="#pandorabox"
[[gateway.inout]]
account = "discord.Discord"
channel="main"
[[gateway.inout]]
account="api.minetest"
channel="api"