Metadata-Version: 2.1
Name: ukosnik
Version: 0.1.3
Summary: Manage Discord Slash Commands
Home-page: https://github.com/Unoqwy/ukosnik
Author: Unoqwy
License: MIT
Project-URL: Bug Tracker, https://github.com/Unoqwy/ukosnik/issues
Keywords: discord
Platform: UNKNOWN
Classifier: Development Status :: 3 - Alpha
Classifier: Natural Language :: English
Classifier: License :: OSI Approved :: MIT License
Classifier: Operating System :: OS Independent
Classifier: Programming Language :: Python :: 3
Requires-Python: >=3.6
Description-Content-Type: text/markdown
Requires-Dist: PyYAML (<=6,>=5)
Requires-Dist: requests (<=3,>=2.25)
Requires-Dist: typing-extensions (==3.10.0.0)
Requires-Dist: dataclasses (==0.8) ; python_version < "3.7"

# ukosnik

ukosnik is a Python CLI to manage Discord Slash Commands.

<!-- External image URL to make PyPI display it -->
![Insert/update demo output](https://raw.githubusercontent.com/Unoqwy/ukosnik/master/demo/screenshot-update.png "comamnd: ukosnik update <config> -d")

## Installation

**Python 3.6 or higher is required**

Run the command `python3 -m pip install -U ukosnik` to install the CLI.  

You may alternatively clone the repository and install the package from local sources.

## Usage

The following examples assume the environment variable `DISCORD_TOKEN` to be set.  

**Register/update slash commands:**  

```sh
# Register/update commands
ukosnik update config_file.yml

# Same but delete oudated commands
ukosnik update config_file.yml -d

# Register/update guild commands
# (very useful for testing since cache updates instantly)
ukosnik update config_file.yml --guild GUILD_ID
```

Please note that updating application commands may take up to 1 hour to refresh, this is an expected Discord behavior.
Read more about it [here](https://discord.com/developers/docs/interactions/slash-commands#registering-a-command).  
**To debug commands, it's recommended to use the `--guild` argument since guild commands update instantly, unlike application-scoped commands.**

*Note: Providing multiple configuration files to merge is not supported yet but is planned.*

**Clear all commands:**  

```sh
# Clear all application commands
ukosnik clear

# Clear all commands from a guild
ukosnik clear --guild GUILD_ID
```

⚠️ No confirmation will be prompted before deleting commands.

## Configuration

Configuration documents are pretty straighforward. They can be either a yml or json file.

For now, the only available field in a configuration document is `commands`. You may provide either an object of commands with the command name as key or a simple list.  
To get a better understanding of how you can register commands, take a look at the [examples](https://github.com/Unoqwy/ukosnik/tree/master/examples).



