Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 12 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -153,14 +153,25 @@ class UserCommand
{
#[Subcommand(name: 'info', description: 'Get user information')]
public function info(
#[Option(name: 'user', description: 'Target user', required: true)]
#[Option(description: 'Target user')]
User $user
): void {
// Handle user info command
}
}
```

Whether an option is required comes from whether its parameter has a default, so `$user`
above is required without saying so.

## Documentation

See [docs/](docs/README.md) — guides for getting started, commands, autocomplete, events and
translations, plus a reference generated from the source.

Run `composer docs` after changing the public API; the test suite fails if the committed
documentation no longer matches the code.

## Contributing

We welcome contributions! Please see [CONTRIBUTING.md](CONTRIBUTING.md) for details on how to contribute to Tempcord.
Expand Down
15 changes: 11 additions & 4 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,11 @@
"type": "library",
"require": {
"php": "^8.5",
"tempest/console": "^3.18",
"ragnarok/fenrir": "^1.0",
"tempest/core": "^3.18"
"tempest/console": "^3.18",
"tempest/core": "^3.18",
"tempest/event-bus": "^3.18",
"tempest/log": "^3.18"
},
"license": "MIT",
"authors": [
Expand All @@ -28,7 +30,8 @@
"scripts": {
"test": "phpunit",
"analyse": "phpstan analyse --memory-limit=1G",
"cs-fix": "php-cs-fixer fix"
"cs-fix": "php-cs-fixer fix",
"docs": "php tools/generate-docs.php"
},
"config": {
"sort-packages": true,
Expand All @@ -47,7 +50,11 @@
},
"autoload-dev": {
"psr-4": {
"Tempcord\\Tests\\": "tests/"
"Tempcord\\Tests\\": "tests/",
"Tempcord\\Tools\\": "tools/src/"
}
},
"suggest": {
"tempest/intl": "Enables name and description translations for commands via #[Command(translationKey: ...)]. Requires ext-intl."
}
}
29 changes: 29 additions & 0 deletions docs/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
<!-- Generated from the source by `composer docs`. Do not edit by hand. -->

# Tempcord documentation

Build Discord bots with PHP, on top of [Tempest](https://tempestphp.com).

## Guides

- [Getting started](guides/01-getting-started.md)
- [Commands and options](guides/02-commands.md)
- [Autocomplete](guides/03-autocomplete.md)
- [Events](guides/04-events.md)
- [Translations](guides/05-translations.md)
- [Plugins](guides/06-plugins.md)

## Reference

Generated from the source, so it describes what the framework actually does.

**Attributes** — [Command](reference/attributes/command.md), [SubcommandGroup](reference/attributes/subcommand-group.md), [Subcommand](reference/attributes/subcommand.md), [Option](reference/attributes/option.md), [Event](reference/attributes/event.md)

**Autocomplete** — [Autocomplete](reference/autocomplete/autocomplete.md), [ArrayAutocomplete](reference/autocomplete/array-autocomplete.md)

**Configuration** — [TempcordConfig](reference/configuration/tempcord-config.md)

**Enums** — [DiscordLocale](reference/enums/discord-locale.md)

**Plugins** — [Plugin](reference/plugins/plugin.md)

Loading