@@ -62,13 +62,13 @@ protected function getMessagesAttribute(): ?ExCollectionInterface
62
62
$ collection = Collection::for (Message::class);
63
63
64
64
foreach ($ this ->attributes ['messages ' ] as $ snowflake => $ message ) {
65
- if ($ guild = $ this ->discord ->guilds ->get ('id ' , $ this ->guild_id )) {
65
+ if ($ guild = $ this ->discord ->guilds ->get ('id ' , $ message ->guild_id )) {
66
66
if ($ channel = $ guild ->channels ->get ('id ' , $ message ->channel_id )) {
67
67
$ messagePart = $ channel ->messages ->get ('id ' , $ snowflake );
68
68
}
69
69
}
70
70
71
- $ collection ->pushItem ($ messagePart ?? $ this ->factory ->part (Message::class, (array ) $ message + [ ' guild_id ' => $ this -> guild_id ] , true ));
71
+ $ collection ->pushItem ($ messagePart ?? $ this ->factory ->part (Message::class, (array ) $ message , true ));
72
72
}
73
73
74
74
return $ collection ;
@@ -84,15 +84,15 @@ protected function getMembersAttribute(): ?ExCollectionInterface
84
84
$ collection = Collection::for (Member::class);
85
85
86
86
foreach ($ this ->attributes ['members ' ] ?? [] as $ snowflake => $ member ) {
87
- if ($ guild_id = $ member ->guild_id ?? null ) {
87
+ if ($ guild_id = $ member ->guild_id ) {
88
88
if ($ guild = $ this ->discord ->guilds ->get ('id ' , $ guild_id )) {
89
89
$ memberPart = $ guild ->members ->get ('id ' , $ snowflake );
90
90
}
91
91
}
92
92
93
93
if (! isset ($ memberPart )) {
94
94
$ member ->user = $ this ->attributes ['users ' ]->$ snowflake ;
95
- $ memberPart = $ this ->factory ->part (Member::class, (array ) $ member + [ ' guild_id ' => $ this -> guild_id ] , true );
95
+ $ memberPart = $ this ->factory ->part (Member::class, (array ) $ member , true );
96
96
}
97
97
98
98
$ collection ->pushItem ($ memberPart );
0 commit comments