group_manage

package
v1.0.0-beta.6 Latest Latest
Warning

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

Go to latest
Published: Sep 16, 2020 License: Apache-2.0 Imports: 4 Imported by: 0

Documentation

Overview

Package group_manage 机器人/群信息和群管理

Index

Examples

Constants

This section is empty.

Variables

This section is empty.

Functions

func ChatCreate

func ChatCreate(ctx *feishu.App, payload []byte) (resp []byte, err error)

创建群

机器人创建群并拉指定用户进群。

**权限说明** :需要启用机器人能力

See: https://open.feishu.cn/document/ukTMukTMukTM/ukDO5QjL5gTO04SO4kDN

POST https://open.feishu.cn/open-apis/chat/v4/create/

Example
package main

import (
	"fmt"

	"github.com/ylck/feishu"
	"github.com/ylck/feishu/apis/bot/group_manage"
)

func main() {
	var ctx *feishu.App

	payload := []byte("{}")
	resp, err := group_manage.ChatCreate(ctx, payload)

	fmt.Println(resp, err)
}
Output:

func ChatInfo

func ChatInfo(ctx *feishu.App, params url.Values) (resp []byte, err error)

获取群信息

获取群名称、群主 ID、成员列表 ID 等群基本信息。

**权限说明** :需要启用机器人能力;机器人必须在群里

See: https://open.feishu.cn/document/ukTMukTMukTM/uMTO5QjLzkTO04yM5kDN

GET https://open.feishu.cn/open-apis/chat/v4/info?chat_id=oc_eb9e82d5657777ebf1bb5b9024f549ef

Example
package main

import (
	"fmt"
	"net/url"

	"github.com/ylck/feishu"
	"github.com/ylck/feishu/apis/bot/group_manage"
)

func main() {
	var ctx *feishu.App

	params := url.Values{}
	resp, err := group_manage.ChatInfo(ctx, params)

	fmt.Println(resp, err)
}
Output:

func ChatList

func ChatList(ctx *feishu.App, params url.Values) (resp []byte, err error)

获取群列表

获取机器人所在的群列表。

**权限说明** :需要启用机器人能力

See: https://open.feishu.cn/document/ukTMukTMukTM/uITO5QjLykTO04iM5kDN

GET https://open.feishu.cn/open-apis/chat/v4/list

Example
package main

import (
	"fmt"
	"net/url"

	"github.com/ylck/feishu"
	"github.com/ylck/feishu/apis/bot/group_manage"
)

func main() {
	var ctx *feishu.App

	params := url.Values{}
	resp, err := group_manage.ChatList(ctx, params)

	fmt.Println(resp, err)
}
Output:

func ChatUpdate

func ChatUpdate(ctx *feishu.App, payload []byte) (resp []byte, err error)

更新群信息

更新群名称、群配置、转让群主等。

**权限说明** :需要启用机器人能力;机器人必须是群主,才能执行修改群配置和转让群主的操作(机器人创建的群,机器人默认是群主。)

See: https://open.feishu.cn/document/ukTMukTMukTM/uYTO5QjL2kTO04iN5kDN

POST https://open.feishu.cn/open-apis/chat/v4/update/

Example
package main

import (
	"fmt"

	"github.com/ylck/feishu"
	"github.com/ylck/feishu/apis/bot/group_manage"
)

func main() {
	var ctx *feishu.App

	payload := []byte("{}")
	resp, err := group_manage.ChatUpdate(ctx, payload)

	fmt.Println(resp, err)
}
Output:

func ChatterAdd

func ChatterAdd(ctx *feishu.App, payload []byte) (resp []byte, err error)

拉用户进群

机器人拉用户进群,机器人必须在群里。

**权限说明** :需要启用机器人能力;机器人必须在群里

See: https://open.feishu.cn/document/ukTMukTMukTM/ucTO5QjL3kTO04yN5kDN

POST https://open.feishu.cn/open-apis/chat/v4/chatter/add/

Example
package main

import (
	"fmt"

	"github.com/ylck/feishu"
	"github.com/ylck/feishu/apis/bot/group_manage"
)

func main() {
	var ctx *feishu.App

	payload := []byte("{}")
	resp, err := group_manage.ChatterAdd(ctx, payload)

	fmt.Println(resp, err)
}
Output:

func ChatterDelete

func ChatterDelete(ctx *feishu.App, payload []byte) (resp []byte, err error)

移除用户出群

机器人移除用户出群。

**权限说明** :需要启用机器人能力;机器人必须是群主(机器人创建的群,机器人默认是群主。)

See: https://open.feishu.cn/document/ukTMukTMukTM/uADMwUjLwADM14CMwATN

POST https://open.feishu.cn/open-apis/chat/v4/chatter/delete/

Example
package main

import (
	"fmt"

	"github.com/ylck/feishu"
	"github.com/ylck/feishu/apis/bot/group_manage"
)

func main() {
	var ctx *feishu.App

	payload := []byte("{}")
	resp, err := group_manage.ChatterDelete(ctx, payload)

	fmt.Println(resp, err)
}
Output:

func Disband

func Disband(ctx *feishu.App, payload []byte) (resp []byte, err error)

解散群

机器人解散群。

**权限说明** :需要启用机器人能力;机器人必须是群主(机器人创建的群,机器人默认是群主。)

See: https://open.feishu.cn/document/ukTMukTMukTM/uUDN5QjL1QTO04SN0kDN

POST https://open.feishu.cn/open-apis/chat/v4/disband

Example
package main

import (
	"fmt"

	"github.com/ylck/feishu"
	"github.com/ylck/feishu/apis/bot/group_manage"
)

func main() {
	var ctx *feishu.App

	payload := []byte("{}")
	resp, err := group_manage.Disband(ctx, payload)

	fmt.Println(resp, err)
}
Output:

Types

This section is empty.

Jump to

Keyboard shortcuts

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