BotControl: add cmd to refresh reaction roles globally
This commit is contained in:
parent
ddcc56d0ba
commit
b462868c32
1 changed files with 16 additions and 2 deletions
|
@ -2,6 +2,7 @@ import { decorators as d, GlobalPlugin } from "knub";
|
||||||
import child_process from "child_process";
|
import child_process from "child_process";
|
||||||
import { GuildChannel, Message, TextChannel } from "eris";
|
import { GuildChannel, Message, TextChannel } from "eris";
|
||||||
import { errorMessage, sleep, successMessage } from "../utils";
|
import { errorMessage, sleep, successMessage } from "../utils";
|
||||||
|
import { ReactionRolesPlugin } from "./ReactionRoles";
|
||||||
|
|
||||||
let activeReload: [string, string] = null;
|
let activeReload: [string, string] = null;
|
||||||
|
|
||||||
|
@ -14,8 +15,8 @@ export class BotControlPlugin extends GlobalPlugin {
|
||||||
getDefaultOptions() {
|
getDefaultOptions() {
|
||||||
return {
|
return {
|
||||||
config: {
|
config: {
|
||||||
owners: []
|
owners: [],
|
||||||
}
|
},
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -81,4 +82,17 @@ export class BotControlPlugin extends GlobalPlugin {
|
||||||
msg.channel.createMessage(errorMessage("No performance data"));
|
msg.channel.createMessage(errorMessage("No performance data"));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@d.command("refresh_reaction_roles_globally")
|
||||||
|
async refreshAllReactionRolesCmd(msg: Message) {
|
||||||
|
if (!this.isOwner(msg.author.id)) return;
|
||||||
|
|
||||||
|
const guilds = this.knub.getLoadedGuilds();
|
||||||
|
for (const guild of guilds) {
|
||||||
|
if (guild.loadedPlugins.has("reaction_roles")) {
|
||||||
|
const rrPlugin = guild.loadedPlugins.get("reaction_roles") as ReactionRolesPlugin;
|
||||||
|
rrPlugin.runAutoRefresh();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue