This commit is contained in:
parent
0eef4a7547
commit
599540b342
7
.containerignore
Normal file
7
.containerignore
Normal file
@ -0,0 +1,7 @@
|
||||
.git
|
||||
.gitignore
|
||||
Dockerfile*
|
||||
README.md
|
||||
LICENSE
|
||||
*.yaml
|
||||
statefile
|
7
main.go
7
main.go
@ -54,6 +54,7 @@ func main() {
|
||||
var vtubers []*Vtuber
|
||||
log.Println("Logging into", Homeserver, "as", Username)
|
||||
var client *mautrix.Client
|
||||
uid := id.NewUserID(strings.ToLower(Username), strings.ToLower(HomeserverDomain))
|
||||
if Token == "" {
|
||||
client, err = mautrix.NewClient(Homeserver, "", "")
|
||||
if err != nil {
|
||||
@ -61,7 +62,7 @@ func main() {
|
||||
}
|
||||
} else {
|
||||
log.Println("using token login")
|
||||
client, err = mautrix.NewClient(Homeserver, id.NewUserID(Username, HomeserverDomain), Token)
|
||||
client, err = mautrix.NewClient(Homeserver, uid, Token)
|
||||
if err != nil {
|
||||
panic(err)
|
||||
}
|
||||
@ -75,11 +76,13 @@ func main() {
|
||||
},
|
||||
}
|
||||
store := mautrix.NewAccountDataStore("simp.batch", client)
|
||||
_, err = client.CreateFilter(dataFilter)
|
||||
fID, err := client.CreateFilter(dataFilter)
|
||||
store.SaveFilterID(uid, fID.FilterID)
|
||||
if err != nil {
|
||||
panic(err)
|
||||
}
|
||||
client.Store = store
|
||||
|
||||
if Token == "" {
|
||||
login_res, err := client.Login(&mautrix.ReqLogin{
|
||||
Type: "m.login.password",
|
||||
|
Loading…
Reference in New Issue
Block a user