From d12165a0e3b00c912b8cee6447481d0b003c77a4 Mon Sep 17 00:00:00 2001 From: Dany Thach Date: Sun, 31 Oct 2021 19:04:26 +0100 Subject: [PATCH] New role doesn't have guild --- src/Toadling.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/Toadling.php b/src/Toadling.php index fc8d921..e89330a 100644 --- a/src/Toadling.php +++ b/src/Toadling.php @@ -66,7 +66,7 @@ class Toadling }); $colorInt = intval(substr($color, 1), 16); if(null !== $colorRole) { - $roles = $colorRole->guild->roles; + $roles = $guild->roles; $rolesArray = $roles->toArray(); $rolesArray = array_map( function ($role) { @@ -87,8 +87,8 @@ class Toadling $guild->createRole([ 'name' => $color, 'color' => $colorInt, - ])->done(function (Role $colorRole) use ($message) { - $roles = $colorRole->guild->roles; + ])->done(function (Role $colorRole) use ($message, $guild) { + $roles = $guild->roles; $rolesArray = $roles->toArray(); $rolesArray = array_map( function ($role) {