{"action":"created","issue":{"url":"https://api.github.com/repos/abalabahaha/eris/issues/385","repository_url":"https://api.github.com/repos/abalabahaha/eris","labels_url":"https://api.github.com/repos/abalabahaha/eris/issues/385/labels{/name}","comments_url":"https://api.github.com/repos/abalabahaha/eris/issues/385/comments","events_url":"https://api.github.com/repos/abalabahaha/eris/issues/385/events","html_url":"https://github.com/abalabahaha/eris/issues/385","id":319081824,"number":385,"title":"Node express?","user":{"login":"exwizzard","id":1271688,"avatar_url":"https://avatars3.githubusercontent.com/u/1271688?v=4","gravatar_id":"","url":"https://api.github.com/users/exwizzard","html_url":"https://github.com/exwizzard","followers_url":"https://api.github.com/users/exwizzard/followers","following_url":"https://api.github.com/users/exwizzard/following{/other_user}","gists_url":"https://api.github.com/users/exwizzard/gists{/gist_id}","starred_url":"https://api.github.com/users/exwizzard/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/exwizzard/subscriptions","organizations_url":"https://api.github.com/users/exwizzard/orgs","repos_url":"https://api.github.com/users/exwizzard/repos","events_url":"https://api.github.com/users/exwizzard/events{/privacy}","received_events_url":"https://api.github.com/users/exwizzard/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":0,"created_at":"2018-05-01T00:39:20Z","updated_at":"2018-05-01T01:41:35Z","closed_at":"2018-05-01T01:41:35Z","author_association":"NONE","body":"Is it possible to run this bot together with node express so that the bot can be controlled from a web interface?"},"comment":{"url":"https://api.github.com/repos/abalabahaha/eris/issues/comments/385578499","html_url":"https://github.com/abalabahaha/eris/issues/385#issuecomment-385578499","issue_url":"https://api.github.com/repos/abalabahaha/eris/issues/385","id":385578499,"user":{"login":"exwizzard","id":1271688,"avatar_url":"https://avatars3.githubusercontent.com/u/1271688?v=4","gravatar_id":"","url":"https://api.github.com/users/exwizzard","html_url":"https://github.com/exwizzard","followers_url":"https://api.github.com/users/exwizzard/followers","following_url":"https://api.github.com/users/exwizzard/following{/other_user}","gists_url":"https://api.github.com/users/exwizzard/gists{/gist_id}","starred_url":"https://api.github.com/users/exwizzard/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/exwizzard/subscriptions","organizations_url":"https://api.github.com/users/exwizzard/orgs","repos_url":"https://api.github.com/users/exwizzard/repos","events_url":"https://api.github.com/users/exwizzard/events{/privacy}","received_events_url":"https://api.github.com/users/exwizzard/received_events","type":"User","site_admin":false},"created_at":"2018-05-01T01:41:35Z","updated_at":"2018-05-01T01:41:35Z","author_association":"NONE","body":"Its totally possible, I have whipped this up after some research and would like to post it here for anyone else who might google for a similar solution:\r\n\r\n```\r\nconst express = require('express')\r\nconst app = express()\r\n\r\nconst Eris = require(\"eris\");\r\n\r\nvar bot = new Eris(\"token\");\r\n\r\napp.get('/api/:username/:message', function (req, res) {\r\n        messageUser(req.params);\r\n        res.send('200');\r\n})\r\n\r\nfunction messageUser(data) {\r\n        let user = bot.users.find(u => u.username == data.username)\r\n        bot.getDMChannel(user.id).then(dm => dm.createMessage(data.message))\r\n        console.log(data);\r\n        return true;\r\n}\r\n\r\nbot.on(\"ready\", () => { // When the bot is ready\r\n    console.log(\"Ready!\"); // Log \"Ready!\"\r\n});\r\n\r\napp.listen(3000, () => console.log('Example app listening on port 3000!'))\r\nbot.connect(); // Get the bot to connect to Discord\r\n```\r\n\r\nBased on this code, when I go to `http://localhost:3000/api/exwizzard/heya` the bot will message user \"exwizzard\" with the message \"heya\"."}}
{"actor":{"display_login":"exwizzard"}}