mirror of
https://github.com/PluralKit/PluralKit.git
synced 2026-02-15 18:20:11 +00:00
Add delay of 0.5 seconds before deleting original
This commit is contained in:
parent
e4c153f18e
commit
f174ce9a03
1 changed files with 5 additions and 0 deletions
|
|
@ -1,3 +1,4 @@
|
||||||
|
import asyncio
|
||||||
import re
|
import re
|
||||||
|
|
||||||
import discord
|
import discord
|
||||||
|
|
@ -134,7 +135,11 @@ async def send_proxy_message(conn, original_message: discord.Message, system: Sy
|
||||||
)
|
)
|
||||||
|
|
||||||
# And finally, gotta delete the original.
|
# And finally, gotta delete the original.
|
||||||
|
# We wait half a second or so because if the client receives the message deletion
|
||||||
|
# event before the message actually gets confirmed sent on their end, the message
|
||||||
|
# doesn't properly get deleted for them, leading to duplication
|
||||||
try:
|
try:
|
||||||
|
await asyncio.sleep(0.5)
|
||||||
await original_message.delete()
|
await original_message.delete()
|
||||||
except discord.Forbidden:
|
except discord.Forbidden:
|
||||||
raise ProxyError(
|
raise ProxyError(
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue