Created
March 3, 2022 04:41
-
-
Save tigrang/87246784b8f1c6f084a65a1bc3d55ba4 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Discord\Repository\Interaction\OptionRepository Object | |
( | |
[give] => Discord\Parts\Interactions\Request\Option Object | |
( | |
[name] => give | |
[type] => 1 | |
[value] => | |
[focused] => | |
[options] => Discord\Repository\Interaction\OptionRepository Object | |
( | |
) | |
) | |
) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
include __DIR__ . '/../src/bootstrap.php'; | |
use Discord\Discord; | |
use Discord\Parts\Interactions\Interaction; | |
$discord = new Discord([ | |
'token' => $_ENV['BOT_TOKEN'], | |
// 'logger' => new \Psr\Log\NullLogger(), | |
]); | |
$discord->on('ready', function (Discord $discord) use ($db) { | |
echo "Bot is ready!", PHP_EOL; | |
$discord->listenCommand('karma', function(Interaction $interaction) { | |
print_r($interaction->data->options); | |
}); | |
}); | |
$discord->run(); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"name": "karma", | |
"description": "desc", | |
"options": [ | |
{ | |
"name": "give", | |
"description": "Give karma to a user", | |
"type": 1, | |
"options": [ | |
{ | |
"name": "user", | |
"description": "The user to give karma to", | |
"type": 6, | |
"required": true | |
} | |
] | |
} | |
] | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"application_id": "#################", | |
"channel_id": "#################", | |
"data": { | |
"id": "#################", | |
"name": "karma", | |
"options": [ | |
{ | |
"name": "give", | |
"options": [ | |
{ | |
"name": "user", | |
"type": 6, | |
"value": "#################" | |
} | |
], | |
"type": 1 | |
} | |
] | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment