-
Notifications
You must be signed in to change notification settings - Fork 23
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Error when adding color #11
Comments
I'll take a look. Also you might want to invalidate that webhook you just made it public.On Apr 9, 2018 3:45 PM, jappi00 <[email protected]> wrote:Hey, I become an Error when I adding a Color to e embed
Fatal error: Uncaught Exception: 400:{"embeds": ["0"]} in D:\XAMPP\htdocs\discordbot\DiscordWebhooks\Client.php:80 Stack trace: #0 D:\XAMPP\htdocs\discordbot\index.php(18): DiscordWebhooks\Client->send() #1 {main} thrown in D:\XAMPP\htdocs\discordbot\DiscordWebhooks\Client.php on line 80
My Code looks like:
`require_once 'DiscordWebhooks\Client.php';
require_once 'DiscordWebhooks\Embed.php';
use \DiscordWebhooks\Client;
use \DiscordWebhooks\Embed;
$webhook = new Client('https://discordapp.com/api/webhooks/432981962618306561/UTivswvxRMBFOGfL7BSJcSs-BznJt0VmYCYcSHw1ZP0fgrzu9s3X6EpO_zYO_kliYLnp');
$embed = new Embed();
$embed->description('LUL');
$embed->field('Test1', 'Hallo1', true);
$embed->color('#e26367');
$embed->field('Test2', 'Hallo2', true);
$embed->field('Test3', 'Hallo3', false);
$embed->field('Test4', 'Hallo4', true);
$webhook->username('KevinBot')->message('Hello, Human!')->embed($embed)->send();`
—You are receiving this because you are subscribed to this thread.Reply to this email directly, view it on GitHub, or mute the thread.
{"api_version":"1.0","publisher":{"api_key":"05dde50f1d1a384dd78767c55493e4bb","name":"GitHub"},"entity":{"external_key":"github/nopjmp/discord-webhooks","title":"nopjmp/discord-webhooks","subtitle":"GitHub repository","main_image_url":"https://cloud.githubusercontent.com/assets/143418/17495839/a5054eac-5d88-11e6-95fc-7290892c7bb5.png","avatar_image_url":"https://cloud.githubusercontent.com/assets/143418/15842166/7c72db34-2c0b-11e6-9aed-b52498112777.png","action":{"name":"Open in GitHub","url":"https://github.com/nopjmp/discord-webhooks"}},"updates":{"snippets":[{"icon":"DESCRIPTION","message":"Error when adding color (#11)"}],"action":{"name":"View Issue","url":"#11"}}}
|
Jeah thanks, |
The color option needs to be an integer not the hex value. I don't have conversion in the class yet. I might whip something up later but for now you need to put the integer value in instead.On Apr 10, 2018 11:16 AM, jappi00 <[email protected]> wrote:Jeah thanks,
The Webhook is only dir an Test Channel and should be invalid. Great Class you have wrote:D
—You are receiving this because you commented.Reply to this email directly, view it on GitHub, or mute the thread.
{"api_version":"1.0","publisher":{"api_key":"05dde50f1d1a384dd78767c55493e4bb","name":"GitHub"},"entity":{"external_key":"github/nopjmp/discord-webhooks","title":"nopjmp/discord-webhooks","subtitle":"GitHub repository","main_image_url":"https://cloud.githubusercontent.com/assets/143418/17495839/a5054eac-5d88-11e6-95fc-7290892c7bb5.png","avatar_image_url":"https://cloud.githubusercontent.com/assets/143418/15842166/7c72db34-2c0b-11e6-9aed-b52498112777.png","action":{"name":"Open in GitHub","url":"https://github.com/nopjmp/discord-webhooks"}},"updates":{"snippets":[{"icon":"PERSON","message":"@jappi00 in #11: Jeah thanks,\r\nThe Webhook is only dir an Test Channel and should be invalid. Great Class you have wrote:D"}],"action":{"name":"View Issue","url":"#11 (comment)"}}}
|
jeah that's it! Thank you! |
Fixed in #12 |
Closing since it was fixed #12 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Hey, I become an Error when I adding a Color to e embed
Fatal error: Uncaught Exception: 400:{"embeds": ["0"]} in D:\XAMPP\htdocs\discordbot\DiscordWebhooks\Client.php:80 Stack trace: #0 D:\XAMPP\htdocs\discordbot\index.php(18): DiscordWebhooks\Client->send() #1 {main} thrown in D:\XAMPP\htdocs\discordbot\DiscordWebhooks\Client.php on line 80
My Code looks like:
`require_once 'DiscordWebhooks\Client.php';
require_once 'DiscordWebhooks\Embed.php';
use \DiscordWebhooks\Client;
use \DiscordWebhooks\Embed;
$webhook = new Client('https://discordapp.com/api/webhooks/blabla');
$embed = new Embed();
$embed->description('LUL');
$embed->field('Test1', 'Hallo1', true);
$embed->color('#e26367');
$embed->field('Test2', 'Hallo2', true);
$embed->field('Test3', 'Hallo3', false);
$embed->field('Test4', 'Hallo4', true);
$webhook->username('KevinBot')->message('Hello, Human!')->embed($embed)->send();`
The text was updated successfully, but these errors were encountered: