Update to Knub30.0.0-beta.37 and Eris 0.15, first pass
This commit is contained in:
parent
84da543205
commit
f6be4f4af6
133 changed files with 6507 additions and 380 deletions
|
@ -106,7 +106,8 @@ const defaultOptions: PluginOptions<UtilityPluginType> = {
|
|||
],
|
||||
};
|
||||
|
||||
export const UtilityPlugin = zeppelinGuildPlugin<UtilityPluginType>()("utility", {
|
||||
export const UtilityPlugin = zeppelinGuildPlugin<UtilityPluginType>()({
|
||||
name: "utility",
|
||||
showInDocs: true,
|
||||
info: {
|
||||
prettyName: "Utility",
|
||||
|
@ -147,7 +148,7 @@ export const UtilityPlugin = zeppelinGuildPlugin<UtilityPluginType>()("utility",
|
|||
EmojiInfoCmd,
|
||||
],
|
||||
|
||||
onLoad(pluginData) {
|
||||
afterLoad(pluginData) {
|
||||
const { state, guild } = pluginData;
|
||||
|
||||
state.logs = new GuildLogs(guild.id);
|
||||
|
@ -181,7 +182,7 @@ export const UtilityPlugin = zeppelinGuildPlugin<UtilityPluginType>()("utility",
|
|||
}
|
||||
},
|
||||
|
||||
onUnload(pluginData) {
|
||||
beforeUnload(pluginData) {
|
||||
discardRegExpRunner(`guild-${pluginData.guild.id}`);
|
||||
},
|
||||
});
|
||||
|
|
|
@ -94,7 +94,7 @@ export const CleanCmd = utilityCmd({
|
|||
}
|
||||
|
||||
if (targetChannel.id !== msg.channel.id) {
|
||||
const configForTargetChannel = pluginData.config.getMatchingConfig({
|
||||
const configForTargetChannel = await pluginData.config.getMatchingConfig({
|
||||
userId: msg.author.id,
|
||||
member: msg.member,
|
||||
channelId: targetChannel.id,
|
||||
|
|
|
@ -29,7 +29,7 @@ export const InfoCmd = utilityCmd({
|
|||
|
||||
async run({ message, args, pluginData }) {
|
||||
const value = args.value || message.author.id;
|
||||
const userCfg = pluginData.config.getMatchingConfig({
|
||||
const userCfg = await pluginData.config.getMatchingConfig({
|
||||
member: message.member,
|
||||
channelId: message.channel.id,
|
||||
message,
|
||||
|
|
|
@ -145,7 +145,7 @@ export async function displaySearch(
|
|||
|
||||
const searchMsg = await searchMsgPromise;
|
||||
|
||||
const cfg = pluginData.config.getForUser(msg.author);
|
||||
const cfg = await pluginData.config.getForUser(msg.author);
|
||||
if (cfg.info_on_single_result && searchResult.totalResults === 1) {
|
||||
const embed = await getUserInfoEmbed(pluginData, searchResult.results[0].id, false);
|
||||
if (embed) {
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
import * as t from "io-ts";
|
||||
import { BasePluginType, guildCommand, guildEventListener } from "knub";
|
||||
import { BasePluginType, typedGuildCommand, typedGuildEventListener } from "knub";
|
||||
import { GuildLogs } from "../../data/GuildLogs";
|
||||
import { GuildCases } from "../../data/GuildCases";
|
||||
import { GuildSavedMessages } from "../../data/GuildSavedMessages";
|
||||
|
@ -51,5 +51,5 @@ export interface UtilityPluginType extends BasePluginType {
|
|||
};
|
||||
}
|
||||
|
||||
export const utilityCmd = guildCommand<UtilityPluginType>();
|
||||
export const utilityEvt = guildEventListener<UtilityPluginType>();
|
||||
export const utilityCmd = typedGuildCommand<UtilityPluginType>();
|
||||
export const utilityEvt = typedGuildEventListener<UtilityPluginType>();
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue