{"action":"created","issue":{"url":"https://api.github.com/repos/discordjs/discord.js/issues/2969","repository_url":"https://api.github.com/repos/discordjs/discord.js","labels_url":"https://api.github.com/repos/discordjs/discord.js/issues/2969/labels{/name}","comments_url":"https://api.github.com/repos/discordjs/discord.js/issues/2969/comments","events_url":"https://api.github.com/repos/discordjs/discord.js/issues/2969/events","html_url":"https://github.com/discordjs/discord.js/issues/2969","id":384082025,"node_id":"MDU6SXNzdWUzODQwODIwMjU=","number":2969,"title":"Client.guilds is Array[0] even if a bot is in 2 servers","user":{"login":"someone0010","id":44930310,"node_id":"MDQ6VXNlcjQ0OTMwMzEw","avatar_url":"https://avatars2.githubusercontent.com/u/44930310?v=4","gravatar_id":"","url":"https://api.github.com/users/someone0010","html_url":"https://github.com/someone0010","followers_url":"https://api.github.com/users/someone0010/followers","following_url":"https://api.github.com/users/someone0010/following{/other_user}","gists_url":"https://api.github.com/users/someone0010/gists{/gist_id}","starred_url":"https://api.github.com/users/someone0010/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/someone0010/subscriptions","organizations_url":"https://api.github.com/users/someone0010/orgs","repos_url":"https://api.github.com/users/someone0010/repos","events_url":"https://api.github.com/users/someone0010/events{/privacy}","received_events_url":"https://api.github.com/users/someone0010/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":3,"created_at":"2018-11-25T14:04:32Z","updated_at":"2018-11-27T16:11:18Z","closed_at":"2018-11-27T16:10:50Z","author_association":"NONE","body":"**Please describe the problem you are having in as much detail as possible:**\r\nI have been trying to do a rainbow role function for my friend's Discord server using a bot. I couldn't do it, because Client.guilds.get() - whenever an ID is correct (in string) returns null.\r\n\r\nClient.guilds.keyArray() returns Array[0] and Client.guilds.first() returns null.\r\n\r\n**Include a reproducible code sample here, if possible:**\r\n```js\r\n// ...\r\nvar r = client.guilds.get(\"493432486148177923\").roles.get(\"501752627709870080\"); // the error is here\r\nsetInterval(()=>{\r\n  r.setColor([Math.floor(Math.random() * 255), Math.floor(Math.random() * 255), Math.floor(Math.random() * 255)]);\r\n}, 15000);\r\n// ...\r\n```\r\n\r\n**Further details:**\r\n- discord.js version: 11.4.2\r\n- Node.js version: 8.0.0\r\n- Operating system: Windows 10 1803 compilation 17134.112\r\n- Priority this issue should have – please be realistic and elaborate if possible: low\r\n\r\n<!--\r\nIf this applies to you, please check the respective checkbox: [ ] becomes [x].\r\nYou don't have to modify the text to suit your particular situation – if you want to\r\nelaborate, please do so in the description.\r\nWhile it's not a requirement to test your issue on the master branch, it would make fixing\r\nthe problem a lot easier for us, so please do so if possible.\r\n-->\r\n\r\n- [ ] I have also tested the issue on latest master, commit hash:\r\n"},"comment":{"url":"https://api.github.com/repos/discordjs/discord.js/issues/comments/442116925","html_url":"https://github.com/discordjs/discord.js/issues/2969#issuecomment-442116925","issue_url":"https://api.github.com/repos/discordjs/discord.js/issues/2969","id":442116925,"node_id":"MDEyOklzc3VlQ29tbWVudDQ0MjExNjkyNQ==","user":{"login":"iCrawl","id":20760160,"node_id":"MDQ6VXNlcjIwNzYwMTYw","avatar_url":"https://avatars1.githubusercontent.com/u/20760160?v=4","gravatar_id":"","url":"https://api.github.com/users/iCrawl","html_url":"https://github.com/iCrawl","followers_url":"https://api.github.com/users/iCrawl/followers","following_url":"https://api.github.com/users/iCrawl/following{/other_user}","gists_url":"https://api.github.com/users/iCrawl/gists{/gist_id}","starred_url":"https://api.github.com/users/iCrawl/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/iCrawl/subscriptions","organizations_url":"https://api.github.com/users/iCrawl/orgs","repos_url":"https://api.github.com/users/iCrawl/repos","events_url":"https://api.github.com/users/iCrawl/events{/privacy}","received_events_url":"https://api.github.com/users/iCrawl/received_events","type":"User","site_admin":false},"created_at":"2018-11-27T16:11:18Z","updated_at":"2018-11-27T16:11:18Z","author_association":"MEMBER","body":"Has been answered as above, apart from the ToS violation you probably access it before the ready event. \r\n\r\nEither way this needs more information and less ToS violation."}}
{"actor":{"display_login":"iCrawl"}}