mirror of
https://github.com/kirameki-cafe/Yumi.git
synced 2026-09-13 18:59:19 +00:00
Create Say.ts
This commit is contained in:
@@ -0,0 +1,31 @@
|
|||||||
|
import { Message, Permissions } from "discord.js";
|
||||||
|
import { getEmotes, makeSuccessEmbed, makeProcessingEmbed, sendMessage, sendReply, makeErrorEmbed } from "../libs/DiscordMessage";
|
||||||
|
import DiscordProvider from "../providers/Discord";
|
||||||
|
|
||||||
|
export default class Say {
|
||||||
|
async onCommand(command: string, args: any, message: Message) {
|
||||||
|
if(command.toLowerCase() !== 'say') return;
|
||||||
|
|
||||||
|
if(!message.guildId) return;
|
||||||
|
if(message.member === null) return;
|
||||||
|
if(message.guild === null) return;
|
||||||
|
|
||||||
|
if (!message.member.permissions.has([Permissions.FLAGS.VIEW_CHANNEL, Permissions.FLAGS.SEND_MESSAGES, Permissions.FLAGS.MANAGE_CHANNELS]))
|
||||||
|
return await sendReply(message, {
|
||||||
|
embeds: [makeErrorEmbed ({
|
||||||
|
title: 'You need ``VIEW_CHANNEL, SEND_MESSAGES and MANAGE_CHANNELS`` permission on this guild!',
|
||||||
|
user: message.author
|
||||||
|
})]
|
||||||
|
});
|
||||||
|
|
||||||
|
if(args.length === 0)
|
||||||
|
return await sendReply(message, {
|
||||||
|
embeds: [makeErrorEmbed({
|
||||||
|
title: `No message defined`,
|
||||||
|
user: message.author
|
||||||
|
})]
|
||||||
|
});
|
||||||
|
|
||||||
|
await message.channel.send({ content: args.join(" ") });
|
||||||
|
}
|
||||||
|
}
|
||||||
Reference in New Issue
Block a user