implement slash command for announcement
This commit is contained in:
parent
acc38fdcb0
commit
e50cb10c5b
38
server/commands/announce.ts
Normal file
38
server/commands/announce.ts
Normal file
@ -0,0 +1,38 @@
|
|||||||
|
import { Guild, GuildScheduledEvent, GuildScheduledEventEditOptions, GuildScheduledEventSetStatusArg, GuildScheduledEventStatus, Message, MessageCreateOptions, MessageEditOptions, TextChannel, messageLink } from 'discord.js'
|
||||||
|
import { v4 as uuid } from 'uuid'
|
||||||
|
import { config } from '../configuration'
|
||||||
|
import { Emotes } from '../events/guildScheduledEventCreate'
|
||||||
|
import { logger } from '../logger'
|
||||||
|
import { Command } from '../structures/command'
|
||||||
|
import { RunOptions } from '../types/commandTypes'
|
||||||
|
import { client } from '../..'
|
||||||
|
|
||||||
|
export default new Command({
|
||||||
|
name: 'announce',
|
||||||
|
description: 'Neues announcement im announcement Channel an alle senden.',
|
||||||
|
options: [],
|
||||||
|
run: async (interaction: RunOptions) => {
|
||||||
|
const command = interaction.interaction
|
||||||
|
const requestId = uuid()
|
||||||
|
const guildId = command.guildId!
|
||||||
|
logger.info("Got command for announcing!", { guildId, requestId })
|
||||||
|
const announcementChannel: TextChannel = client.getAnnouncementChannelForGuild(guildId)
|
||||||
|
|
||||||
|
const body = `Hey! @everyone! Hier ist der Watchparty Bot vom Hartzarett.
|
||||||
|
|
||||||
|
Wir machen in Zukunft regelmäßig Watchparties! Falls du mitmachen möchtest, reagiere einfach auf diesen Post mit 🎫, dann bekommst du automatisch eine Rolle zugewiesen und wirst benachrichtigt sobald es in der Zukunft weitere Watchparties und Filme zum abstimmen gibt.
|
||||||
|
|
||||||
|
Für eine Erklärung wie das alles funktioniert mach einfach /mitgucken für eine lange Erklärung am Stück oder /guides wenn du auswählen möchtest wozu du Infos bekommst.`
|
||||||
|
|
||||||
|
const options: MessageCreateOptions = {
|
||||||
|
allowedMentions: { parse: ['everyone'] },
|
||||||
|
content: body
|
||||||
|
}
|
||||||
|
|
||||||
|
const message: Message<true> = await announcementChannel.send(options)
|
||||||
|
|
||||||
|
message.react("🎫")
|
||||||
|
|
||||||
|
command.followUp("Ist rausgeschickt!")
|
||||||
|
}
|
||||||
|
})
|
Loading…
Reference in New Issue
Block a user