Skip to content

Commit

Permalink
i am bot
Browse files Browse the repository at this point in the history
  • Loading branch information
chee committed Feb 20, 2017
0 parents commit 0901b00
Show file tree
Hide file tree
Showing 4 changed files with 69 additions and 0 deletions.
1 change: 1 addition & 0 deletions .gitignore
@@ -0,0 +1 @@
node_modules/
25 changes: 25 additions & 0 deletions index.js
@@ -0,0 +1,25 @@
const phrik = 'phrik'
const name = 'phrikpipe'

const irc = require('irc')
const client = new irc.Client('chat.freenode.net', name, {
userName: name,
realName: name,
port: 6697,
secure: true,
channels: ['#chee-fanclub']
})

client.addListener('message', (from, to, message) => {
const words = message.split(/\s+/)
if (words[0] != `@${phrik}`) return
const command = words.slice(1).join(' ')
client.say(phrik, command)
})

client.addListener('pm', (from, message) => {
if (from != phrik) return
const words = message.split(/\s+/)
const response = words[0] == `${name}:` ? words.slice(1).join(' ') : words.join(' ')
client.say('#chee-fanclub', response)
})
11 changes: 11 additions & 0 deletions package.json
@@ -0,0 +1,11 @@
{
"name": "phrikpipe",
"version": "1.0.0",
"main": "index.js",
"license": "GPL",
"description": "phrik pipe",
"author": "chee <chee@snake.dog>",
"dependencies": {
"irc": "^0.5.2"
}
}
32 changes: 32 additions & 0 deletions yarn.lock
@@ -0,0 +1,32 @@
# THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY.
# yarn lockfile v1


iconv@~2.2.1:
version "2.2.1"
resolved "https://registry.yarnpkg.com/iconv/-/iconv-2.2.1.tgz#39b13fdd98987d26aef26c0a2f2a900911fa4584"
dependencies:
nan "^2.3.5"

irc-colors@^1.1.0:
version "1.3.1"
resolved "https://registry.yarnpkg.com/irc-colors/-/irc-colors-1.3.1.tgz#a6fccee5d9ecdc010c2b1cde3fbdff1f7134aff6"

irc@^0.5.2:
version "0.5.2"
resolved "https://registry.yarnpkg.com/irc/-/irc-0.5.2.tgz#3714f4768365a96d0b2f776bc91166beb2464bbc"
dependencies:
irc-colors "^1.1.0"
optionalDependencies:
iconv "~2.2.1"
node-icu-charset-detector "~0.2.0"

nan@^2.3.3, nan@^2.3.5:
version "2.5.1"
resolved "https://registry.yarnpkg.com/nan/-/nan-2.5.1.tgz#d5b01691253326a97a2bbee9e61c55d8d60351e2"

node-icu-charset-detector@~0.2.0:
version "0.2.0"
resolved "https://registry.yarnpkg.com/node-icu-charset-detector/-/node-icu-charset-detector-0.2.0.tgz#c2320da374ddcb671fc54cb4a0e041e156ffd639"
dependencies:
nan "^2.3.3"

0 comments on commit 0901b00

Please sign in to comment.