3
0
Fork 0
mirror of https://github.com/ZeppelinBot/Zeppelin.git synced 2025-05-12 04:55:01 +00:00

Add !slowmode command

This commit is contained in:
Dragory 2020-08-09 17:28:21 +03:00
parent 2d8decdb4f
commit 5215dd0738
No known key found for this signature in database
GPG key ID: 5F387BA66DF8AAC1
10 changed files with 122 additions and 2 deletions

View file

@ -2,7 +2,7 @@ import { utilityCmd } from "../types";
import { commandTypeHelpers as ct } from "../../../commandTypes";
import { sendErrorMessage } from "../../../pluginUtils";
import { getInviteInfoEmbed } from "../functions/getInviteInfoEmbed";
import { parseInviteCodeInput, resolveInvite, resolveUser } from "../../../utils";
import { isValidSnowflake, parseInviteCodeInput, resolveInvite, resolveUser } from "../../../utils";
import { getUserInfoEmbed } from "../functions/getUserInfoEmbed";
import { resolveMessageTarget } from "../../../utils/resolveMessageTarget";
import { canReadChannel } from "../../../utils/canReadChannel";
@ -11,6 +11,7 @@ import { getChannelInfoEmbed } from "../functions/getChannelInfoEmbed";
import { getServerInfoEmbed } from "../functions/getServerInfoEmbed";
import { getChannelId } from "knub/dist/utils";
import { getGuildPreview } from "../functions/getGuildPreview";
import { getSnowflakeInfoEmbed } from "../functions/getSnowflakeInfoEmbed";
export const InfoCmd = utilityCmd({
trigger: "info",
@ -93,6 +94,13 @@ export const InfoCmd = utilityCmd({
}
}
// 7. Arbitrary ID
if (isValidSnowflake(value)) {
const embed = getSnowflakeInfoEmbed(pluginData, value, true);
message.channel.createMessage({ embed });
return;
}
// 7. No can do
sendErrorMessage(pluginData, message.channel, "Could not find anything with that value");
},

View file

@ -0,0 +1,21 @@
import { utilityCmd } from "../types";
import { commandTypeHelpers as ct } from "../../../commandTypes";
import { sendErrorMessage } from "../../../pluginUtils";
import { getChannelInfoEmbed } from "../functions/getChannelInfoEmbed";
import { getSnowflakeInfoEmbed } from "../functions/getSnowflakeInfoEmbed";
export const SnowflakeInfoCmd = utilityCmd({
trigger: ["snowflake", "snowflakeinfo"],
description: "Show information about a snowflake ID",
usage: "!snowflake 534722016549404673",
permission: "can_snowflake",
signature: {
id: ct.anyId(),
},
run({ message, args, pluginData }) {
const embed = getSnowflakeInfoEmbed(pluginData, args.id);
message.channel.createMessage({ embed });
},
});