Metadata-Version: 2.1
Name: django-discord-integration
Version: 1.2.4
Summary: Discord integration for Django, supporting error reporting via webhooks.
Home-page: https://github.com/Ninjaclasher/django-discord-integration
Author: Evan Zhang
Classifier: Development Status :: 5 - Production/Stable
Classifier: Environment :: Web Environment
Classifier: Framework :: Django
Classifier: Intended Audience :: Developers
Classifier: License :: OSI Approved :: GNU Affero General Public License v3 or later (AGPLv3+)
Classifier: Operating System :: OS Independent
Classifier: Topic :: Software Development
Classifier: Topic :: Communications :: Chat
Classifier: Topic :: Software Development :: Libraries :: Python Modules
Classifier: Programming Language :: Python
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.9
Classifier: Programming Language :: Python :: 3.8
Classifier: Programming Language :: Python :: 3.7
Description-Content-Type: text/markdown
License-File: LICENSE

# Django Discord Integration

Discord integration for Django, supporting error reporting via webhooks.

This app comes with two message handlers: `DiscordMessageHandler` and `SimpleDiscordMessageHandler`. `DiscordMessageHandler` sends all the information related to the message, such as a traceback if there is one, while the `SimpleDiscordMessageHandler` only sends the title.

## Installation
```bash
$ pip install django-discord-integration
```

In your `settings.py`, add the following:
```python
INSTALLED_APPS = (
    'discord_integration',
    ...
)
```

Next, migrate the database:
```
$ python manage.py migrate
```

Finally, create a Discord integration object in the Django admin site. Set the Discord webhook URL as well as the bot username and avatar URL if necessary. You can create multiple objects to direct different logs to different channels. The default object should the name `default`.


## Sample Logging Configuration

```python
LOGGING = {
    'handlers': {
        'discord_integration': {
            'level': 'ERROR',
            'class': 'discord_integration.log.DiscordMessageHandler',
            'model_name': 'default',  # OPTIONAL: specify a name to use a different integration configuration.
        },
    },
    'loggers': {
        'handlers': ['discord_integration'],
    },
}
```
