I want to send DM to discord-bot, but I get the following error.
23 Jun 23:17:51-TypeError: Can not read property 'roles' of null
Client.message (/home/bob/.node-red/node_modules/node-red-contrib-discord/discord/discordMessage.js: 25: 58)
In order to solve this, we modified the program in the local environment.
I want to send DM to discord-bot, but I get the following error.
23 Jun 23:17:51-TypeError: Can not read property 'roles' of null Client.message (/home/bob/.node-red/node_modules/node-red-contrib-discord/discord/discordMessage.js: 25: 58)
In order to solve this, we modified the program in the local environment.
LINE: 25 [before] msg.memberRoleNames = message.member.roles.array (). map (function (item) {return item.name});
[after] msg.memberRoleNames = message.member? message.member.roles.array (). map (function (item) {return item.name}): null;
I am able to send DM to Discord-Bot. Can you modify the program code?