From d1b72fe4439a49d219083eba1f1a2d9620d7e4e7 Mon Sep 17 00:00:00 2001 From: thoso Date: Thu, 20 Feb 2014 04:33:56 +0100 Subject: [PATCH] Added Sample folder for (easier) module development. --- modules/SAMPLE/README.md | 25 ++++++++++++++++++++ modules/SAMPLE/config.json_.json | 4 ++++ modules/SAMPLE/foo.js_.js | 39 +++++++++++++++++++++++++++++++ modules/SAMPLE/strings.json_.json | 8 +++++++ modules/SAMPLE/usage.json_.json | 3 +++ 5 files changed, 79 insertions(+) create mode 100644 modules/SAMPLE/README.md create mode 100644 modules/SAMPLE/config.json_.json create mode 100644 modules/SAMPLE/foo.js_.js create mode 100644 modules/SAMPLE/strings.json_.json create mode 100644 modules/SAMPLE/usage.json_.json diff --git a/modules/SAMPLE/README.md b/modules/SAMPLE/README.md new file mode 100644 index 0000000..65b115f --- /dev/null +++ b/modules/SAMPLE/README.md @@ -0,0 +1,25 @@ +## FOO + +bar. + +### Description + +This module provides a command which allows users to foobar. + +### Dependencies + +It has following dependencies: +node-wolfram : https://github.com/strax/node-wolfram + +### config.json + +foo + +### Commands + +#### ~foo [(bar] + +Example: +~foo bar + +### TODO \ No newline at end of file diff --git a/modules/SAMPLE/config.json_.json b/modules/SAMPLE/config.json_.json new file mode 100644 index 0000000..a1e88b8 --- /dev/null +++ b/modules/SAMPLE/config.json_.json @@ -0,0 +1,4 @@ +{ + "foo": true, + "foo": "bar" +} \ No newline at end of file diff --git a/modules/SAMPLE/foo.js_.js b/modules/SAMPLE/foo.js_.js new file mode 100644 index 0000000..5435698 --- /dev/null +++ b/modules/SAMPLE/foo.js_.js @@ -0,0 +1,39 @@ +/** + * Module Name: foo + * Description: bar. + * Requires: foo [bar] + */ + +var _ = require('underscore')._, + bar = require('foo');//dependencies + +var foo = function(dbot) { //name of module + + this.ApiRoot = 'API_ROOT_HERE'; + + this.internalAPI = { + //code for internal api here + }; + + this.api = { + //code for api here + }; + + this.commands = { + //code for commands here + }; + + this.onLoad = function() { + //code for stuff to be done on load here + }; + + this.onDestroy = function() { + //stuff to be done on destroy here + }; + } + +}; + +exports.fetch = function(dbot) { + return new foo(dbot); //name of module +}; diff --git a/modules/SAMPLE/strings.json_.json b/modules/SAMPLE/strings.json_.json new file mode 100644 index 0000000..dd01128 --- /dev/null +++ b/modules/SAMPLE/strings.json_.json @@ -0,0 +1,8 @@ +{ + "foo": { + "en": "{output} bar" + }, + "foo2": { + "en": "Something went wrong :( Example:'~foo bar'" + } +} diff --git a/modules/SAMPLE/usage.json_.json b/modules/SAMPLE/usage.json_.json new file mode 100644 index 0000000..8f9e67e --- /dev/null +++ b/modules/SAMPLE/usage.json_.json @@ -0,0 +1,3 @@ +{ + "~foo": "~foo [bar]" +} \ No newline at end of file