Skip to content

3版本怎么对群操作 #77

Answered by ForteScarlet
yujumpjump asked this question in Q&A
Discussion options

You must be logged in to vote

直接使用 Group 对象。参考 Group

举个例子,在一个群消息事件中:

@Listener
public void onEvent(GroupMessageEvent event) {
   Group group = event.getGroup();
   group.send(...); // 发送消息
   group.mute(...); // 全群禁言(需要注意组件实现差异和注意事项)

   GroupMember member = group.getMember(...); // 获取成员
   // 成员操作同理
}

Replies: 1 comment 2 replies

Comment options

You must be logged in to vote
2 replies
@yujumpjump
Comment options

@ForteScarlet
Comment options

Answer selected by yujumpjump
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
组件:mirai 与mirai组件有关的内容
2 participants