Skip to main content

Send shell command output to Discord using webhooks.

Project description

Pingcord

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.

Features

  • 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.

Installation

You can install Pingcord using pip:

pip install pingcord

Usage

Pingcord can be used via the command line. Below are some examples of how to use it:

Send Command Output

pingcord -w <webhook_url> -c <command>

Example:

pingcord -w https://discord.com/api/webhooks/... -c ls

Send File Content

pingcord -w <webhook_url> -f <file_path>

Example:

pingcord -w https://discord.com/api/webhooks/... -f example.txt

Use a Markdown Template

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>

Syntax Highlighting

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"

Configuration File

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

Requirements

  • Python 3.7 or higher
  • requests library

Installation for Development

To install the package for development, clone the repository and run:

pip install -e .

License

This project is licensed under the MIT License. See the LICENSE file for details.

Author

Created by theo_vdml.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

pingcord-0.1.0.tar.gz (4.9 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

pingcord-0.1.0-py3-none-any.whl (5.4 kB view details)

Uploaded Python 3

File details

Details for the file pingcord-0.1.0.tar.gz.

File metadata

  • Download URL: pingcord-0.1.0.tar.gz
  • Upload date:
  • Size: 4.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.12.3

File hashes

Hashes for pingcord-0.1.0.tar.gz
Algorithm Hash digest
SHA256 7fc2bb2f679ebbe4dd32564b6d15cab0e688b06b5ce5cbbffb5f0fab4d4472f4
MD5 a75a5e6bbf2560e030b4dbe0053d6b86
BLAKE2b-256 0fa94c343cc1548332e93993f7612b52a2f1991acc830c47dcae2b01a70d47c0

See more details on using hashes here.

File details

Details for the file pingcord-0.1.0-py3-none-any.whl.

File metadata

  • Download URL: pingcord-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 5.4 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.12.3

File hashes

Hashes for pingcord-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 a7001d68cebc7e81bb2926f5076e8b241d3b2fb9567265ad8e613ff788b404c7
MD5 fc44867d9e134c3a199bd7f1c00e7ebb
BLAKE2b-256 fb265a05b7e86f8012fcf97a971cf1f5b587c4f24280c3a1167f6c5ebc9736ad

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page