Skip to content
This repository has been archived by the owner on Jan 3, 2024. It is now read-only.

Commit

Permalink
Fix Messageable.triggerTyping(while:)
Browse files Browse the repository at this point in the history
This patches the additional typing indicator that would still be displayed even after the closure was finished.
  • Loading branch information
Defxult committed Sep 27, 2023
1 parent d3a0bc7 commit c746a39
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions Sources/Discord/Models/Channel.swift
Original file line number Diff line number Diff line change
Expand Up @@ -202,6 +202,8 @@ extension Messageable {
if let closure = `while` {
let task = Task {
while true {
do { try Task.checkCancellation() }
catch { break }
try await bot!.http.triggerTypingIndicator(channelId: id)

// The delay isn't 10s because once it hits the 10s mark, the "is typing"
Expand Down

0 comments on commit c746a39

Please sign in to comment.