|
|
||
|---|---|---|
| cogs | ||
| commands | ||
| models | ||
| utils | ||
| .env.example | ||
| .gitignore | ||
| bot.py | ||
| config.py | ||
| database.py | ||
| LICENSE | ||
| README.md | ||
| requirements.txt | ||
BotNoir
BotNoir is a feature-rich Discord bot, specially created for NRW Noir, designed to enhance and automate server management, user engagement, and community moderation. It leverages Discord's modern slash commands, context menus, and scheduled tasks to provide a seamless experience for both administrators and users.
Features
-
Event Announcements
Automatically announces upcoming events for the next week in configured channels with detailed embeds and local time conversion. -
Scheduled Surveys
Posts scheduled surveys in specific channels, adds reaction options for voting, and tracks responses. -
Welcome Messages Greets new members with personalized messages, including links to important channels (rules, introductions, etc.).
-
Vorstellungs-Generator Über den Slash-Befehl
/vorstellungbeantworten neue Mitglieder einige Fragen und erhalten daraus einen vorgefertigten Text, den sie selbst im Vorstellungs‑Channel posten können. -
Summary Management
Allows users to opt-in or opt-out of receiving message summaries. Summaries can be generated from messages via context menu actions. -
Context Menu Actions
- Greet users on command.
- Add trigger warnings to messages.
- Create channel summaries.
- Temporarily mute summaries.
- Send off-topic warnings to users.
-
Off-Topic Reminders
Reminds users to stay on topic with configurable warning levels and suggests appropriate channels. -
Announcement Commands
Post announcements (with templates) and list available announcement intros via slash commands. -
Channel Synchronization
Keeps channel information in sync with the database for accurate management. -
Survey Reaction Handling
Tracks and processes user reactions on surveys. -
Data Privacy Controls
Users can manage their participation in summaries and opt-in/out as desired. -
Trigger Warning System Supports adding trigger warnings (e.g., suicide, violence, drugs, abuse) with custom emojis.
-
Role-Restricted Actions
Certain actions (like greeting users) are restricted to users with specific roles (e.g., "Gotherator"). -
Help Command
/hilfeprovides a list of all available commands and their usage.
Getting Started
Prerequisites
- Python 3.8+
- Discord bot token
- Required dependencies (see
requirements.txt) - (Optional) Database configuration for persistent features
Installation
-
Clone the repository:
git clone https://github.com/negurvulkan/BotNoir.git cd BotNoir -
Install dependencies:
pip install -r requirements.txt -
Configure environment variables and config files as needed.
-
Run the bot:
python bot.py
Usage
- Use slash commands (
/hilfe,/optin,/optout,/datenschutz, etc.) in your Discord server. - Right-click messages or users for context menu actions (e.g., add trigger warnings, greet, create summaries).
- Admins can configure channels and roles in the bot's config.
Trigger Warnings
Trigger warning emojis are defined in utils/trigger_warnings.json. Each entry maps a warning name to a custom emoji ID. To add a new warning:
-
Open
utils/trigger_warnings.json. -
Insert a new key/value pair with the warning name and emoji, for example:
{ "Suizid": "<:trigger_suizid:1280114652381974649>", "YourWarning": "<:your_emoji:1234567890>" } -
Restart the bot so it loads the updated warnings.
Configuration
Datenbankzugang
Setze sie über Umgebungsvariablen in der .env‑Datei:
cp .env.example .env
# `.env` bearbeiten und mit deinen Zugangsdaten füllen
Alternativ können die Variablen direkt im Environment exportiert werden:
export DB_HOST=example.com
export DB_USER=dbuser
export DB_PASSWORD=geheimes_passwort
export DB_NAME=dbname
Moderationschannel
Für jeden Server kann im entsprechenden File unter serverconfigs/ ein Eintrag "moderation_channel" mit der Channel‑ID (z. B. "123456789012345678") hinzugefügt werden. Dieser Channel wird für Vorschläge aus /thissoundslike verwendet.
Befehls- und Parameternamen
Innerhalb derselben Konfigurationsdateien kann der Abschnitt "command_overrides" genutzt werden, um Befehlsnamen und Parameter pro Server anzupassen. Beispiel:
"command_overrides": {
"thissoundslike": {
"name": "diesessounds",
"parameters": {
"band_name1": "band1",
"band_name2": "band2"
}
}
}
Sprache
Jede Datei serverconfigs/<guild_id>_config.json kann einen Eintrag "language" (z. B. "de" oder "en") enthalten, der die Serversprache festlegt.
Die Texte liegen in JSON‑Dateien unter utils/locales/<sprache>.json und bestehen aus einfachen Schlüssel‑Wert‑Paaren:
{
"survey_invalid_reaction": "Bitte verwende nur die vorgesehenen Reaktionen für diese Umfrage."
}
Fehlende Übersetzungen fallen auf Englisch zurück.
Contributing
Contributions are welcome! Please fork the repository and submit pull requests.
License
This project is licensed under the MIT License - see the LICENSE file for details.
Acknowledgments
- Built with discord.py
- Special thanks to all contributors and the Discord community.