discord / gamesdk-and-dispatch

Public issue tracker for the Discord Game SDK and Dispatch
22 stars 7 forks source link

Avatar not being fetch for users without nitro #143

Open NIMFER opened 3 years ago

NIMFER commented 3 years ago

Describe the bug Game SDK fetches avatar for nitro users but not for normal users.

Steps to reproduce Steps to reproduce the behavior:

  1. Make a script that will fetch avatar
  2. As userId insert id of a user without nitro
  3. See error.

Expected behavior Avatar will not be fetched and Discord.Result will return an InternalError.

Implementation specifics

Additional context Code I used:

    void FetchUserInfo()
    {
        userManager = discord.GetUserManager();
        imageManager = discord.GetImageManager();
        userManager.OnCurrentUserUpdate += () => {
            var currentUser = userManager.GetCurrentUser();

            long userID = currentUser.Id;

            Debug.Log("Username = " + currentUser.Username);
            Debug.Log("User ID = " + userID);
            Debug.Log("User Tag = " + currentUser.Discriminator);
            eosManager.SetDisplayName(currentUser.Username);

            imageManager.Fetch(Discord.ImageHandle.User(userID, 128), (result, handle) =>
            {

                if (result == Discord.Result.Ok)
                {

                    eosManager.playerAvatar = imageManager.GetTexture(handle);

                }
                else
                {
                    Debug.LogError("image error " + handle.Id);
                }

            });
        };
    }
thetestgame commented 3 years ago

Getting the same issue.

theneron commented 3 years ago

Embedded message fields can be added to the disabled option.

E.g: { name: 'Name', value: 'Value', disabled: true }

NIMFER commented 3 years ago

Update: I discovered that the error takes place only if you have changed your avatar, if you still use the default one then it will work but if you ever change the avatar then it will give you the InternalError