{"action":"closed","issue":{"url":"https://api.github.com/repos/The-SourceCode/Discord.js-Bot-Development/issues/8","repository_url":"https://api.github.com/repos/The-SourceCode/Discord.js-Bot-Development","labels_url":"https://api.github.com/repos/The-SourceCode/Discord.js-Bot-Development/issues/8/labels{/name}","comments_url":"https://api.github.com/repos/The-SourceCode/Discord.js-Bot-Development/issues/8/comments","events_url":"https://api.github.com/repos/The-SourceCode/Discord.js-Bot-Development/issues/8/events","html_url":"https://github.com/The-SourceCode/Discord.js-Bot-Development/issues/8","id":349567298,"node_id":"MDU6SXNzdWUzNDk1NjcyOTg=","number":8,"title":"Addrole command.It's giving a role,but not writing a message when it's given","user":{"login":"Vitaliy100","id":32457326,"node_id":"MDQ6VXNlcjMyNDU3MzI2","avatar_url":"https://avatars3.githubusercontent.com/u/32457326?v=4","gravatar_id":"","url":"https://api.github.com/users/Vitaliy100","html_url":"https://github.com/Vitaliy100","followers_url":"https://api.github.com/users/Vitaliy100/followers","following_url":"https://api.github.com/users/Vitaliy100/following{/other_user}","gists_url":"https://api.github.com/users/Vitaliy100/gists{/gist_id}","starred_url":"https://api.github.com/users/Vitaliy100/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Vitaliy100/subscriptions","organizations_url":"https://api.github.com/users/Vitaliy100/orgs","repos_url":"https://api.github.com/users/Vitaliy100/repos","events_url":"https://api.github.com/users/Vitaliy100/events{/privacy}","received_events_url":"https://api.github.com/users/Vitaliy100/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":0,"created_at":"2018-08-10T15:49:27Z","updated_at":"2018-08-11T06:01:55Z","closed_at":"2018-08-11T06:01:55Z","author_association":"NONE","body":"Code is:\r\nconst Discord = require(\"discord.js\");\r\nmodule.exports.run = async (bot, message, args) => {\r\n  if(!message.member.hasPermission(\"MANAGE_MEMBERS\")) return message.reply(\"Sorry pal, you can't do that.\");\r\n  let rMember = message.guild.member(message.mentions.users.first()) || message.guild.members.get(args[0]);\r\n  if(!rMember) return message.reply(\"Couldn't find that user, yo.\");\r\n  let role = args.join(\" \").slice(22);\r\n  if(!role) return message.reply(\"Specify a role!\");\r\n  let gRole = message.guild.roles.find(`name`, role);\r\n  if(!gRole) return message.reply(\"Couldn't find that role.\");\r\n  if(rMember.roles.has(gRole.id)) return message.reply(\"They already have that role.\");\r\n  await(rMember.addRole(gRole.id));\r\n  try{\r\n    await rMember.send(`Congrats, you have been given the role ${gRole.name}`)\r\n  }catch(e){\r\n    message.channel.send(`Congrats to <@${rMember.id}>, they have been given the role ${gRole.name}. `)\r\n  }\r\n}\r\nmodule.exports.help = {\r\n  name: \"addrole\"\r\n}"}}
{"actor":{"display_login":"Vitaliy100"}}