Coder Social home page Coder Social logo

pieces-copilot-discord-bot's Introduction

Getting Started with the Pieces Copilot Discord Bot

This repository contains the source code for a Discord bot integrated with GitHub and Pieces OS Client SDK. Below are the instructions to set up and run the bot locally.

Prerequisites

Before you begin, ensure you have the following installed:

  • Node.js (version 18 or higher)
  • npm or pnpm (as the package manager)

Installation

  1. Clone the Repository

    Start by cloning the repository to your local machine:

    git clone https://github.com/mason-at-pieces/pieces-copilot-discord-bot.git
    cd pieces-copilot-discord-bot
  2. Install Dependencies

    Install the necessary Node.js dependencies using pnpm:

    pnpm install

Configuration

You need to set up several environment variables before running the bot. Create a .env file in the root directory of the project and add the following variables:

DISCORD_BOT_TOKEN=your_discord_bot_token
DISCORD_CLIENT_ID=your_discord_client_id
PIECES_CLIENT_BASE_URL=your_pieces_client_base_url
GITHUB_PERSONAL_TOKEN=your_github_personal_token

Replace your_discord_bot_token, your_discord_client_id, your_pieces_client_base_url, and your_github_personal_token with your actual credentials.

Obtaining Tokens and IDs

  • Discord Bot Token and Client ID:

    • Go to the Discord Developer Portal.
    • Create a new application and navigate to the 'Bot' section to add a bot.
    • Here you can find your Client ID and generate a new Bot Token.
  • Pieces Client Base URL:

    • If you are on macOS or Windows, you can run the Pieces OS Client SDK locally and use http://localhost:1000 as the base URL.
    • If you are on linux, you can run the Pieces OS Client SDK locally and use http://localhost:5323 as the base URL.
    • This can also be a remote URL if you are using a hosted version of the Pieces OS Client SDK.
  • GitHub Personal Token:

    • Visit GitHub Tokens page.
    • Generate a new token with the scopes of the repositories you want your bot to access.

Running the Bot

To run the bot in development mode, use the following command:

pnpm dev

This will start the bot using nodemon, which will automatically restart the bot if you make any changes to the source code.

Building the Project

To compile the TypeScript code to JavaScript and prepare it for production, run:

pnpm build

This command compiles the code and outputs it to the dist directory.

Starting the Bot in Production

After building the project, you can start the bot in production mode:

pnpm start

This will run the compiled JavaScript code located in the dist directory.

Additional Information

  • Make sure to invite the bot to your Discord server using the appropriate OAuth2 URL, which can be generated in the Discord Developer Portal under the OAuth2 section.
  • Configure the necessary permissions for the bot depending on what actions it needs to perform.
    • TODO: Need to document the required permissions for the bot.

Support

For further assistance or to report issues, refer to the repository's issues section or contact the repository maintainers.


By following these instructions, you should be able to get the Discord bot up and running smoothly in your development environment.

pieces-copilot-discord-bot's People

Contributors

masnwilliams avatar

Stargazers

Marc G avatar Ferdinand Davidenko avatar

Watchers

Mason Williams avatar

pieces-copilot-discord-bot's Issues

Bot loading and not responding

Bot is just loading while it should say "This version of MEE6 AI characters has been deprecated." as the base Mee6 bot does. I can still run commands, but the loading message stays there

Was this for 10+ minutes:
Screenshot 2024-06-04 at 4 17 10 PM
Then:
Screenshot 2024-06-04 at 4 22 15 PM

I would say it's a non issue right now, but once you add more features then it might cause some issues if it continues to try and load a different command while also running others.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.