{"action":"opened","issue":{"url":"https://api.github.com/repos/Twentysix26/Red-DiscordBot/issues/756","repository_url":"https://api.github.com/repos/Twentysix26/Red-DiscordBot","labels_url":"https://api.github.com/repos/Twentysix26/Red-DiscordBot/issues/756/labels{/name}","comments_url":"https://api.github.com/repos/Twentysix26/Red-DiscordBot/issues/756/comments","events_url":"https://api.github.com/repos/Twentysix26/Red-DiscordBot/issues/756/events","html_url":"https://github.com/Twentysix26/Red-DiscordBot/issues/756","id":228486997,"number":756,"title":"Python issue (cog related)","user":{"login":"E-v-o","id":12152171,"avatar_url":"https://avatars1.githubusercontent.com/u/12152171?v=3","gravatar_id":"","url":"https://api.github.com/users/E-v-o","html_url":"https://github.com/E-v-o","followers_url":"https://api.github.com/users/E-v-o/followers","following_url":"https://api.github.com/users/E-v-o/following{/other_user}","gists_url":"https://api.github.com/users/E-v-o/gists{/gist_id}","starred_url":"https://api.github.com/users/E-v-o/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/E-v-o/subscriptions","organizations_url":"https://api.github.com/users/E-v-o/orgs","repos_url":"https://api.github.com/users/E-v-o/repos","events_url":"https://api.github.com/users/E-v-o/events{/privacy}","received_events_url":"https://api.github.com/users/E-v-o/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":0,"created_at":"2017-05-13T17:20:13Z","updated_at":"2017-05-13T17:20:13Z","closed_at":null,"body":"Hi there,\r\n\r\nI've tried to create a cog with python to ping an IP and Port then give the result in chat. I've tried a few things now but cannot seem to get it to work. Would you mind checking my script and try point out any issues it may have?\r\n`import discord\r\nfrom .utils import checks\r\nfrom discord.ext import commands\r\nfrom cogs.utils.dataIO import dataIO\r\nfrom .utils.chat_formatting import pagify\r\nimport os\r\nimport socket\r\n\r\nclass Serverstatus:\r\n\r\n    def __init__(self, bot):\r\n        self.bot = bot\r\n    \r\n    @commands.command(pass_context=True)\r\n    async def serverstatus(self, ctx):\r\n        CONNECTION_TIMEOUT = 5\r\n        try:\r\n            socket.socket().connect((127.0.0.1, 4490))\r\n            await self.bot.say(\"The server is currently online!\")\r\n        except:\r\n            await self.bot.say(\"The server is currently offline!\")\r\n    return\r\n\r\ndef setup(bot):\r\n    bot.add_cog(Serverstatus(bot))`\r\n"}}
{"actor":{"display_login":"E-v-o"}}