Welcome to the documentation for Cosmos, a versatile and powerful Discord bot designed to enhance the experience on your server. This readme provides an overview of the bot's features and how to use them effectively.
Cosmos is a Discord bot designed to make your server more interactive and entertaining. It comes with a range of features that enable moderation, entertainment, information retrieval, and more. Whether you manage a gaming community, a study group, or any other type of server, Cosmos has something to offer.
- An account on Discord
- Access to a Discord server where you have administrator permissions
- Go to the Discord Developer Portal.
- Log in with your Discord account.
- Click the "New Application" button.
- Enter a name for your application (this will be your bot's name).
- Click "Create."
- In the left menu, select "Bot."
- Click "Add Bot."
- Confirm the action with "Yes, do it!"
- Under the "TOKEN" section, you will find your bot token. Click "Copy" to copy the token to your clipboard. Note: Keep this token secret, as it grants access to your bot.
- Return to your application page by clicking on the application name in the top left.
- In the left menu, select "OAuth2."
- In the "OAuth2 URL Generator," select "bot" and "applications.commands" under Scopes.
- Choose the permissions your bot should have (e.g., "Read Messages," "Send Messages," etc.). The bot should have administrator permissions.
- Copy the generated OAuth2 link and paste it into your web browser.
- Select a server to invite your bot to and confirm the invitation.
The config.json
file allows you to customize various aspects of the Cosmos bot to fit the needs of your server. Here's a breakdown of the configuration options:
- name: The display name of the bot on the server.
- id: The ID of the bot.
- activity: The activity status displayed for the bot (e.g., "Watching over the universe.").
- owner: The ID of the bot owner who has special privileges.
- log_channel: The channel where bot activity logs and notifications are sent.
- announcement_channel: The channel for important team announcements to the server.
- suggestion_channel: The channel where users can submit suggestions.
- ticket_category: The category for creating support ticket channels.
- closed_category: The category to which closed or completed ticket channels are moved.
- verify_role: The role assigned to users after they are verified.
- ticket_role: The role granted to users who have access to moderate support tickets.
- double_xp_role: The role that grants users double experience points on the server.
Additionally, the main bot file allows you to map roles to specific levels for a leveling system. The roles
dictionary maps levels to their corresponding role IDs. Users are assigned these roles when they reach the specified levels. To add or remove roles and levels, you can edit this dictionary.
roles = {
0: 1127584577683202148,
5: 1127584523702521916,
10: 1127584455456981002,
15: 1127584401342091314,
20: 1127584356777599047,
25: 1127584304713695323,
30: 1127584248652627999,
35: 1127584186715353098,
40: 1127584121418416178,
45: 1127584069883019375,
50: 1127583980565299273,
60: 1127583919001313450,
70: 1127583602851446814,
80: 1127583573856239627,
90: 1127583535272820737,
115: 1127583507514929294,
130: 1127583471947235338,
160: 1127583438690603079,
200: 1127579753663172608
}
- Create a file named
.env
in the same folder whereindex.py
is located. - Add the following line to it:
TOKEN = "YourToken"
replacingYourToken
with the actual bot token.
- Make sure you have Python installed. If not, you can download it here.
- Install the Python packages:
pip install -r requirements.txt
- Run your code. Your bot should now log into Discord and respond to commands or events.
Here are some of the key commands supported by Cosmos:
- Description: Bans a user from the server.
- Usage:
/ban [user] [reason]
- Description: Kicks a user from the server.
- Usage:
/kick [user] [reason]
- Description: Mutes a user (they cannot write after being muted).
- Usage:
/mute [user] [reason]
- Description: Unmutes a user.
- Usage:
/unmute [user] [reason]
- Description: Deletes a number of messages in a channel.
- Usage:
/clear [count]
- Description: Displays a user's infraction history stored in
users.db
. - Usage:
/info [user]
- Description: Warns a user.
- Usage:
/warn [user] [reason]
- Description: Resets a user's information (infraction history, level). It can also be used to add users to the database.
- Usage:
/reset [user] [reason]
- Description: Displays information about the server.
- Usage:
/serverinfo
- Description: Provides you with a user's avatar (profile picture).
- Usage:
/avatar [user]
- Description: Allows users to submit suggestions to the team.
- Usage:
/suggest [message]
- Description: Allows the team to send uniform announcements to users.
- Usage:
/announce [message]
- Description: Displays the bot's ping.
- Usage:
/ping
- Description: Shows your level.
- Usage:
/rank
- Description: Sets a user's level.
- Usage:
/level [user] [level]
- Description: Allows users to verify themselves.
- Usage:
/verify
- Description: Sends the server rules (these must be manually changed in
index.py
at lines 526-536). - Usage:
/rules
- Description: Allows users to create a support ticket.
- Usage:
/ticket
We welcome contributions from the community! If you'd like to contribute to Cosmos, please follow these steps:
- Fork the repository.
- Create a new branch.
- Add your improvements or bug fixes.
- Submit a pull request.
Thank you for choosing Cosmos! We hope this bot brings value and joy to your Discord server. If you have any suggestions or feature requests, please don't hesitate to let us know!
This project is licensed under the GNU General Public License, version 3.0. You can find the full license text here.