mirror of
https://github.com/ZeppelinBot/Zeppelin.git
synced 2025-03-15 05:41:51 +00:00
knub commands => messageCommands
Signed-off-by: GitHub <noreply@github.com>
This commit is contained in:
parent
1dca8c4447
commit
cd68a6083c
26 changed files with 37 additions and 35 deletions
|
@ -42,7 +42,7 @@ export const AutoReactionsPlugin = zeppelinGuildPlugin<AutoReactionsPluginType>(
|
|||
defaultOptions,
|
||||
|
||||
// prettier-ignore
|
||||
commands: [
|
||||
messageCommands: [
|
||||
NewAutoReactionsCmd,
|
||||
DisableAutoReactionsCmd,
|
||||
],
|
||||
|
|
|
@ -218,7 +218,7 @@ export const AutomodPlugin = zeppelinGuildPlugin<AutomodPluginType>()({
|
|||
// Messages use message events from SavedMessages, see onLoad below
|
||||
],
|
||||
|
||||
commands: [AntiraidClearCmd, SetAntiraidCmd, ViewAntiraidCmd],
|
||||
messageCommands: [AntiraidClearCmd, SetAntiraidCmd, ViewAntiraidCmd],
|
||||
|
||||
async beforeLoad(pluginData) {
|
||||
pluginData.state.queue = new Queue();
|
||||
|
|
|
@ -41,7 +41,7 @@ export const BotControlPlugin = zeppelinGlobalPlugin<BotControlPluginType>()({
|
|||
defaultOptions,
|
||||
|
||||
// prettier-ignore
|
||||
commands: [
|
||||
messageCommands: [
|
||||
ReloadGlobalPluginsCmd,
|
||||
ServersCmd,
|
||||
LeaveServerCmd,
|
||||
|
|
|
@ -12,7 +12,7 @@ export const ChannelArchiverPlugin = zeppelinGuildPlugin<ChannelArchiverPluginTy
|
|||
configSchema: t.type({}),
|
||||
|
||||
// prettier-ignore
|
||||
commands: [
|
||||
messageCommands: [
|
||||
ArchiveChannelCmd,
|
||||
],
|
||||
});
|
||||
|
|
|
@ -136,7 +136,7 @@ export const CountersPlugin = zeppelinGuildPlugin<CountersPluginType>()({
|
|||
},
|
||||
|
||||
// prettier-ignore
|
||||
commands: [
|
||||
messageCommands: [
|
||||
CountersListCmd,
|
||||
ViewCounterCmd,
|
||||
AddCounterCmd,
|
||||
|
|
|
@ -44,7 +44,7 @@ export const LocateUserPlugin = zeppelinGuildPlugin<LocateUserPluginType>()({
|
|||
defaultOptions,
|
||||
|
||||
// prettier-ignore
|
||||
commands: [
|
||||
messageCommands: [
|
||||
WhereCmd,
|
||||
FollowCmd,
|
||||
ListFollowCmd,
|
||||
|
|
|
@ -28,7 +28,7 @@ export const MessageSaverPlugin = zeppelinGuildPlugin<MessageSaverPluginType>()(
|
|||
defaultOptions,
|
||||
|
||||
// prettier-ignore
|
||||
commands: [
|
||||
messageCommands: [
|
||||
SaveMessagesToDBCmd,
|
||||
SavePinsToDBCmd,
|
||||
],
|
||||
|
|
|
@ -128,7 +128,7 @@ export const ModActionsPlugin = zeppelinGuildPlugin<ModActionsPluginType>()({
|
|||
|
||||
events: [CreateBanCaseOnManualBanEvt, CreateUnbanCaseOnManualUnbanEvt, PostAlertOnMemberJoinEvt],
|
||||
|
||||
commands: [
|
||||
messageCommands: [
|
||||
UpdateCmd,
|
||||
NoteCmd,
|
||||
WarnCmd,
|
||||
|
|
|
@ -72,7 +72,7 @@ export const MutesPlugin = zeppelinGuildPlugin<MutesPluginType>()({
|
|||
defaultOptions,
|
||||
|
||||
// prettier-ignore
|
||||
commands: [
|
||||
messageCommands: [
|
||||
MutesCmd,
|
||||
ClearBannedMutesCmd,
|
||||
ClearMutesWithoutRoleCmd,
|
||||
|
|
|
@ -28,7 +28,7 @@ export const NameHistoryPlugin = zeppelinGuildPlugin<NameHistoryPluginType>()({
|
|||
defaultOptions,
|
||||
|
||||
// prettier-ignore
|
||||
commands: [
|
||||
messageCommands: [
|
||||
NamesCmd,
|
||||
],
|
||||
|
||||
|
|
|
@ -30,7 +30,7 @@ export const PingableRolesPlugin = zeppelinGuildPlugin<PingableRolesPluginType>(
|
|||
defaultOptions,
|
||||
|
||||
// prettier-ignore
|
||||
commands: [
|
||||
messageCommands: [
|
||||
PingableRoleEnableCmd,
|
||||
PingableRoleDisableCmd,
|
||||
],
|
||||
|
|
|
@ -42,7 +42,7 @@ export const PostPlugin = zeppelinGuildPlugin<PostPluginType>()({
|
|||
defaultOptions,
|
||||
|
||||
// prettier-ignore
|
||||
commands: [
|
||||
messageCommands: [
|
||||
PostCmd,
|
||||
PostEmbedCmd,
|
||||
EditCmd,
|
||||
|
|
|
@ -46,7 +46,7 @@ export const ReactionRolesPlugin = zeppelinGuildPlugin<ReactionRolesPluginType>(
|
|||
defaultOptions,
|
||||
|
||||
// prettier-ignore
|
||||
commands: [
|
||||
messageCommands: [
|
||||
RefreshReactionRolesCmd,
|
||||
ClearReactionRolesCmd,
|
||||
InitReactionRolesCmd,
|
||||
|
|
|
@ -35,7 +35,7 @@ export const RemindersPlugin = zeppelinGuildPlugin<RemindersPluginType>()({
|
|||
defaultOptions,
|
||||
|
||||
// prettier-ignore
|
||||
commands: [
|
||||
messageCommands: [
|
||||
RemindCmd,
|
||||
RemindersCmd,
|
||||
RemindersDeleteCmd,
|
||||
|
|
|
@ -73,7 +73,7 @@ export const RoleButtonsPlugin = zeppelinGuildPlugin<RoleButtonsPluginType>()({
|
|||
|
||||
events: [onButtonInteraction],
|
||||
|
||||
commands: [resetButtonsCmd],
|
||||
messageCommands: [resetButtonsCmd],
|
||||
|
||||
beforeLoad(pluginData) {
|
||||
pluginData.state.roleButtons = GuildRoleButtons.getGuildInstance(pluginData.guild.id);
|
||||
|
|
|
@ -46,7 +46,7 @@ export const RolesPlugin = zeppelinGuildPlugin<RolesPluginType>()({
|
|||
defaultOptions,
|
||||
|
||||
// prettier-ignore
|
||||
commands: [
|
||||
messageCommands: [
|
||||
AddRoleCmd,
|
||||
RemoveRoleCmd,
|
||||
MassAddRoleCmd,
|
||||
|
|
|
@ -29,7 +29,7 @@ export const SelfGrantableRolesPlugin = zeppelinGuildPlugin<SelfGrantableRolesPl
|
|||
### Basic configuration
|
||||
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.
|
||||
|
||||
|
||||
~~~yml
|
||||
self_grantable_roles:
|
||||
config:
|
||||
|
@ -46,10 +46,10 @@ export const SelfGrantableRolesPlugin = zeppelinGuildPlugin<SelfGrantableRolesPl
|
|||
basic:
|
||||
can_use: true
|
||||
~~~
|
||||
|
||||
|
||||
### Maximum number of roles
|
||||
This is identical to the basic example above, but users can only choose 1 role.
|
||||
|
||||
|
||||
~~~yml
|
||||
self_grantable_roles:
|
||||
config:
|
||||
|
@ -88,7 +88,7 @@ export const SelfGrantableRolesPlugin = zeppelinGuildPlugin<SelfGrantableRolesPl
|
|||
},
|
||||
|
||||
// prettier-ignore
|
||||
commands: [
|
||||
messageCommands: [
|
||||
RoleHelpCmd,
|
||||
RoleRemoveCmd,
|
||||
RoleAddCmd,
|
||||
|
|
|
@ -51,7 +51,7 @@ export const SlowmodePlugin = zeppelinGuildPlugin<SlowmodePluginType>()({
|
|||
defaultOptions,
|
||||
|
||||
// prettier-ignore
|
||||
commands: [
|
||||
messageCommands: [
|
||||
SlowmodeDisableCmd,
|
||||
SlowmodeClearCmd,
|
||||
SlowmodeListCmd,
|
||||
|
|
|
@ -135,7 +135,7 @@ export const StarboardPlugin = zeppelinGuildPlugin<StarboardPluginType>()({
|
|||
},
|
||||
|
||||
// prettier-ignore
|
||||
commands: [
|
||||
messageCommands: [
|
||||
MigratePinsCmd,
|
||||
],
|
||||
|
||||
|
|
|
@ -68,7 +68,7 @@ export const TagsPlugin = zeppelinGuildPlugin<TagsPluginType>()({
|
|||
You use them by adding a \`{}\` on your tag.
|
||||
|
||||
Here are the functions you can use in your tags:
|
||||
|
||||
|
||||
${generateTemplateMarkdown(TemplateFunctions)}
|
||||
`),
|
||||
},
|
||||
|
@ -78,7 +78,7 @@ export const TagsPlugin = zeppelinGuildPlugin<TagsPluginType>()({
|
|||
defaultOptions,
|
||||
|
||||
// prettier-ignore
|
||||
commands: [
|
||||
messageCommands: [
|
||||
TagEvalCmd,
|
||||
TagDeleteCmd,
|
||||
TagListCmd,
|
||||
|
|
|
@ -45,7 +45,7 @@ export const TimeAndDatePlugin = zeppelinGuildPlugin<TimeAndDatePluginType>()({
|
|||
defaultOptions,
|
||||
|
||||
// prettier-ignore
|
||||
commands: [
|
||||
messageCommands: [
|
||||
ResetTimezoneCmd,
|
||||
SetTimezoneCmd,
|
||||
ViewTimezoneCmd,
|
||||
|
|
|
@ -124,7 +124,7 @@ export const UtilityPlugin = zeppelinGuildPlugin<UtilityPluginType>()({
|
|||
defaultOptions,
|
||||
|
||||
// prettier-ignore
|
||||
commands: [
|
||||
messageCommands: [
|
||||
SearchCmd,
|
||||
BanSearchCmd,
|
||||
UserInfoCmd,
|
||||
|
|
|
@ -24,7 +24,7 @@ export const HelpCmd = utilityCmd({
|
|||
|
||||
const guildData = pluginData.getKnubInstance().getLoadedGuild(pluginData.guild.id)!;
|
||||
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 trigger of registeredCommand.originalTriggers) {
|
||||
const strTrigger = typeof trigger === "string" ? trigger : trigger.source;
|
||||
|
|
|
@ -45,10 +45,10 @@
|
|||
<MarkdownBlock :content="data.info.usageGuide" class="content" />
|
||||
</div>
|
||||
|
||||
<!-- Command list -->
|
||||
<div v-if="data.commands.length">
|
||||
<h3 id="commands" class="text-2xl">Commands</h3>
|
||||
<div v-for="command in data.commands"
|
||||
<!-- Message Command list -->
|
||||
<div v-if="data.messageCommands.length">
|
||||
<h3 id="commands" class="text-2xl">Message Commands</h3>
|
||||
<div v-for="command in data.messageCommands"
|
||||
class="command mb-4"
|
||||
v-bind:ref="getCommandSlug(command)" v-bind:class="{target: targetCommandId === getCommandSlug(command)}">
|
||||
<h4 class="text-xl font-semibold mb-0">
|
||||
|
@ -309,7 +309,8 @@
|
|||
},
|
||||
hasUsageInfo() {
|
||||
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;
|
||||
return false;
|
||||
},
|
||||
|
|
|
@ -34,8 +34,8 @@ export const DocsStore: Module<DocsState, RootState> = {
|
|||
if (state.plugins[name]) return;
|
||||
|
||||
const data = await get(`docs/plugins/${name}`);
|
||||
if (data && data.commands) {
|
||||
data.commands.sort((a, b) => {
|
||||
if (data && data.messageCommands) {
|
||||
data.messageCommands.sort((a, b) => {
|
||||
const aName = (Array.isArray(a.trigger) ? a.trigger[0] : a.trigger).toLowerCase();
|
||||
const bName = (Array.isArray(b.trigger) ? b.trigger[0] : b.trigger).toLowerCase();
|
||||
if (aName > bName) return 1;
|
||||
|
|
|
@ -54,7 +54,8 @@ export interface ThinDocsPlugin {
|
|||
}
|
||||
|
||||
export interface DocsPlugin extends ThinDocsPlugin {
|
||||
commands: any[];
|
||||
messageCommands: any[];
|
||||
slashCommands: any[];
|
||||
defaultOptions: any;
|
||||
configSchema?: string;
|
||||
info: {
|
||||
|
|
Loading…
Add table
Reference in a new issue