Discord.net: Creating role is broken

Created on 29 Oct 2016  路  3Comments  路  Source: discord-net/Discord.Net

Using either a SocketGuild, or a RestGuild, with CreateRoleAsync both throw the following exception:

System.NullReferenceException: Object reference not set to an instance of an object.
   at Discord.Rest.RoleHelper.<ModifyAsync>d__1.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
   at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
   at Discord.Rest.RestRole.<ModifyAsync>d__40.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
   at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
   at Discord.Rest.GuildHelper.<CreateRoleAsync>d__16.MoveNext()
bug core

All 3 comments

The exception occurs on this part in RoleHelper because role.Guild is null. The current CreateRoleAsync sends a create role request to the api, then tries to modify the role immediately. However, the guild id is not present in the Role object returned from the creation, so the RestRole.Guild never gets set anywhere.

So.... Discord.net is Completely Useless

This issue has already been fixed as far as I know, could you elaborate your negative feedback regarding role creation?

Was this page helpful?
0 / 5 - 0 ratings

Related issues

RheaAyase picture RheaAyase  路  7Comments

AshkoreDracson picture AshkoreDracson  路  8Comments

Foxite picture Foxite  路  4Comments

MinisBett picture MinisBett  路  3Comments

Jyrka98 picture Jyrka98  路  6Comments