feat: typing indicator

This commit is contained in:
Andrew Glaze
2026-03-20 22:00:19 -04:00
parent 6a48936f6c
commit 85c699412f
2 changed files with 7 additions and 1 deletions

View File

@@ -47,6 +47,12 @@ public struct DiscordClient: Sendable {
req.httpBody = try json.encode(payload)
try await authReq(req)
}
public func triggerTypingIndicator(channelId: String) async throws {
var req = URLRequest(url: DiscordClient.apiUrl.appending(path: "/channels/\(channelId)/typing"))
req.httpMethod = "POST"
try await authReq(req)
}
}
public enum ApiError: Error {

View File

@@ -48,7 +48,7 @@ struct Wolfram {
client: DiscordClient,
ctx: MessageCreate
) async throws {
//try await client.triggerTypingIndicator(channelId: ctx.channel_id).guardSuccess()
try await client.triggerTypingIndicator(channelId: ctx.channel_id)
let question = String(args.joined(separator: " "))