Image attach

This commit is contained in:
Andrew Glaze
2026-03-20 19:13:45 -04:00
parent 4d39ed8053
commit 6a48936f6c
7 changed files with 289 additions and 241 deletions

View File

@@ -20,32 +20,30 @@ struct MessageHandler {
switch command {
case "wow": try await handleWow(args)
// case "domath": try await Wolfram.handleMath(args, client: client, ctx: ctx)
// case "hug": try await Actions.hug(args, client: client, ctx: ctx)
// case "pat": try await Actions.pat(args, client: client, ctx: ctx)
// case "pet": try await Actions.pat(args, client: client, ctx: ctx)
case "domath": try await Wolfram.handleMath(args, client: client, ctx: ctx)
case "hug": try await Actions.hug(args, client: client, ctx: ctx)
case "pat": try await Actions.pat(args, client: client, ctx: ctx)
case "pet": try await Actions.pat(args, client: client, ctx: ctx)
default: break
}
} else if ctx.mentions.contains(where: { $0.id == Zundamon.ownID }) {
if ctx.content
.replacingOccurrences(of: "<@\(Zundamon.ownID!)>", with: "")
.trimmingCharacters(in: .whitespacesAndNewlines)
.count == 0,
let zundaGif = MessageHandler.zundaGifData
.count == 0
{
// try await client.createMessage(
// channelId: ctx.channel_id,
// payload: .init(
// message_reference: .init(
// type: .default,
// message_id: ctx.id,
// channel_id: ctx.channel_id,
// guild_id: ctx.guild_id,
// ),
// files: [.init(data: .init(data: zundaGif), filename: "zundamone.gif")],
// attachments: [.init(index: 0, filename: "zundamone.gif")],
// )
// ).guardSuccess()
try await client.createMessage(
channelId: ctx.channel_id,
payload: .init(
message_reference: .init(
type: 0,
message_id: ctx.id,
channel_id: ctx.channel_id,
guild_id: ctx.guild_id,
),
embeds: [.init(image: .init(url: "https://candy123.moe/tetrio/zundamone.gif"))],
)
)
} else {
try await handle8Ball()
}