-
Notifications
You must be signed in to change notification settings - Fork 12
/
main.go
46 lines (36 loc) · 1.04 KB
/
main.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
package main
import (
_ "embed"
"github.com/duo/matrix-wechat/internal"
"github.com/duo/matrix-wechat/internal/config"
"go.mau.fi/util/configupgrade"
"maunium.net/go/mautrix/bridge"
)
// Information to find out exactly which commit the bridge was built from.
// These are filled at build time with the -X linker flag.
var (
Tag = "unknown"
Commit = "unknown"
BuildTime = "unknown"
)
//go:embed example-config.yaml
var exampleConfig string
func main() {
br := internal.NewWechatBridge(exampleConfig)
br.Bridge = bridge.Bridge{
Name: "matrix-wechat",
URL: "https://github.com/duo/matrix-wechat",
Description: "A Matrix-WeChat puppeting bridge.",
Version: "0.2.4",
ProtocolName: "Wechat",
CryptoPickleKey: "github.com/duo/matrix-wechat",
ConfigUpgrader: &configupgrade.StructUpgrader{
SimpleUpgrader: configupgrade.SimpleUpgrader(config.DoUpgrade),
Blocks: config.SpacedBlocks,
Base: exampleConfig,
},
Child: br,
}
br.InitVersion(Tag, Commit, BuildTime)
br.Main()
}