Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[已解决]无法自动通过好友请求 #1755

Closed
jtzgyw opened this issue Apr 22, 2019 · 1 comment
Closed

[已解决]无法自动通过好友请求 #1755

jtzgyw opened this issue Apr 22, 2019 · 1 comment

Comments

@jtzgyw
Copy link

jtzgyw commented Apr 22, 2019

[my code]

async function onFriendship (friendship) {
    try {
        // console.log(friendship.payload);
        // console.log(friendship.contact());
        // console.log(`received friend event.`);
        switch (friendship.type()) {

            // 1. New Friend Request

            case Friendship.Type.Receive:
                await friendship.accept();
                break;

            // 2. Friend Ship Confirmed

            case Friendship.Type.Confirm:
                console.log(`friend ship confirmed`);
                break
        }
    } catch (e) {
        console.error(`error: ${e}`)
    }
}

[error]

ReferenceError: Friendship is not defined
@jtzgyw jtzgyw closed this as completed Apr 23, 2019
@jtzgyw jtzgyw changed the title 无法自动通过好友请求 [已解决]无法自动通过好友请求 Apr 23, 2019
@jtzgyw
Copy link
Author

jtzgyw commented Apr 23, 2019

不好意思,我有仔细看了下,发现没有导入类……。失误失误,我nodejs用的不好

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant