Responding to Commands
Hello World! Coming through loud and clear!
@main
public struct Bot {
private static let HELLO_MESSAGES = [
"Hello, World!",
"Helloooo! I can hear you!",
"Who's there?",
"Beep, boop, I'm a bot.",
"I'm alive!"
]
...NewAppCommand("hello", description: "Get a nice hello message") { interaction in
print("Received hello interaction!")
// Reply with a random hello message
try? await interaction.reply(HELLO_MESSAGES.randomElement()!)
}
Last updated

