修改日程

修改日程子频道里的一个日程。

::: warning 注意

要求操作人具有管理频道的权限,如果是机器人,则需要将机器人设置为管理员。

:::

使用示例

  1. token := token.BotToken("appid", "token")
  2. api := botgo.NewOpenAPI(token).WithTimeout(3 * time.Second)
  3. ctx := context.Background()
  4. schedule, err := api.ModifySchedule(ctx, channelId, scheduleId, &dto.Schedule{
  5. StartTimestamp: "开始时间戳",
  6. EndTimestamp: "结束时间戳",
  7. RemindType: "1",
  8. })
  9. if err != nil {
  10. log.Fatalln("调用 ModifySchedule 接口失败, err = ", err)
  11. }

参数说明

字段名 必填 类型 描述
channelId string 子频道 ID
scheduleId string 日程 ID
Schedule Schedule 日程对象

Schedule

字段名 必填 类型 描述
ID 不填 string 日程 ID
Name string 日程名称
Description string 日程描述
StartTimestamp string 日程开始时间戳(ms) ,日程开始时间必须大于传当前时间
EndTimestamp string 日程结束时间戳(ms) ,日程结束时间必须大于日程开始时间
Creator Member 创建者
JumpChannelID string 日程开始时跳转到的子频道 ID
RemindType string 日程提醒类型,取值参考RemindType

返回说明

返回 Schedule 对象。

Member

字段名 类型 描述
User User 用户的频道基础信息,只有成员相关接口中会填充此信息
Nick string 用户在频道内的昵称
JoinedAt Timestamp 用户加入频道的时间,是个 ISO8601 timestamp 字符串,例:”2021-11-23T15:16:48+08:00”

User

字段名 类型 描述
ID string 用户 ID
Username string 用户名
Bot boolean 是否是机器人

RemindType

提醒类型 id 描述
0 不提醒
1 开始时提醒
2 开始前 5 分钟提醒
3 开始前 15 分钟提醒
4 开始前 30 分钟提醒
5 开始前 60 分钟提醒

返回示例

data

  1. {
  2. "id": "xxxxxx",
  3. "name": "xxxxxx",
  4. "description": "xxxxxx",
  5. "start_timestamp": "1641913200000",
  6. "end_timestamp": "1641916800000",
  7. "creator": {
  8. "user": {
  9. "id": "xxxxxx",
  10. "username": "xxxxxx",
  11. "bot": false
  12. },
  13. "nick": "",
  14. "joined_at": "2021-11-24T16:51:35+08:00"
  15. },
  16. "jump_channel_id": "0",
  17. "remind_type": "2"
  18. }