feat: typing indicator
This commit is contained in:
@@ -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 {
|
||||
|
||||
@@ -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: " "))
|
||||
|
||||
|
||||
Reference in New Issue
Block a user