3
0
Fork 0
mirror of https://github.com/ZeppelinBot/Zeppelin.git synced 2025-03-16 14:11:50 +00:00

knub commands => messageCommands

Signed-off-by: GitHub <noreply@github.com>
This commit is contained in:
metal 2023-03-11 23:58:12 +00:00 committed by GitHub
parent 1dca8c4447
commit cd68a6083c
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
26 changed files with 37 additions and 35 deletions

View file

@ -42,7 +42,7 @@ export const AutoReactionsPlugin = zeppelinGuildPlugin<AutoReactionsPluginType>(
defaultOptions, defaultOptions,
// prettier-ignore // prettier-ignore
commands: [ messageCommands: [
NewAutoReactionsCmd, NewAutoReactionsCmd,
DisableAutoReactionsCmd, DisableAutoReactionsCmd,
], ],

View file

@ -218,7 +218,7 @@ export const AutomodPlugin = zeppelinGuildPlugin<AutomodPluginType>()({
// Messages use message events from SavedMessages, see onLoad below // Messages use message events from SavedMessages, see onLoad below
], ],
commands: [AntiraidClearCmd, SetAntiraidCmd, ViewAntiraidCmd], messageCommands: [AntiraidClearCmd, SetAntiraidCmd, ViewAntiraidCmd],
async beforeLoad(pluginData) { async beforeLoad(pluginData) {
pluginData.state.queue = new Queue(); pluginData.state.queue = new Queue();

View file

@ -41,7 +41,7 @@ export const BotControlPlugin = zeppelinGlobalPlugin<BotControlPluginType>()({
defaultOptions, defaultOptions,
// prettier-ignore // prettier-ignore
commands: [ messageCommands: [
ReloadGlobalPluginsCmd, ReloadGlobalPluginsCmd,
ServersCmd, ServersCmd,
LeaveServerCmd, LeaveServerCmd,

View file

@ -12,7 +12,7 @@ export const ChannelArchiverPlugin = zeppelinGuildPlugin<ChannelArchiverPluginTy
configSchema: t.type({}), configSchema: t.type({}),
// prettier-ignore // prettier-ignore
commands: [ messageCommands: [
ArchiveChannelCmd, ArchiveChannelCmd,
], ],
}); });

View file

@ -136,7 +136,7 @@ export const CountersPlugin = zeppelinGuildPlugin<CountersPluginType>()({
}, },
// prettier-ignore // prettier-ignore
commands: [ messageCommands: [
CountersListCmd, CountersListCmd,
ViewCounterCmd, ViewCounterCmd,
AddCounterCmd, AddCounterCmd,

View file

@ -44,7 +44,7 @@ export const LocateUserPlugin = zeppelinGuildPlugin<LocateUserPluginType>()({
defaultOptions, defaultOptions,
// prettier-ignore // prettier-ignore
commands: [ messageCommands: [
WhereCmd, WhereCmd,
FollowCmd, FollowCmd,
ListFollowCmd, ListFollowCmd,

View file

@ -28,7 +28,7 @@ export const MessageSaverPlugin = zeppelinGuildPlugin<MessageSaverPluginType>()(
defaultOptions, defaultOptions,
// prettier-ignore // prettier-ignore
commands: [ messageCommands: [
SaveMessagesToDBCmd, SaveMessagesToDBCmd,
SavePinsToDBCmd, SavePinsToDBCmd,
], ],

View file

@ -128,7 +128,7 @@ export const ModActionsPlugin = zeppelinGuildPlugin<ModActionsPluginType>()({
events: [CreateBanCaseOnManualBanEvt, CreateUnbanCaseOnManualUnbanEvt, PostAlertOnMemberJoinEvt], events: [CreateBanCaseOnManualBanEvt, CreateUnbanCaseOnManualUnbanEvt, PostAlertOnMemberJoinEvt],
commands: [ messageCommands: [
UpdateCmd, UpdateCmd,
NoteCmd, NoteCmd,
WarnCmd, WarnCmd,

View file

@ -72,7 +72,7 @@ export const MutesPlugin = zeppelinGuildPlugin<MutesPluginType>()({
defaultOptions, defaultOptions,
// prettier-ignore // prettier-ignore
commands: [ messageCommands: [
MutesCmd, MutesCmd,
ClearBannedMutesCmd, ClearBannedMutesCmd,
ClearMutesWithoutRoleCmd, ClearMutesWithoutRoleCmd,

View file

@ -28,7 +28,7 @@ export const NameHistoryPlugin = zeppelinGuildPlugin<NameHistoryPluginType>()({
defaultOptions, defaultOptions,
// prettier-ignore // prettier-ignore
commands: [ messageCommands: [
NamesCmd, NamesCmd,
], ],

View file

@ -30,7 +30,7 @@ export const PingableRolesPlugin = zeppelinGuildPlugin<PingableRolesPluginType>(
defaultOptions, defaultOptions,
// prettier-ignore // prettier-ignore
commands: [ messageCommands: [
PingableRoleEnableCmd, PingableRoleEnableCmd,
PingableRoleDisableCmd, PingableRoleDisableCmd,
], ],

View file

@ -42,7 +42,7 @@ export const PostPlugin = zeppelinGuildPlugin<PostPluginType>()({
defaultOptions, defaultOptions,
// prettier-ignore // prettier-ignore
commands: [ messageCommands: [
PostCmd, PostCmd,
PostEmbedCmd, PostEmbedCmd,
EditCmd, EditCmd,

View file

@ -46,7 +46,7 @@ export const ReactionRolesPlugin = zeppelinGuildPlugin<ReactionRolesPluginType>(
defaultOptions, defaultOptions,
// prettier-ignore // prettier-ignore
commands: [ messageCommands: [
RefreshReactionRolesCmd, RefreshReactionRolesCmd,
ClearReactionRolesCmd, ClearReactionRolesCmd,
InitReactionRolesCmd, InitReactionRolesCmd,

View file

@ -35,7 +35,7 @@ export const RemindersPlugin = zeppelinGuildPlugin<RemindersPluginType>()({
defaultOptions, defaultOptions,
// prettier-ignore // prettier-ignore
commands: [ messageCommands: [
RemindCmd, RemindCmd,
RemindersCmd, RemindersCmd,
RemindersDeleteCmd, RemindersDeleteCmd,

View file

@ -73,7 +73,7 @@ export const RoleButtonsPlugin = zeppelinGuildPlugin<RoleButtonsPluginType>()({
events: [onButtonInteraction], events: [onButtonInteraction],
commands: [resetButtonsCmd], messageCommands: [resetButtonsCmd],
beforeLoad(pluginData) { beforeLoad(pluginData) {
pluginData.state.roleButtons = GuildRoleButtons.getGuildInstance(pluginData.guild.id); pluginData.state.roleButtons = GuildRoleButtons.getGuildInstance(pluginData.guild.id);

View file

@ -46,7 +46,7 @@ export const RolesPlugin = zeppelinGuildPlugin<RolesPluginType>()({
defaultOptions, defaultOptions,
// prettier-ignore // prettier-ignore
commands: [ messageCommands: [
AddRoleCmd, AddRoleCmd,
RemoveRoleCmd, RemoveRoleCmd,
MassAddRoleCmd, MassAddRoleCmd,

View file

@ -29,7 +29,7 @@ export const SelfGrantableRolesPlugin = zeppelinGuildPlugin<SelfGrantableRolesPl
### Basic configuration ### Basic configuration
In this example, users can add themselves platform roles on the channel 473087035574321152 by using the In this example, users can add themselves platform roles on the channel 473087035574321152 by using the
\`!role\` command. For example, \`!role pc ps4\` to add both the "pc" and "ps4" roles as specified below. \`!role\` command. For example, \`!role pc ps4\` to add both the "pc" and "ps4" roles as specified below.
~~~yml ~~~yml
self_grantable_roles: self_grantable_roles:
config: config:
@ -46,10 +46,10 @@ export const SelfGrantableRolesPlugin = zeppelinGuildPlugin<SelfGrantableRolesPl
basic: basic:
can_use: true can_use: true
~~~ ~~~
### Maximum number of roles ### Maximum number of roles
This is identical to the basic example above, but users can only choose 1 role. This is identical to the basic example above, but users can only choose 1 role.
~~~yml ~~~yml
self_grantable_roles: self_grantable_roles:
config: config:
@ -88,7 +88,7 @@ export const SelfGrantableRolesPlugin = zeppelinGuildPlugin<SelfGrantableRolesPl
}, },
// prettier-ignore // prettier-ignore
commands: [ messageCommands: [
RoleHelpCmd, RoleHelpCmd,
RoleRemoveCmd, RoleRemoveCmd,
RoleAddCmd, RoleAddCmd,

View file

@ -51,7 +51,7 @@ export const SlowmodePlugin = zeppelinGuildPlugin<SlowmodePluginType>()({
defaultOptions, defaultOptions,
// prettier-ignore // prettier-ignore
commands: [ messageCommands: [
SlowmodeDisableCmd, SlowmodeDisableCmd,
SlowmodeClearCmd, SlowmodeClearCmd,
SlowmodeListCmd, SlowmodeListCmd,

View file

@ -135,7 +135,7 @@ export const StarboardPlugin = zeppelinGuildPlugin<StarboardPluginType>()({
}, },
// prettier-ignore // prettier-ignore
commands: [ messageCommands: [
MigratePinsCmd, MigratePinsCmd,
], ],

View file

@ -68,7 +68,7 @@ export const TagsPlugin = zeppelinGuildPlugin<TagsPluginType>()({
You use them by adding a \`{}\` on your tag. You use them by adding a \`{}\` on your tag.
Here are the functions you can use in your tags: Here are the functions you can use in your tags:
${generateTemplateMarkdown(TemplateFunctions)} ${generateTemplateMarkdown(TemplateFunctions)}
`), `),
}, },
@ -78,7 +78,7 @@ export const TagsPlugin = zeppelinGuildPlugin<TagsPluginType>()({
defaultOptions, defaultOptions,
// prettier-ignore // prettier-ignore
commands: [ messageCommands: [
TagEvalCmd, TagEvalCmd,
TagDeleteCmd, TagDeleteCmd,
TagListCmd, TagListCmd,

View file

@ -45,7 +45,7 @@ export const TimeAndDatePlugin = zeppelinGuildPlugin<TimeAndDatePluginType>()({
defaultOptions, defaultOptions,
// prettier-ignore // prettier-ignore
commands: [ messageCommands: [
ResetTimezoneCmd, ResetTimezoneCmd,
SetTimezoneCmd, SetTimezoneCmd,
ViewTimezoneCmd, ViewTimezoneCmd,

View file

@ -124,7 +124,7 @@ export const UtilityPlugin = zeppelinGuildPlugin<UtilityPluginType>()({
defaultOptions, defaultOptions,
// prettier-ignore // prettier-ignore
commands: [ messageCommands: [
SearchCmd, SearchCmd,
BanSearchCmd, BanSearchCmd,
UserInfoCmd, UserInfoCmd,

View file

@ -24,7 +24,7 @@ export const HelpCmd = utilityCmd({
const guildData = pluginData.getKnubInstance().getLoadedGuild(pluginData.guild.id)!; const guildData = pluginData.getKnubInstance().getLoadedGuild(pluginData.guild.id)!;
for (const plugin of guildData.loadedPlugins.values()) { for (const plugin of guildData.loadedPlugins.values()) {
const registeredCommands = plugin.pluginData.commands.getAll(); const registeredCommands = plugin.pluginData.messageCommands.getAll();
for (const registeredCommand of registeredCommands) { for (const registeredCommand of registeredCommands) {
for (const trigger of registeredCommand.originalTriggers) { for (const trigger of registeredCommand.originalTriggers) {
const strTrigger = typeof trigger === "string" ? trigger : trigger.source; const strTrigger = typeof trigger === "string" ? trigger : trigger.source;

View file

@ -45,10 +45,10 @@
<MarkdownBlock :content="data.info.usageGuide" class="content" /> <MarkdownBlock :content="data.info.usageGuide" class="content" />
</div> </div>
<!-- Command list --> <!-- Message Command list -->
<div v-if="data.commands.length"> <div v-if="data.messageCommands.length">
<h3 id="commands" class="text-2xl">Commands</h3> <h3 id="commands" class="text-2xl">Message Commands</h3>
<div v-for="command in data.commands" <div v-for="command in data.messageCommands"
class="command mb-4" class="command mb-4"
v-bind:ref="getCommandSlug(command)" v-bind:class="{target: targetCommandId === getCommandSlug(command)}"> v-bind:ref="getCommandSlug(command)" v-bind:class="{target: targetCommandId === getCommandSlug(command)}">
<h4 class="text-xl font-semibold mb-0"> <h4 class="text-xl font-semibold mb-0">
@ -309,7 +309,8 @@
}, },
hasUsageInfo() { hasUsageInfo() {
if (!this.data) return true; if (!this.data) return true;
if (this.data.commands.length) return true; if (this.data.messageCommands.length) return true;
if (this.data.slashCommands.length) return true;
if (this.data.info.usageGuide) return true; if (this.data.info.usageGuide) return true;
return false; return false;
}, },

View file

@ -34,8 +34,8 @@ export const DocsStore: Module<DocsState, RootState> = {
if (state.plugins[name]) return; if (state.plugins[name]) return;
const data = await get(`docs/plugins/${name}`); const data = await get(`docs/plugins/${name}`);
if (data && data.commands) { if (data && data.messageCommands) {
data.commands.sort((a, b) => { data.messageCommands.sort((a, b) => {
const aName = (Array.isArray(a.trigger) ? a.trigger[0] : a.trigger).toLowerCase(); const aName = (Array.isArray(a.trigger) ? a.trigger[0] : a.trigger).toLowerCase();
const bName = (Array.isArray(b.trigger) ? b.trigger[0] : b.trigger).toLowerCase(); const bName = (Array.isArray(b.trigger) ? b.trigger[0] : b.trigger).toLowerCase();
if (aName > bName) return 1; if (aName > bName) return 1;

View file

@ -54,7 +54,8 @@ export interface ThinDocsPlugin {
} }
export interface DocsPlugin extends ThinDocsPlugin { export interface DocsPlugin extends ThinDocsPlugin {
commands: any[]; messageCommands: any[];
slashCommands: any[];
defaultOptions: any; defaultOptions: any;
configSchema?: string; configSchema?: string;
info: { info: {