Browse Source

Add error checking

pull/10230/head
blord0 2 months ago
parent
commit
60030d8ea1
  1. 10
      discord/abc.py

10
discord/abc.py

@ -1643,6 +1643,16 @@ class Messageable:
else:
flags = MISSING
if voice:
if content is not None:
raise TypeError('Cannot send content with a voice message')
if embeds is not None:
raise TypeError('Cannot send embeds with a voice message')
if file is None:
raise TypeError('A voice message must have a file')
if file.duation is None:
raise TypeError('A voice message file must have a duration')
if nonce is None:
nonce = secrets.randbits(64)

Loading…
Cancel
Save