A cli Discord bot to send simple messages to a discord channel.
Project description
A simple python Discord bot to send messages to discord channel via command line.
It allows markdown formatted messages and attaching files.
It registers the following commands:
dbot-run - main CLI entry-point
dbot-message - (short-hand) to send a message, or even pipe - message contents
dbot-file - (short-hand) to send a file with an message
Requirements
Installation
python3 -m pip install discord-notifier-bot
Optionally, install it locally with --user.
Configuration
Configuration is done by placing a .dbot.conf file in one of the following directories:
$HOME/.dbot.conf
$HOME/dbot.conf
./.dbot.conf
./dbot.conf
/etc/dbot.conf
Alternatively a configuration file can be provided via -c/--config CLI options.
The configuration file should be a standard INI file. A template can be found in the templates folder. All configurations are placed under the discord-bot section.
Example:
[discord-bot]
# the bot token (used for login)
token = abc
# the numeric id of a channel, can be found when activating the developer options in appearances
channel = 123
Usage
dbot-message and dbot-file are less complex versions of dbot-run.
Print help and available options:
dbot-run -h
Sending messages:
# send a simple message
dbot-run message "Test message"
# or shorter:
dbot-message "Test **message**"
# pipe output
echo "Test" | dbot-emessage -
# wrap it inside a code-block ```
# optionally with a type
cat `which dbot-message` | dbot-message - --type
cat `which dbot-message` | dbot-message - --type python
Sending a file:
dbot-file README.rst "Your message to desribe the attached file"
# or with no visible message:
dbot-file README.rst ""
# optionally also like this:
dbot-run file -f README.rst "Message ..."
You are always able to specify the configuration file like this:
dbot-run -c /path/to/dbot.conf [...]
dbot-{message,file} -c /path/to/dbot.conf [...]
Only with dbot-run: To display debugging information (api calls, log messages etc.):
dbot-run -v [...]
You may also run the bot with the python module notation. But it will only run the same entry-point like dbot-run.
python -m discord_notifier_bot [...]
Bot Creation etc.
See information provided by:
Credits
Copyright and License Information
Copyright (c) 2020 Erik Körner. All rights reserved.
See the file “LICENSE” for information on the history of this software, terms & conditions for usage, and a DISCLAIMER OF ALL WARRANTIES.
All trademarks referenced herein are property of their respective holders.
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
Built Distribution
Hashes for discord-notifier-bot-0.1.7.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | 031a56b4649e2149dc5947a5dc0f32dd63e4446a5341f7e33a2c755c7483d9b4 |
|
MD5 | c04bd668c10398dc1c512b425ad3d528 |
|
BLAKE2b-256 | 98dbec50c155000e1f264d2b847b9052c01a1c3fb0513b5ed6ee38620359b412 |
Hashes for discord_notifier_bot-0.1.7-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 9a679e2c4bbd77bba4a9e7b86f63a3698f13a056f850b67558c6ee675da27a70 |
|
MD5 | 78e68f4fa40d76db741e170056f672ee |
|
BLAKE2b-256 | 7c07770fdfe340d9126d675344005717bd5a617104a13a4f2fd412cf99c3c633 |