mirror of
https://github.com/ZeppelinBot/Zeppelin.git
synced 2025-05-20 16:25:03 +00:00
feat: added membercount command
This commit is contained in:
parent
459020eab7
commit
796d900adb
3 changed files with 18 additions and 0 deletions
|
@ -38,6 +38,7 @@ import { ModActionsPlugin } from "../ModActions/ModActionsPlugin";
|
|||
import { refreshMembersIfNeeded } from "./refreshMembers";
|
||||
import { RoleInfoCmd } from "./commands/RoleInfoCmd";
|
||||
import { EmojiInfoCmd } from "./commands/EmojiInfoCmd";
|
||||
import { MemberCountCmd } from "./commands/MemberCountCmd";
|
||||
|
||||
const defaultOptions: PluginOptions<UtilityPluginType> = {
|
||||
config: {
|
||||
|
@ -67,6 +68,7 @@ const defaultOptions: PluginOptions<UtilityPluginType> = {
|
|||
jumbo_size: 128,
|
||||
can_avatar: false,
|
||||
info_on_single_result: true,
|
||||
can_membercount: false,
|
||||
},
|
||||
overrides: [
|
||||
{
|
||||
|
@ -93,6 +95,7 @@ const defaultOptions: PluginOptions<UtilityPluginType> = {
|
|||
can_jumbo: true,
|
||||
can_avatar: true,
|
||||
can_source: true,
|
||||
can_membercount: true,
|
||||
},
|
||||
},
|
||||
{
|
||||
|
@ -145,6 +148,7 @@ export const UtilityPlugin = zeppelinGuildPlugin<UtilityPluginType>()("utility",
|
|||
SnowflakeInfoCmd,
|
||||
RoleInfoCmd,
|
||||
EmojiInfoCmd,
|
||||
MemberCountCmd,
|
||||
],
|
||||
|
||||
onLoad(pluginData) {
|
||||
|
|
13
backend/src/plugins/Utility/commands/MemberCountCmd.ts
Normal file
13
backend/src/plugins/Utility/commands/MemberCountCmd.ts
Normal file
|
@ -0,0 +1,13 @@
|
|||
import { utilityCmd } from "../types";
|
||||
|
||||
export const MemberCountCmd = utilityCmd({
|
||||
trigger: "membercount",
|
||||
description: "Show the amount of members in the server",
|
||||
usage: "!membercount",
|
||||
permission: "can_membercount",
|
||||
|
||||
async run({ message: msg, pluginData }) {
|
||||
const memberCount = pluginData.guild.memberCount.toLocaleString();
|
||||
msg.channel.createMessage(`This server has **${memberCount} members**`);
|
||||
},
|
||||
});
|
|
@ -34,6 +34,7 @@ export const ConfigSchema = t.type({
|
|||
jumbo_size: t.Integer,
|
||||
can_avatar: t.boolean,
|
||||
info_on_single_result: t.boolean,
|
||||
can_membercount: t.boolean,
|
||||
});
|
||||
export type TConfigSchema = t.TypeOf<typeof ConfigSchema>;
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue