mirror of
				https://github.com/reality/dbot.git
				synced 2025-11-04 05:17:52 +01:00 
			
		
		
		
	Added Sample folder for (easier) module development.
This commit is contained in:
		
							parent
							
								
									ade1dcd5e8
								
							
						
					
					
						commit
						d1b72fe443
					
				
							
								
								
									
										25
									
								
								modules/SAMPLE/README.md
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										25
									
								
								modules/SAMPLE/README.md
									
									
									
									
									
										Normal file
									
								
							@ -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
 | 
			
		||||
							
								
								
									
										4
									
								
								modules/SAMPLE/config.json_.json
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										4
									
								
								modules/SAMPLE/config.json_.json
									
									
									
									
									
										Normal file
									
								
							@ -0,0 +1,4 @@
 | 
			
		||||
{
 | 
			
		||||
    "foo": true,
 | 
			
		||||
    "foo": "bar"
 | 
			
		||||
}
 | 
			
		||||
							
								
								
									
										39
									
								
								modules/SAMPLE/foo.js_.js
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										39
									
								
								modules/SAMPLE/foo.js_.js
									
									
									
									
									
										Normal file
									
								
							@ -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
 | 
			
		||||
};
 | 
			
		||||
							
								
								
									
										8
									
								
								modules/SAMPLE/strings.json_.json
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										8
									
								
								modules/SAMPLE/strings.json_.json
									
									
									
									
									
										Normal file
									
								
							@ -0,0 +1,8 @@
 | 
			
		||||
{
 | 
			
		||||
    "foo": {
 | 
			
		||||
        "en": "{output} bar"
 | 
			
		||||
    },
 | 
			
		||||
    "foo2": {
 | 
			
		||||
        "en": "Something went wrong :( Example:'~foo bar'"
 | 
			
		||||
    }
 | 
			
		||||
}
 | 
			
		||||
							
								
								
									
										3
									
								
								modules/SAMPLE/usage.json_.json
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										3
									
								
								modules/SAMPLE/usage.json_.json
									
									
									
									
									
										Normal file
									
								
							@ -0,0 +1,3 @@
 | 
			
		||||
{
 | 
			
		||||
    "~foo": "~foo [bar]"
 | 
			
		||||
}
 | 
			
		||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user