update to discord.gd 2.0.1
This commit is contained in:
parent
c8c4a55a99
commit
b7ada53c1d
3 changed files with 13 additions and 14 deletions
|
|
@ -58,7 +58,7 @@ var MESSAGE_TYPES = {
|
|||
'22': 'GUILD_INVITE_REMINDER'
|
||||
}
|
||||
|
||||
func _init(message: Dictionary):
|
||||
func _init(message: Dictionary, client = null):
|
||||
# Compulsory
|
||||
assert(typeof(message) == TYPE_DICTIONARY, 'Invalid type: message must be a Dictionary')
|
||||
assert(message.id, 'Message must have an id')
|
||||
|
|
@ -81,7 +81,10 @@ func _init(message: Dictionary):
|
|||
pass
|
||||
else:
|
||||
# sent by user
|
||||
assert(message.author is User, 'author attribute of Mesage must be of type User')
|
||||
if not message.author is User:
|
||||
message.author = User.new(client, message.author)
|
||||
else:
|
||||
assert(message.author is User, 'author attribute of Mesage must be of type User')
|
||||
author = message.author
|
||||
|
||||
if message.has('flags'):
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue