Bugfix: Message guild returns null?
parent
0dfdd27955
commit
027bb15b41
|
|
@ -48,7 +48,8 @@ class Toadling
|
||||||
if('902654364685074522' !== $message->guild_id) {
|
if('902654364685074522' !== $message->guild_id) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
preg_match_all('/[^\s]+/', $message->content, $messageWords);
|
preg_match_all('/[^\s]+/', $message->content, $matches);
|
||||||
|
$messageWords = $matches[0];
|
||||||
if($messageWords[0] !== '!'.self::COMMAND_NAME) {
|
if($messageWords[0] !== '!'.self::COMMAND_NAME) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
@ -59,7 +60,8 @@ class Toadling
|
||||||
if(preg_match('/^#[0-9A-F]{6}$/', $color) !== 1) {
|
if(preg_match('/^#[0-9A-F]{6}$/', $color) !== 1) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
$colorRole = $message->guild->roles->find(function (Role $role) use ($color) {
|
$guild = $discord->guilds->get('id', '902654364685074522');
|
||||||
|
$colorRole = $guild->roles->find(function (Role $role) use ($color) {
|
||||||
return $role->name === $color;
|
return $role->name === $color;
|
||||||
});
|
});
|
||||||
$colorInt = intval(substr($color, 1), 16);
|
$colorInt = intval(substr($color, 1), 16);
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue