Pingcord is a Python package that allows you to send shell command output or file content to Discord using webhooks. It is designed to make it easy to share command results or file contents directly to a Discord channel.
- Send shell command output to Discord.
- Send file content to Discord.
- Supports Markdown templates for formatting messages.
- Syntax highlighting for code blocks.
- Configurable via a YAML configuration file.
You can install Pingcord using pip:
pip install pingcord
Pingcord can be used via the command line. Below are some examples of how to use it:
pingcord -w <webhook_url> -c <command>
Example:
pingcord -w https://discord.com/api/webhooks/... -c ls
pingcord -w <webhook_url> -f <file_path>
Example:
pingcord -w https://discord.com/api/webhooks/... -f example.txt
You can use a Markdown template file to format your message. Use ${output}
in the template to insert the command output or file content.
pingcord -w <webhook_url> -t <template_file> -c <command>
Add syntax highlighting to your message by specifying a language:
pingcord -w <webhook_url> -s <language> -c <command>
Example:
pingcord -w https://discord.com/api/webhooks/... -s python -c "cat script.py"
You can create a configuration file at ~/.pingcord
to store default values for the webhook URL, template, and syntax highlighting. The file should be in YAML format:
webhook: https://discord.com/api/webhooks/...
template: /path/to/template.md
syntax: bash
- Python 3.7 or higher
-
requests
library
To install the package for development, clone the repository and run:
pip install -e .
This project is licensed under the MIT License. See the LICENSE file for details.
Created by theo_vdml.