-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
24 changed files
with
650 additions
and
55 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,6 @@ | ||
# conf | ||
src/configs/tokenConf.json | ||
|
||
# Logs | ||
logs | ||
*.log | ||
|
Empty file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
'use strict'; | ||
|
||
import WebSpell from './WebSpell'; | ||
|
||
import config from './configs/customConf.json'; | ||
import tokenConf from './configs/tokenConf.json'; | ||
|
||
const Bot = new WebSpell( | ||
tokenConf.bot.token, | ||
{ | ||
autoreconnect: true, | ||
defaultImageFormat: 'png', | ||
defaultImageSize: 512, | ||
disableEveryone: true, | ||
getAllUsers: true, | ||
messageLimit: 100, | ||
restMode: true | ||
}, | ||
config | ||
); | ||
|
||
export default Bot; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,46 @@ | ||
'use strict'; | ||
|
||
import AxonClient from 'axoncore'; | ||
|
||
import * as modules from './modules/index'; | ||
|
||
/** | ||
* Example - Client constructor | ||
* | ||
* @author KhaaZ | ||
* | ||
* @class Client | ||
* @extends {AxonCore.AxonClient} | ||
*/ | ||
class WebSpell extends AxonClient { | ||
constructor(token, options, config) { | ||
super(token, options, config, modules); | ||
|
||
} | ||
|
||
initStaff() { | ||
this.staff.manager = []; | ||
} | ||
|
||
/** CURRENTLY DISABLED */ | ||
$init() { | ||
return new Promise((resolve, reject) => { | ||
try { | ||
resolve(true); | ||
} catch (err) { | ||
reject(err); | ||
} | ||
}); | ||
} | ||
|
||
/** CURRENTLY DISABLED */ | ||
$initStatus() { | ||
this.editStatus(null, { | ||
name: `webSPELL | ${this.params.prefix[0]}help`, | ||
type: 0 | ||
}); | ||
} | ||
|
||
} | ||
|
||
export default WebSpell; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
{ | ||
"general": { | ||
"name": "webSPELL", | ||
"description": "webSPELL - RSS news and others (webSPELL network)" | ||
}, | ||
|
||
"prefix": { | ||
"general": "//", | ||
"owner": "!!", | ||
"admin": "e." | ||
}, | ||
|
||
"ids": { | ||
"owners": ["179908288337412096"], | ||
"admins": ["179908288337412096", "205439821236142082"] | ||
}, | ||
|
||
"configPath": { | ||
"general": "/home/khaaz/GIT/webSPELL/src/configs/generalConf.json", | ||
"template": "/home/khaaz/GIT/webSPELL/src/configs/templateConf.json", | ||
"tokens": "/home/khaaz/GIT/webSPELL/src/configs/tokenConf.json" | ||
}, | ||
|
||
"debugMode": false, | ||
|
||
"customLogger": true, | ||
"customDB": true | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
{ | ||
"name": "Axon", | ||
"description": "AxonCore - Bot client, core module (eris lib)", | ||
"avatar": "url", | ||
|
||
"version": "1.0", | ||
"lib": "eris", | ||
"client": "Axon", | ||
|
||
"links": { | ||
"website": "", | ||
"invite": "", | ||
"invitePermission": "", | ||
"server": "", | ||
|
||
"github": "https://github.com/khaazz/AxonCore", | ||
"trello": "", | ||
"sentry": "" | ||
}, | ||
|
||
|
||
"owners": { | ||
"khaaz": { | ||
"name": "KhaaZ#0001", | ||
"id": "179908288337412096" | ||
}, | ||
"example": { | ||
"name": "example#1234", | ||
"id": "123456789" | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
{ | ||
"embed": { | ||
"colors": { | ||
"help": "", | ||
"global": 4315874, | ||
"error": 15844367 | ||
} | ||
}, | ||
|
||
"emote": { | ||
"error": "<:error:426906693624922113>", | ||
"success": "<:success:426906630463160330>", | ||
"loading": "<a:loading:397911964988342282>", | ||
"update": "<:update:373546418952077323>", | ||
"info": ":information_source:" | ||
}, | ||
|
||
"message": { | ||
"error": { | ||
"permBot": "I don't have sufficient permissions to do that!", | ||
"permSource": "You don't have sufficient permissions to do that!", | ||
"permDest": "This user is a mod/admin, I can't do that!", | ||
"cooldown": "Please, slow down!", | ||
"general": "An unexpected error occured! Contact Bot developers." | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
import Bot from './Bot'; | ||
|
||
// packages | ||
import mongoose from 'mongoose'; | ||
|
||
try { | ||
mongoose.connect('mongodb://localhost/webSpellDB'); | ||
Bot.Logger.notice('Connected to webSpell DataBase.'); | ||
} catch (e) { | ||
Bot.Logger.emerg('Could NOT connect to webSpell DataBase.\n' + e.stack); | ||
} | ||
|
||
// User ned to Deal with error listener by himself | ||
// where to log etc | ||
// Error Listeners | ||
process.on('uncaughtException', (err) => { | ||
Bot.Logger.emerg(err.stack); | ||
|
||
Bot.emit('error', err); | ||
|
||
process.exit(1); | ||
}); | ||
|
||
process.on('unhandledRejection', (err) => { | ||
Bot.Logger.error(err.stack); | ||
|
||
Bot.emit('error', err); | ||
|
||
}); | ||
|
||
Bot.on('error', (err) => { | ||
Bot.Logger.error(err.stack); | ||
}); | ||
|
||
Bot.on('warn', (msg) => { | ||
Bot.Logger.warn(msg); | ||
}); | ||
|
||
// Connection | ||
Bot.connect(); | ||
|
||
Bot.Logger.notice('=== ONLINE ==='); |
Empty file.
Empty file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,46 @@ | ||
'use strict'; | ||
|
||
import { Command } from 'axoncore'; | ||
|
||
import Pong from './Ping_Pong'; | ||
|
||
class Ping extends Command { | ||
|
||
constructor(module) { | ||
super(module); | ||
|
||
this.label = 'ping'; | ||
this.aliases = ['ping']; | ||
|
||
this.hasSubcmd = true; | ||
this.subcmds = [Pong]; | ||
|
||
this.infos = { | ||
owner: ['KhaaZ'], | ||
cmdName: 'ping', | ||
description: 'Ping the bot.', | ||
examples: ['ping'], | ||
arguments: [] | ||
}; | ||
|
||
this.options.argsMin = 0; | ||
this.options.cooldown = 3000; | ||
this.options.guildOnly = false; | ||
} | ||
|
||
async execute({ msg }) { | ||
const start = Date.now(); | ||
|
||
const mess = await this.sendMessage(msg.channel, 'Pong! '); | ||
|
||
if (!mess) { | ||
return; | ||
} | ||
|
||
const diff = (Date.now() - start); | ||
|
||
return this.editMessage(mess, `Pong! \`${diff}ms\``); | ||
} | ||
} | ||
|
||
export default Ping; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
'use strict'; | ||
|
||
import { Command } from 'axoncore'; | ||
|
||
class Pong extends Command { | ||
|
||
constructor(module) { | ||
super(module); | ||
|
||
this.label = 'pong'; | ||
this.aliases = ['pong']; | ||
|
||
this.isSubcmd = true; | ||
this.hasSubcmd = false; | ||
|
||
this.infos = { | ||
owner: ['KhaaZ'], | ||
cmdName: 'ping pong', | ||
description: 'Pong the bot.', | ||
examples: ['ping pong'], | ||
arguments: [] | ||
}; | ||
|
||
this.options.argsMin = 0; | ||
this.options.cooldown = 3000; | ||
this.options.guildOnly = false; | ||
} | ||
|
||
async execute({ msg }) { | ||
const start = Date.now(); | ||
|
||
const mess = await this.sendMessage(msg.channel, 'BADABOUM!'); | ||
if (!mess) { | ||
return; | ||
} | ||
|
||
const diff = (Date.now() - start); | ||
|
||
return this.editMessage(mess, `BADABOUM! \`${diff}ms\``); | ||
} | ||
} | ||
|
||
export default Pong; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
export { default as Ping } from './Ping'; |
0
configs/.gitkeep → src/modules/Core/events/index.js
100644 → 100755
File renamed without changes.
Oops, something went wrong.