txim/demo.go
2020-03-24 20:38:26 +08:00

26 lines
457 B
Go

package main
import (
"fmt"
txim "github.com/xucx/txim/api"
)
func main() {
txim.Init(1, "xxx", "xxx")
//生成签名
sig := txim.UserSig("xxx", 300)
fmt.Println("签名:", sig)
//创建房间
ans, err := txim.GroupCreate(&txim.GroupCreateReq{
OwnerAccount: "administrator",
Type: "ChatRoom",
Name: "测试聊天室",
ApplyJoinOption: "FreeAccess",
})
fmt.Printf("创建房间结果:%v,%+v\n", err, ans)
}