summaryrefslogtreecommitdiff
path: root/index.js
diff options
context:
space:
mode:
authorJoe Robinson <joe@lc8n.com>2016-03-24 17:17:39 +0100
committerJoe Robinson <joe@lc8n.com>2016-03-24 17:17:39 +0100
commitdb3ebaab5f2b5d986b378c2350bfc5b6f9d54271 (patch)
tree45655164e57937d069e73fe1d76bf900caff2782 /index.js
Intiial commit
Diffstat (limited to 'index.js')
-rw-r--r--index.js22
1 files changed, 22 insertions, 0 deletions
diff --git a/index.js b/index.js
new file mode 100644
index 0000000..e5d3b0c
--- /dev/null
+++ b/index.js
@@ -0,0 +1,22 @@
+
+$("#submitb").click(function() {
+ sendMsg();
+});
+
+const irc = require('irc');
+
+const client = new irc.Client('irc.blatech.net', 'wclient', {
+ channels: ['#wtest'],
+ userName: ['wclient']
+});
+
+function sendMsg() {
+ console.log('#wtest: ' + $("#send-message").val());
+ client.say("#wtest", $("#send-message").val());
+}
+
+
+client.addListener('message#wtest', function (from, message) {
+ console.log(from + ' => #wtest: ' + message);
+ $("#chat").append(from + ' : ' + message + "<br>");
+});