-
Notifications
You must be signed in to change notification settings - Fork 110
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
Add Support for Guild Scheduled Events #166
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Added comments to explain code - Assistance requested please
/** | ||
* the time the scheduled event will end, required if entity_type is EXTERNAL | ||
* | ||
* @var \DateTimeImmutable|null |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
According to docs this should be a ISO8601 timestamp, is this the correct var to use here?
* | ||
* @var \DateTimeImmutable|null | ||
*/ | ||
public $scheduled_start_time; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
According to docs this should be a ISO8601 timestamp, is this the correct var to use here?
ping @aequasi |
Can you please test the |
This would be great to see implemented |
Would love to see this merged. |
|
If I can work out how to specify that in composer.json, sure. Will take a look at it now. |
Changed:
Into this:
And received the following error when attempting to update it:
|
Managed to get it to update with However, this sample code seems invalid:
... as seen in "Get Guild Scheduled Event.md" How is it supposed to be called? As |
It looks like there's a similar issue with the audit log stuff, i.e. #152 |
And if I modify $bot->guildscheduledevent->createGuildScheduledEvent([
'guild.id' => $guildId,
'name' => 'Testing',
]); Error message:
I've been unsuccessful in working out what the truncated part of the error message is. |
Also, if I do provide some of the optional fields, I run into validation errors - which I suspect are due to Restcord incorrectly defining the types of these parameters?
I'm pretty confident that I'm defining at least a few of these correctly :\ Here's my options array: $bot->guildscheduledevent->createGuildScheduledEvent([
'guild.id' => $guildId,
'name' => 'Testing',
'description' => 'This is a test description.',
'scheduled_start_time' => Carbon::parse('8 January 2022 at 5pm')->toDateTimeImmutable(),
'scheduled_end_time' => Carbon::parse('8 January 2022 at 7pm')->toDateTimeImmutable(),
'privacy_level' => 2, // GUILD_ONLY
'entity_type' => 3, // EXTERNAL
'entity_metadata' => [
'location' => 'https://example.com',
],
]); |
I have found a solution for these issues and resolved it in #174 |
Possibly Solved/Duplicate of #174 |
Please could this be reviewed and not blindly merged as not sure I've done what's needed here. When merged, this will resolve and close #165