3
0
Fork 0
mirror of https://github.com/ZeppelinBot/Zeppelin.git synced 2025-05-21 00:35:02 +00:00

feat: added membercount command

This commit is contained in:
Almeida 2021-05-16 11:01:21 +01:00
parent 459020eab7
commit 796d900adb
3 changed files with 18 additions and 0 deletions

View file

@ -38,6 +38,7 @@ import { ModActionsPlugin } from "../ModActions/ModActionsPlugin";
import { refreshMembersIfNeeded } from "./refreshMembers"; import { refreshMembersIfNeeded } from "./refreshMembers";
import { RoleInfoCmd } from "./commands/RoleInfoCmd"; import { RoleInfoCmd } from "./commands/RoleInfoCmd";
import { EmojiInfoCmd } from "./commands/EmojiInfoCmd"; import { EmojiInfoCmd } from "./commands/EmojiInfoCmd";
import { MemberCountCmd } from "./commands/MemberCountCmd";
const defaultOptions: PluginOptions<UtilityPluginType> = { const defaultOptions: PluginOptions<UtilityPluginType> = {
config: { config: {
@ -67,6 +68,7 @@ const defaultOptions: PluginOptions<UtilityPluginType> = {
jumbo_size: 128, jumbo_size: 128,
can_avatar: false, can_avatar: false,
info_on_single_result: true, info_on_single_result: true,
can_membercount: false,
}, },
overrides: [ overrides: [
{ {
@ -93,6 +95,7 @@ const defaultOptions: PluginOptions<UtilityPluginType> = {
can_jumbo: true, can_jumbo: true,
can_avatar: true, can_avatar: true,
can_source: true, can_source: true,
can_membercount: true,
}, },
}, },
{ {
@ -145,6 +148,7 @@ export const UtilityPlugin = zeppelinGuildPlugin<UtilityPluginType>()("utility",
SnowflakeInfoCmd, SnowflakeInfoCmd,
RoleInfoCmd, RoleInfoCmd,
EmojiInfoCmd, EmojiInfoCmd,
MemberCountCmd,
], ],
onLoad(pluginData) { onLoad(pluginData) {

View 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**`);
},
});

View file

@ -34,6 +34,7 @@ export const ConfigSchema = t.type({
jumbo_size: t.Integer, jumbo_size: t.Integer,
can_avatar: t.boolean, can_avatar: t.boolean,
info_on_single_result: t.boolean, info_on_single_result: t.boolean,
can_membercount: t.boolean,
}); });
export type TConfigSchema = t.TypeOf<typeof ConfigSchema>; export type TConfigSchema = t.TypeOf<typeof ConfigSchema>;