This Discord bot allows users with a specific role to post messages as embeds to predefined channels or any specified channel using different commands. The bot includes commands for posting job and service announcements, as well as a flexible command for posting to any channel.
- Post job announcements to a predefined channel.
- Post service offerings to a predefined channel.
- Post embed messages to any specified channel with a custom title and message.
Posts a job announcement to the predefined job channel.
Usage:
/postjob <message>
Example:
/postjob "We are hiring a new software developer!"
Posts a service offering to the predefined service channel.
Usage:
/postservices <message>
Example:
/postservices "Offering web development services at competitive prices."
Posts an embed message to any specified channel with a custom title and message.
Usage:
/post #channelname <Title> <Message-content>
Example:
/post #channelname "Title" "Message content goes here."
- Python 3.6+
- Discord account and server where the bot will be used
-
Clone the repository:
git clone https://github.com/Susmita-Dey/post-bot.git cd post-bot
-
Create a virtual environment and activate it:
python -m venv venv source venv/bin/activate # On Windows, use `venv\Scripts\activate`
-
Install dependencies:
pip install -r requirements.txt
-
Create a
.env
file and add your environment variables:DISCORD_BOT_TOKEN=your_bot_token ALLOWED_ROLE_ID=role_id JOB_CHANNEL_ID=job_channel_id SERVICE_CHANNEL_ID=service_channel_id
- Start the bot:
python bot.py
Create an account on Render. Install Render on your git repository and hit deploy
Ensure the bot has the following permissions in your Discord server:
- Send Messages
- Embed Links
- Manage Roles (if you want the bot to verify roles)
-
Bot not responding to commands:
- Check that the bot has the required permissions.
- Verify that the environment variables are correctly set.
- Ensure the bot is running and connected to the Discord server.
-
Environment variable errors:
- Ensure all necessary environment variables are set in the
.env
file.
- Ensure all necessary environment variables are set in the
This project is licensed under the MIT License. See the LICENSE file for more details.