因此,我使机器人与新用户打招呼的代码停止工作了,我也不知道为什么或如何 这是我用于欢迎事件本身的代码```module.exports =(client)=> { const channelId ='757493821251649608'//欢迎频道 const targetChannelId ='757521186929246219'//规则和信息
public static void main(String... args) {
Pattern p = Pattern.compile(":\".?\"");
String str = "[{\"name:\"s2\"},{},{\"name\":\"f2\"},{\"name\":\"f2\"},{},{\"name\":\"l\"}]";
Matcher m = p.matcher(str);
System.out.println(str);
while (m.find()) {
System.out.println("groupe = " + m.group());
}
}
}```
这就是我让机器人执行它的方式
client.on('guildMemberAdd', (member) => {
const message = `Hi, hope you enjoy your stay <@${
member.id
}> , Oh i almost forgot to tell you, check out! ${member.guild.channels.cache
.get(targetChannelId)
.toString()}`
const channel = member.guild.channels.cache.get(channelId)
channel.send(message)
})