Skip to content

Commit

Permalink
Core: Add 'reconnect' command
Browse files Browse the repository at this point in the history
  • Loading branch information
AgustinSRG committed Apr 14, 2024
1 parent b28c08c commit eada918
Show file tree
Hide file tree
Showing 4 changed files with 55 additions and 21 deletions.
4 changes: 2 additions & 2 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "showdown-chatbot",
"version": "2.11.0",
"version": "2.11.1",
"author": {
"name": "Agustin San Roman",
"email": "[email protected]",
Expand Down
59 changes: 41 additions & 18 deletions src/bot-modules/core/botmodule.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,33 +4,56 @@
"main": "core.js",
"commands": [
"commands/exec-cmd.js",
"commands/seen.js",
"commands/control.js",
"commands/cmd-admin.js"
"commands/seen.js",
"commands/control.js",
"commands/cmd-admin.js"
],
"permissions": {
"commands": {"excepted": true},
"grant": {"excepted": true},
"set": {"group": "owner"},
"joinroom": {"group": "admin"},
"leaveroom": {"group": "admin"},
"send": {"group": "admin"},
"say": {"group": "mod"},
"saycmd": {"group": "mod"},
"alts": {"group": "user"},
"fullalts": {"group": "admin"}
"commands": {
"excepted": true
},
"grant": {
"excepted": true
},
"reconnect": {
"excepted": true
},
"set": {
"group": "owner"
},
"joinroom": {
"group": "admin"
},
"leaveroom": {
"group": "admin"
},
"send": {
"group": "admin"
},
"say": {
"group": "mod"
},
"saycmd": {
"group": "mod"
},
"alts": {
"group": "user"
},
"fullalts": {
"group": "admin"
}
},
"handlers": [
"handlers/autojoin.js",
"handlers/login.js"
"handlers/login.js"
],
"langfiles": [
"../../command-parser.translations",
"../../command-usage.translations",
"../../command-usage.translations",
"./commands/cmd-admin.translations",
"./commands/control.translations",
"./commands/exec-cmd.translations",
"./commands/seen.translations"
"./commands/control.translations",
"./commands/exec-cmd.translations",
"./commands/seen.translations"
],
"description": "Essential Module"
}
11 changes: 11 additions & 0 deletions src/bot-modules/core/commands/control.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
* time: gets the bot time
* uptime: gets the process uptime
* contime: gets the connection time
* reconnect: Forces the bot to reconnect to the server
*/

'use strict';
Expand Down Expand Up @@ -66,6 +67,16 @@ module.exports = {
}
},

/* Reconnect */

restart: 'reconnect',
reconnect: function (App) {
this.setLangFile(Lang_File);
if (!this.can('reconnect', this.room)) return this.replyAccessDenied('reconnect');
this.addToSecurityLog();
App.restartBot();
},

/* Custom send */

custom: function () {
Expand Down

0 comments on commit eada918

Please sign in to comment.