### Start Grace Bot (Shell) Source: https://github.com/code-society-lab/grace-framework/blob/main/grace/generators/templates/project/{{ cookiecutter.__project_slug }}/README.md Starts the Grace bot in development mode. Use Ctrl+C to stop the bot. ```Shell grace start ``` -------------------------------- ### Install Grace Framework Development Version (Shell) Source: https://github.com/code-society-lab/grace-framework/wiki/Getting-Started This sequence of commands clones the Grace Framework repository from GitHub, navigates into the cloned directory, and then installs the framework in editable mode. This is useful for developers who want to contribute to or modify the framework itself. ```Shell $ git clone https://github.com/Code-Society-Lab/grace-framework.git $ cd grace-framework $ pip install -e . ``` -------------------------------- ### Install Grace Framework (Python) Source: https://github.com/code-society-lab/grace-framework/blob/main/grace/generators/templates/project/{{ cookiecutter.__project_slug }}/README.md Installs the Grace Framework using pip. It's recommended to install in editable mode for development. ```Shell pip install -e . ``` ```Shell pip install . ``` -------------------------------- ### Install Grace Framework Development Version Source: https://github.com/code-society-lab/grace-framework/blob/main/README.md Clones the Grace Framework repository and installs the development version using pip. This is useful for contributing to the framework. ```Shell $ git clone https://github.com/Code-Society-Lab/grace-framework.git $ cd grace-framework $ pip install -e . ``` -------------------------------- ### Run Grace Framework Bot Source: https://github.com/code-society-lab/grace-framework/blob/main/README.md Starts the Discord bot created with the Grace Framework. Ensure the bot token is correctly set in the `.env` file. ```Shell $ grace run ``` -------------------------------- ### Install Grace Framework Package Source: https://github.com/code-society-lab/grace-framework/blob/main/README.md Installs the Grace Framework package using pip. It's recommended to use a virtual environment for Python package installations. ```Shell $ pip install grace-framework ``` -------------------------------- ### Install Grace Framework (Shell) Source: https://github.com/code-society-lab/grace-framework/wiki/Getting-Started This command installs the Grace Framework using pip. It's the standard way to add the framework to your Python project's dependencies. ```Shell $ pip install grace-framework ``` -------------------------------- ### Grace Database Management Commands (Shell) Source: https://github.com/code-society-lab/grace-framework/blob/main/grace/generators/templates/project/{{ cookiecutter.__project_slug }}/README.md Provides commands for managing the Grace Framework's database, including creation, deletion, seeding, and resetting. ```Shell grace db create ``` ```Shell grace db drop ``` ```Shell grace db seed ``` ```Shell grace db reset ``` -------------------------------- ### Grace Command Environment Configuration (Shell) Source: https://github.com/code-society-lab/grace-framework/blob/main/grace/generators/templates/project/{{ cookiecutter.__project_slug }}/README.md Demonstrates how to specify an environment for Grace commands using the -e argument. Available environments are production, development (default), and test. ```Shell grace start -e production ``` ```Shell grace db reset -e test ``` -------------------------------- ### Configure Discord Token Source: https://github.com/code-society-lab/grace-framework/blob/main/grace/generators/templates/project/{{ cookiecutter.__project_slug }}/README.md Creates a .env file in the project directory to store the Discord bot token. This token is essential for the bot's operation. ```dotenv DISCORD_TOKEN= ``` -------------------------------- ### Run Grace Framework Bot Source: https://github.com/code-society-lab/grace-framework/wiki/Getting-Started This command initiates the Grace Framework bot. Successful execution, assuming the Discord token is correctly configured, will result in log messages indicating the bot's connection status and readiness. ```bash $ grace run ``` -------------------------------- ### Create and Activate Virtual Environment (Shell) Source: https://github.com/code-society-lab/grace-framework/wiki/Getting-Started This snippet demonstrates how to create a virtual environment named 'venv' and then activate it using the 'source' command. Virtual environments are crucial for managing project dependencies and preventing version conflicts. ```Shell $ virtualenv venv $ source venv/bin/activate ``` -------------------------------- ### Navigate to Bot Directory (Shell) Source: https://github.com/code-society-lab/grace-framework/wiki/Getting-Started After generating a new bot project, this command changes the current directory to the newly created bot's folder, allowing you to work within the project. ```Shell cd task-bot ``` -------------------------------- ### Generate New Bot with Grace Framework Source: https://github.com/code-society-lab/grace-framework/blob/main/README.md Creates a new Discord bot project using the Grace Framework CLI. After generation, navigate into the new project directory. ```Shell $ grace new my-awesome-bot $ cd my-awesome-bot ``` -------------------------------- ### Generate a New Grace Bot (Shell) Source: https://github.com/code-society-lab/grace-framework/wiki/Getting-Started This command uses the Grace CLI to generate a new Discord bot project named 'task-bot'. The 'grace new' command sets up the basic project structure and configuration files required for a new bot. ```Shell $ grace new task-bot ``` -------------------------------- ### Grace Framework Bot Successful Connection Output Source: https://github.com/code-society-lab/grace-framework/wiki/Getting-Started This is the expected output when the Grace Framework bot connects successfully to Discord. It includes details like the Discord.py version, PID, environment, database usage, and confirmation that the bot is online and ready. ```bash [2025-04-18 01:22:25] development _show_application_info cli INFO | Discord.py version: 2.5.2 | PID: 895923 | Environment: development | Syncing command: True | Using database: task_bot_development.db with sqlite [2025-04-18 01:22:25] development __init__ selector_events DEBUG Using selector: EpollSelector 2025-04-18 01:22:25 WARNING discord.ext.commands.bot Privileged message content intent is missing, commands may not work as expected. [2025-04-18 01:22:25] development _async_setup_hook bot WARNING Privileged message content intent is missing, commands may not work as expected. 2025-04-18 01:22:25 INFO discord.client logging in using static token [2025-04-18 01:22:25] development login client INFO logging in using static token [2025-04-18 01:22:26] development setup_hook bot WARNING Syncing application commands. This may take some time. 2025-04-18 01:22:26 INFO discord.gateway Shard ID None has connected to Gateway (Session ID: 79ad3f472e8e83f31ee61a522a38150f). [2025-04-18 01:22:26] development received_message gateway INFO Shard ID None has connected to Gateway (Session ID: 79ad3f472e8e83f31ee61a522a38150f). [2025-04-18 01:22:28] development on_ready task_bot INFO TaskBot:#123456789123456789 is online and ready to use! ``` -------------------------------- ### Configure Bot Token Source: https://github.com/code-society-lab/grace-framework/blob/main/README.md Sets the Discord bot token by editing the `.env` file in the project directory. Replace 'YOUR TOKEN' with your actual bot token. ```Shell DISCORD_TOKEN=YOUR TOKEN ``` -------------------------------- ### Configure Discord Token for Grace Framework Source: https://github.com/code-society-lab/grace-framework/wiki/Getting-Started This snippet shows how to set the Discord bot token in the `.env` file, which is essential for the Grace Framework bot to communicate with Discord. The token is obtained from a Discord application. ```shell DISCORD_TOKEN=Past your token here ``` -------------------------------- ### Run Pytest for Grace Framework Source: https://github.com/code-society-lab/grace-framework/blob/main/CONTRIBUTING.md This command runs the pytest test suite for the Grace Framework. Ensure all tests pass before submitting a pull request. ```Shell pytest ``` === COMPLETE CONTENT === This response contains all available snippets from this library. No additional content exists. Do not make further requests.