{"action":"closed","issue":{"url":"https://api.github.com/repos/bwmarrin/discordgo/issues/565","repository_url":"https://api.github.com/repos/bwmarrin/discordgo","labels_url":"https://api.github.com/repos/bwmarrin/discordgo/issues/565/labels{/name}","comments_url":"https://api.github.com/repos/bwmarrin/discordgo/issues/565/comments","events_url":"https://api.github.com/repos/bwmarrin/discordgo/issues/565/events","html_url":"https://github.com/bwmarrin/discordgo/issues/565","id":336545343,"node_id":"MDU6SXNzdWUzMzY1NDUzNDM=","number":565,"title":"How can I check if my bot has the permission to send message to a particular channel?","user":{"login":"akritrime","id":32516978,"node_id":"MDQ6VXNlcjMyNTE2OTc4","avatar_url":"https://avatars3.githubusercontent.com/u/32516978?v=4","gravatar_id":"","url":"https://api.github.com/users/akritrime","html_url":"https://github.com/akritrime","followers_url":"https://api.github.com/users/akritrime/followers","following_url":"https://api.github.com/users/akritrime/following{/other_user}","gists_url":"https://api.github.com/users/akritrime/gists{/gist_id}","starred_url":"https://api.github.com/users/akritrime/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/akritrime/subscriptions","organizations_url":"https://api.github.com/users/akritrime/orgs","repos_url":"https://api.github.com/users/akritrime/repos","events_url":"https://api.github.com/users/akritrime/events{/privacy}","received_events_url":"https://api.github.com/users/akritrime/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":2,"created_at":"2018-06-28T09:34:04Z","updated_at":"2018-06-29T06:30:07Z","closed_at":"2018-06-29T06:30:07Z","author_association":"NONE","body":"I wrote this function but it doesn't seem like it works.\r\n\r\n```\r\nfunc checkPermission(s *discordgo.Session, userID string, channelID string) bool {\r\n    p, err := s.State.UserChannelPermissions(userID, channelID)\r\n    return (err == nil) && (p&dg.PermissionSendMessages == dg.PermissionSendMessages)\r\n}\r\n```\r\nEdit: used the channelID properly"}}
{"actor":{"display_login":"akritrime"}}