You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
async function addMembersAsFriends(room: Room) {
try {
const members = await room.memberAll()
console.log(Found ${members.length} members in room ${await room.topic()})
for (const member of members) {
if (!member.self()) {
if (!member.friend()) {
try {
console.log(不是好友: ${await member.name()})
await bot.Friendship.add(member, { hello: "您好!" });
console.log(`Friend request sent to ${member.name()}`);
await sleep(2 * 60 * 1000)
} catch (error) {
console.error(`错误 ${await member.name()}:`, error)
}
} else {
console.log(`是好友:${await member.name()}`)
}
} else {
console.log(`Failed to load contact for member ${member.id}`)
}
}
}
catch (error) {
console.error(`Error adding members as friends for room: ${room.id}`, error)
}
}
报错:Error adding members as friends for room: 44507122908@chatroom Error: userName is required
The text was updated successfully, but these errors were encountered:
async function addMembersAsFriends(room: Room) {
try {
const members = await room.memberAll()
console.log(
Found ${members.length} members in room ${await room.topic()}
)for (const member of members) {
if (!member.self()) {
if (!member.friend()) {
try {
console.log(
不是好友: ${await member.name()}
)}
报错:Error adding members as friends for room: 44507122908@chatroom Error: userName is required
The text was updated successfully, but these errors were encountered: