/CozeDiscord

A way to use chatgpt4 for free by proxying DiscordBot to talk to CozeBot.

Primary LanguagePython

CozeDiscord

A way to use ChatGpt4 for free by simulating communication behavior with CozeBot through a proxy Discord user.

Description

CozeDiscord, a project that allows you to use chatgpt4 for free. Coze is a project that allows us to use chatgpt4 models for free. After creating a new bot in Coze, you can publish it to Discord. At this point, we can then use the discord.py repository to implement a DiscordBot that can create channels, send messages, and receive replies. We can then use this bot to send messages to the CozeBot and get replies from it, in order to use chatgpt4 for free!

Functionality

  • Create a new channel in the server
  • Send a message to CozeBot on the specified channel.
  • Support AI drawing
  • Interfacing with CozeDiscordFrontend
  • Other (under development)

Api Document

  • Create a new channel

    /api/channel/create

    Request MethodsPOST

    Parameters:

    • Content-Type: application/json
    • Body:
      {
        "channel_name": "test_channel"
      }

    Example:

    ~/CozeDiscord$ curl -X POST -H "Content-Type: application/json" -H "token: nanomoa" -d '{"channel_name": "test_channel"}' http://127.0.0.1:5000/api/channel/create
    {"code":1,"data":{"channel_id":1200000000000000053,"channel_name":"test_channel"},"message":"Create channel success."}
    
  • Delete channel

    /api/channel/delete

    Request MethodsPOST

    Parameters:

    • Content-Type: application/json
    • Body:
      {
        "channel_id": 1200000000000023
      }

    Example:

    ~/CozeDiscord$ curl -X POST -H "Content-Type: application/json" -H "token: nanomoa" -d '{"channel_id": 1200000000000023}' http://127.0.0.1:5000/api/channel/delete
    {"code":1,"message":"Delete channel success."}
    
  • Send a message and get a reply

    /api/chat/send

    Request Methods: POST

    Parameters:

    • Content-Type: application/json

    • Body:

      {
        "channel_id": 1200000000000000086
        "message": "test"
      }

      Example:

    ~/CozeDiscord$ curl -X POST -H "Content-Type: application/json" -H "token: nanomoa" -d '{"channel_id":1200000000000000086,"message":"test"}' http://127.0.0.1:5000/api/chat/send
    {"code":1,"data":{"message":"Hello! How can I assist you today? If you need to test something or have any questions, feel free to ask."},"message":"Send message success."}
    

Usage

  1. Go to the Discord Developer Platform
  2. Create a new app and copy the token.
  3. Go to Coze
  4. Create a new bot and install the DALLE 3 plugin on it.
  5. Publish the bot to Discord and add it to your server
  6. Create a new Discord app and give it administrator rights.
  7. Add it to your server
  8. then configure the project's config.yaml file
  9. Install all the libraries and run the project
  10. After it finishes running you will see the command line output Logged in as {your bot's name}.

People who starred this github repository!

Stargazers repo roster for @Nanomoa/CozeDiscord

Express gratitude (esp. in public)

Coze: Next-generation AI chatbot building platform.

Discord: A community for gaming, learning, music and more.

discord.py: An API wrapper for Discord written in Python.