mirror of
https://github.com/ZeppelinBot/Zeppelin.git
synced 2025-03-16 22:21:51 +00:00
Merge branch 'knub30' into k30_pingableRoles
This commit is contained in:
commit
4bbf03c54e
15 changed files with 62 additions and 69 deletions
7
backend/package-lock.json
generated
7
backend/package-lock.json
generated
|
@ -2335,12 +2335,11 @@
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"knub": {
|
"knub": {
|
||||||
"version": "30.0.0-beta.10",
|
"version": "30.0.0-beta.11",
|
||||||
"resolved": "https://registry.npmjs.org/knub/-/knub-30.0.0-beta.10.tgz",
|
"resolved": "https://registry.npmjs.org/knub/-/knub-30.0.0-beta.11.tgz",
|
||||||
"integrity": "sha512-9Gn36+s0AoXXMi1gcH+fAyCJGLwQC+7zKNzEikRjUfMb3/bSDhwsZTTPtB47IURK11ejWWwdJB5UhM8Bj5xTrw==",
|
"integrity": "sha512-SH4MzOYPJ1wMPTyNFGCSaqES/MlISd6+Q1FQd/CR7WZGRf6w/pQxSfYtaLE7qveLIJMxCdXj9VlTTsi10XHzfg==",
|
||||||
"requires": {
|
"requires": {
|
||||||
"knub-command-manager": "^8.1.1",
|
"knub-command-manager": "^8.1.1",
|
||||||
"reflect-metadata": "^0.1.13",
|
|
||||||
"ts-essentials": "^6.0.7"
|
"ts-essentials": "^6.0.7"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
|
@ -34,7 +34,7 @@
|
||||||
"humanize-duration": "^3.15.0",
|
"humanize-duration": "^3.15.0",
|
||||||
"io-ts": "^2.0.0",
|
"io-ts": "^2.0.0",
|
||||||
"js-yaml": "^3.13.1",
|
"js-yaml": "^3.13.1",
|
||||||
"knub": "^30.0.0-beta.10",
|
"knub": "^30.0.0-beta.11",
|
||||||
"knub-command-manager": "^8.1.1",
|
"knub-command-manager": "^8.1.1",
|
||||||
"last-commit-log": "^2.1.0",
|
"last-commit-log": "^2.1.0",
|
||||||
"lodash.chunk": "^4.2.0",
|
"lodash.chunk": "^4.2.0",
|
||||||
|
|
|
@ -3,9 +3,9 @@ import { ConfigSchema, AutoReactionsPluginType } from "./types";
|
||||||
import { PluginOptions } from "knub";
|
import { PluginOptions } from "knub";
|
||||||
import { NewAutoReactionsCmd } from "./commands/NewAutoReactionsCmd";
|
import { NewAutoReactionsCmd } from "./commands/NewAutoReactionsCmd";
|
||||||
import { DisableAutoReactionsCmd } from "./commands/DisableAutoReactionsCmd";
|
import { DisableAutoReactionsCmd } from "./commands/DisableAutoReactionsCmd";
|
||||||
import { MessageCreateEvt } from "./events/MessageCreateEvt";
|
|
||||||
import { GuildSavedMessages } from "src/data/GuildSavedMessages";
|
import { GuildSavedMessages } from "src/data/GuildSavedMessages";
|
||||||
import { GuildAutoReactions } from "src/data/GuildAutoReactions";
|
import { GuildAutoReactions } from "src/data/GuildAutoReactions";
|
||||||
|
import { AddReactionsEvt } from "./events/AddReactionsEvt";
|
||||||
|
|
||||||
const defaultOptions: PluginOptions<AutoReactionsPluginType> = {
|
const defaultOptions: PluginOptions<AutoReactionsPluginType> = {
|
||||||
config: {
|
config: {
|
||||||
|
@ -33,7 +33,7 @@ export const AutoReactionsPlugin = zeppelinPlugin<AutoReactionsPluginType>()("au
|
||||||
|
|
||||||
// prettier-ignore
|
// prettier-ignore
|
||||||
events: [
|
events: [
|
||||||
MessageCreateEvt,
|
AddReactionsEvt,
|
||||||
],
|
],
|
||||||
|
|
||||||
onLoad(pluginData) {
|
onLoad(pluginData) {
|
||||||
|
|
|
@ -3,7 +3,7 @@ import { isDiscordRESTError } from "src/utils";
|
||||||
import { logger } from "knub";
|
import { logger } from "knub";
|
||||||
import { LogType } from "src/data/LogType";
|
import { LogType } from "src/data/LogType";
|
||||||
|
|
||||||
export const MessageCreateEvt = autoReactionsEvt({
|
export const AddReactionsEvt = autoReactionsEvt({
|
||||||
event: "messageCreate",
|
event: "messageCreate",
|
||||||
allowOutsideOfGuild: false,
|
allowOutsideOfGuild: false,
|
||||||
|
|
|
@ -7,9 +7,8 @@ import { fillActiveAlertsList } from "./utils/fillAlertsList";
|
||||||
import { WhereCmd } from "./commands/WhereCmd";
|
import { WhereCmd } from "./commands/WhereCmd";
|
||||||
import { FollowCmd } from "./commands/FollowCmd";
|
import { FollowCmd } from "./commands/FollowCmd";
|
||||||
import { ListFollowCmd, DeleteFollowCmd } from "./commands/ListFollowCmd";
|
import { ListFollowCmd, DeleteFollowCmd } from "./commands/ListFollowCmd";
|
||||||
import { ChannelJoinEvt, ChannelSwitchEvt } from "./events/ChannelJoinEvt";
|
import { ChannelJoinAlertsEvt, ChannelSwitchAlertsEvt, ChannelLeaveAlertsEvt } from "./events/SendAlertsEvts";
|
||||||
import { ChannelLeaveEvt } from "./events/ChannelLeaveEvt";
|
import { GuildBanRemoveAlertsEvt } from "./events/BanRemoveAlertsEvt";
|
||||||
import { GuildBanAddEvt } from "./events/GuildBanAddEvt";
|
|
||||||
|
|
||||||
const defaultOptions: PluginOptions<LocateUserPluginType> = {
|
const defaultOptions: PluginOptions<LocateUserPluginType> = {
|
||||||
config: {
|
config: {
|
||||||
|
@ -41,10 +40,10 @@ export const LocateUserPlugin = zeppelinPlugin<LocateUserPluginType>()("locate_u
|
||||||
|
|
||||||
// prettier-ignore
|
// prettier-ignore
|
||||||
events: [
|
events: [
|
||||||
ChannelJoinEvt,
|
ChannelJoinAlertsEvt,
|
||||||
ChannelSwitchEvt,
|
ChannelSwitchAlertsEvt,
|
||||||
ChannelLeaveEvt,
|
ChannelLeaveAlertsEvt,
|
||||||
GuildBanAddEvt
|
GuildBanRemoveAlertsEvt
|
||||||
],
|
],
|
||||||
|
|
||||||
onLoad(pluginData) {
|
onLoad(pluginData) {
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
import { locateUserEvent } from "../types";
|
import { locateUserEvent } from "../types";
|
||||||
|
|
||||||
export const GuildBanAddEvt = locateUserEvent({
|
export const GuildBanRemoveAlertsEvt = locateUserEvent({
|
||||||
event: "guildBanAdd",
|
event: "guildBanAdd",
|
||||||
|
|
||||||
async listener(meta) {
|
async listener(meta) {
|
|
@ -1,22 +0,0 @@
|
||||||
import { locateUserEvent } from "../types";
|
|
||||||
import { sendAlerts } from "../utils/sendAlerts";
|
|
||||||
|
|
||||||
export const ChannelJoinEvt = locateUserEvent({
|
|
||||||
event: "voiceChannelJoin",
|
|
||||||
|
|
||||||
async listener(meta) {
|
|
||||||
if (meta.pluginData.state.usersWithAlerts.includes(meta.args.member.id)) {
|
|
||||||
sendAlerts(meta.pluginData, meta.args.member.id);
|
|
||||||
}
|
|
||||||
},
|
|
||||||
});
|
|
||||||
|
|
||||||
export const ChannelSwitchEvt = locateUserEvent({
|
|
||||||
event: "voiceChannelSwitch",
|
|
||||||
|
|
||||||
async listener(meta) {
|
|
||||||
if (meta.pluginData.state.usersWithAlerts.includes(meta.args.member.id)) {
|
|
||||||
sendAlerts(meta.pluginData, meta.args.member.id);
|
|
||||||
}
|
|
||||||
},
|
|
||||||
});
|
|
|
@ -2,7 +2,27 @@ import { locateUserEvent } from "../types";
|
||||||
import { sendAlerts } from "../utils/sendAlerts";
|
import { sendAlerts } from "../utils/sendAlerts";
|
||||||
import { VoiceChannel, TextableChannel } from "eris";
|
import { VoiceChannel, TextableChannel } from "eris";
|
||||||
|
|
||||||
export const ChannelLeaveEvt = locateUserEvent({
|
export const ChannelJoinAlertsEvt = locateUserEvent({
|
||||||
|
event: "voiceChannelJoin",
|
||||||
|
|
||||||
|
async listener(meta) {
|
||||||
|
if (meta.pluginData.state.usersWithAlerts.includes(meta.args.member.id)) {
|
||||||
|
sendAlerts(meta.pluginData, meta.args.member.id);
|
||||||
|
}
|
||||||
|
},
|
||||||
|
});
|
||||||
|
|
||||||
|
export const ChannelSwitchAlertsEvt = locateUserEvent({
|
||||||
|
event: "voiceChannelSwitch",
|
||||||
|
|
||||||
|
async listener(meta) {
|
||||||
|
if (meta.pluginData.state.usersWithAlerts.includes(meta.args.member.id)) {
|
||||||
|
sendAlerts(meta.pluginData, meta.args.member.id);
|
||||||
|
}
|
||||||
|
},
|
||||||
|
});
|
||||||
|
|
||||||
|
export const ChannelLeaveAlertsEvt = locateUserEvent({
|
||||||
event: "voiceChannelLeave",
|
event: "voiceChannelLeave",
|
||||||
|
|
||||||
async listener(meta) {
|
async listener(meta) {
|
|
@ -2,14 +2,13 @@ import { zeppelinPlugin } from "../ZeppelinPluginBlueprint";
|
||||||
import { UsernameHistory } from "src/data/UsernameHistory";
|
import { UsernameHistory } from "src/data/UsernameHistory";
|
||||||
import { Queue } from "src/Queue";
|
import { Queue } from "src/Queue";
|
||||||
import { UsernameSaverPluginType } from "./types";
|
import { UsernameSaverPluginType } from "./types";
|
||||||
import { MessageCreateEvt } from "./events/MessageCreateEvt";
|
import { MessageCreateUpdateUsernameEvt, VoiceChannelJoinUpdateUsernameEvt } from "./events/UpdateUsernameEvts";
|
||||||
import { VoiceChannelJoinEvt } from "./events/VoiceChannelJoinEvt";
|
|
||||||
|
|
||||||
export const UsernameSaverPlugin = zeppelinPlugin<UsernameSaverPluginType>()("username_saver", {
|
export const UsernameSaverPlugin = zeppelinPlugin<UsernameSaverPluginType>()("username_saver", {
|
||||||
// prettier-ignore
|
// prettier-ignore
|
||||||
events: [
|
events: [
|
||||||
MessageCreateEvt,
|
MessageCreateUpdateUsernameEvt,
|
||||||
VoiceChannelJoinEvt,
|
VoiceChannelJoinUpdateUsernameEvt,
|
||||||
],
|
],
|
||||||
|
|
||||||
onLoad(pluginData) {
|
onLoad(pluginData) {
|
||||||
|
|
|
@ -1,11 +0,0 @@
|
||||||
import { usernameEvent } from "../types";
|
|
||||||
import { updateUsername } from "../updateUsername";
|
|
||||||
|
|
||||||
export const MessageCreateEvt = usernameEvent({
|
|
||||||
event: "messageCreate",
|
|
||||||
|
|
||||||
async listener(meta) {
|
|
||||||
if (meta.args.message.author.bot) return;
|
|
||||||
meta.pluginData.state.updateQueue.add(() => updateUsername(meta.pluginData, meta.args.message.author));
|
|
||||||
},
|
|
||||||
});
|
|
|
@ -0,0 +1,20 @@
|
||||||
|
import { usernameEvent } from "../types";
|
||||||
|
import { updateUsername } from "../updateUsername";
|
||||||
|
|
||||||
|
export const MessageCreateUpdateUsernameEvt = usernameEvent({
|
||||||
|
event: "messageCreate",
|
||||||
|
|
||||||
|
async listener(meta) {
|
||||||
|
if (meta.args.message.author.bot) return;
|
||||||
|
meta.pluginData.state.updateQueue.add(() => updateUsername(meta.pluginData, meta.args.message.author));
|
||||||
|
},
|
||||||
|
});
|
||||||
|
|
||||||
|
export const VoiceChannelJoinUpdateUsernameEvt = usernameEvent({
|
||||||
|
event: "voiceChannelJoin",
|
||||||
|
|
||||||
|
async listener(meta) {
|
||||||
|
if (meta.args.member.bot) return;
|
||||||
|
meta.pluginData.state.updateQueue.add(() => updateUsername(meta.pluginData, meta.args.member.user));
|
||||||
|
},
|
||||||
|
});
|
|
@ -1,11 +0,0 @@
|
||||||
import { usernameEvent } from "../types";
|
|
||||||
import { updateUsername } from "../updateUsername";
|
|
||||||
|
|
||||||
export const VoiceChannelJoinEvt = usernameEvent({
|
|
||||||
event: "voiceChannelJoin",
|
|
||||||
|
|
||||||
async listener(meta) {
|
|
||||||
if (meta.args.member.bot) return;
|
|
||||||
meta.pluginData.state.updateQueue.add(() => updateUsername(meta.pluginData, meta.args.member.user));
|
|
||||||
},
|
|
||||||
});
|
|
|
@ -2,7 +2,7 @@ import { zeppelinPlugin } from "../ZeppelinPluginBlueprint";
|
||||||
import { PluginOptions } from "knub";
|
import { PluginOptions } from "knub";
|
||||||
import { WelcomeMessagePluginType, ConfigSchema } from "./types";
|
import { WelcomeMessagePluginType, ConfigSchema } from "./types";
|
||||||
import { GuildLogs } from "src/data/GuildLogs";
|
import { GuildLogs } from "src/data/GuildLogs";
|
||||||
import { GuildMemberAddEvt } from "./events/GuildMemberAddEvt";
|
import { SendWelcomeMessageEvt } from "./events/SendWelcomeMessageEvt";
|
||||||
|
|
||||||
const defaultOptions: PluginOptions<WelcomeMessagePluginType> = {
|
const defaultOptions: PluginOptions<WelcomeMessagePluginType> = {
|
||||||
config: {
|
config: {
|
||||||
|
@ -18,7 +18,7 @@ export const WelcomeMessagePlugin = zeppelinPlugin<WelcomeMessagePluginType>()("
|
||||||
|
|
||||||
// prettier-ignore
|
// prettier-ignore
|
||||||
events: [
|
events: [
|
||||||
GuildMemberAddEvt,
|
SendWelcomeMessageEvt,
|
||||||
],
|
],
|
||||||
|
|
||||||
onLoad(pluginData) {
|
onLoad(pluginData) {
|
||||||
|
|
|
@ -4,7 +4,7 @@ import { stripObjectToScalars, createChunkedMessage } from "src/utils";
|
||||||
import { LogType } from "src/data/LogType";
|
import { LogType } from "src/data/LogType";
|
||||||
import { TextChannel } from "eris";
|
import { TextChannel } from "eris";
|
||||||
|
|
||||||
export const GuildMemberAddEvt = welcomeEvent({
|
export const SendWelcomeMessageEvt = welcomeEvent({
|
||||||
event: "guildMemberAdd",
|
event: "guildMemberAdd",
|
||||||
|
|
||||||
async listener(meta) {
|
async listener(meta) {
|
|
@ -16,8 +16,8 @@ export const guildPlugins: Array<ZeppelinPluginBlueprint<any>> = [
|
||||||
LocateUserPlugin,
|
LocateUserPlugin,
|
||||||
PersistPlugin,
|
PersistPlugin,
|
||||||
PingableRolesPlugin,
|
PingableRolesPlugin,
|
||||||
NameHistoryPlugin,
|
|
||||||
MessageSaverPlugin,
|
MessageSaverPlugin,
|
||||||
|
NameHistoryPlugin,
|
||||||
RemindersPlugin,
|
RemindersPlugin,
|
||||||
UsernameSaverPlugin,
|
UsernameSaverPlugin,
|
||||||
UtilityPlugin,
|
UtilityPlugin,
|
||||||
|
|
Loading…
Add table
Reference in a new issue