mirror of
https://github.com/ZeppelinBot/Zeppelin.git
synced 2025-05-10 20:35:02 +00:00
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
|
@ -26,7 +26,8 @@ const defaultOptions: PluginOptions<StarboardPluginType> = {
|
|||
],
|
||||
};
|
||||
|
||||
export const StarboardPlugin = zeppelinGuildPlugin<StarboardPluginType>()("starboard", {
|
||||
export const StarboardPlugin = zeppelinGuildPlugin<StarboardPluginType>()({
|
||||
name: "starboard",
|
||||
showInDocs: true,
|
||||
|
||||
configSchema: ConfigSchema,
|
||||
|
@ -145,7 +146,7 @@ export const StarboardPlugin = zeppelinGuildPlugin<StarboardPluginType>()("starb
|
|||
StarboardReactionRemoveAllEvt,
|
||||
],
|
||||
|
||||
onLoad(pluginData) {
|
||||
afterLoad(pluginData) {
|
||||
const { state, guild } = pluginData;
|
||||
|
||||
state.savedMessages = GuildSavedMessages.getGuildInstance(guild.id);
|
||||
|
@ -156,7 +157,7 @@ export const StarboardPlugin = zeppelinGuildPlugin<StarboardPluginType>()("starb
|
|||
state.savedMessages.events.on("delete", state.onMessageDeleteFn);
|
||||
},
|
||||
|
||||
onUnload(pluginData) {
|
||||
beforeUnload(pluginData) {
|
||||
pluginData.state.savedMessages.events.off("delete", pluginData.state.onMessageDeleteFn);
|
||||
},
|
||||
});
|
||||
|
|
|
@ -31,7 +31,7 @@ export const StarboardReactionAddEvt = starboardEvt({
|
|||
const member = await resolveMember(pluginData.client, pluginData.guild, userId);
|
||||
if (!member || member.bot) return;
|
||||
|
||||
const config = pluginData.config.getMatchingConfig({
|
||||
const config = await pluginData.config.getMatchingConfig({
|
||||
member,
|
||||
channelId: msg.channel.id,
|
||||
categoryId: (msg.channel as TextChannel).parentID,
|
||||
|
|
|
@ -6,7 +6,7 @@ export const StarboardReactionRemoveEvt = starboardEvt({
|
|||
|
||||
async listener(meta) {
|
||||
const boardLock = await meta.pluginData.locks.acquire(allStarboardsLock());
|
||||
await meta.pluginData.state.starboardReactions.deleteStarboardReaction(meta.args.message.id, meta.args.member.id);
|
||||
await meta.pluginData.state.starboardReactions.deleteStarboardReaction(meta.args.message.id, meta.args.userID);
|
||||
boardLock.unlock();
|
||||
},
|
||||
});
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
import * as t from "io-ts";
|
||||
import { BasePluginType, guildCommand, guildEventListener } from "knub";
|
||||
import { BasePluginType, typedGuildCommand, typedGuildEventListener } from "knub";
|
||||
import { tNullable, tDeepPartial } from "../../utils";
|
||||
import { GuildSavedMessages } from "../../data/GuildSavedMessages";
|
||||
import { GuildStarboardMessages } from "../../data/GuildStarboardMessages";
|
||||
|
@ -43,5 +43,5 @@ export interface StarboardPluginType extends BasePluginType {
|
|||
};
|
||||
}
|
||||
|
||||
export const starboardCmd = guildCommand<StarboardPluginType>();
|
||||
export const starboardEvt = guildEventListener<StarboardPluginType>();
|
||||
export const starboardCmd = typedGuildCommand<StarboardPluginType>();
|
||||
export const starboardEvt = typedGuildEventListener<StarboardPluginType>();
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue