Skip to content

Using Copilot and Bing Image Creator on discord bot.

License

Notifications You must be signed in to change notification settings

Zaazu/DiscordBot-EdgeGPT

 
 

Repository files navigation

DiscordBot-EdgeGPT

Using Copilot and Bing Image Creator on discord bot.

demo

Update

2024/2/2:To optimize usage, recommended to re-read the README.

2024/1/27:Add jail break version, but image uploads are currently not supported, and python version need 3.10+.

2024/1/15:Can create thread to chat with Copilot.

2023/12/22:Support uploading image while chatting.

Features

Slash command

will create a separate chat for each user.

  • cookies setting(can use personal Bing Cookies): /cookies setting [cookies_file] [auth_cookie]

  • copilot: /copilot [version] [style] [type]

    • A separate thread will be created.
      • [version]:default can chat with Copilot, jailbreak chat with Sydney, but jailbreak image uploads are not currently supported.
      • [style]:Have 3 conversation style can choose, creativebalanced and precise.
      • [type]:Options for thread type, public or private.

    copilot

  • bing image creator: /create image [prompt]

    bingimage.png

  • reset conversation: /reset conversation

    reset

Mention bot

same function as the slash command, but this will reply all user messages.

  • If only the bot is mentioned, you will get a drop-down list of settings.

    dropdown1 dropdown2 mention1

Prefix command (available only to bot owner)

bot owner setting.

  • !unload [file_name_in_cogs_folder]: Disable command from the specified file.

  • !load [file_name_in_cogs_folder]: Enable the command from the specified file.

    load & unload

  • !clean: Empty discord_bot.log file.

  • !getLog: Get discord_bot.log file. Real-time tracking of the bot's operating status.

    getLog

  • !upload [.txt_file]: Same as /cookies setting, but for default cookies and auth_cookie.

    upload

Install

pip install -r requirements.txt

Usage

  1. Rename the file.env.devto.env, then open it and edit it.

    # input your Discord bot token
    DISCORD_BOT_TOKEN=
    
    IMAGE_TIMEOUT=300
    IMAGE_MAX_CREATE_SEC=300
    
    # Get from https://bing.com/, and copy the value from the _U, not necessary to set.
    AUTH_COOKIE=
    
    # Allow mention bot only in specific channel, if you don't set it, just default to all channels.
    MENTION_CHANNEL_ID=
    
    # Allow each commands only in specific channel, if you don't set it, just default to all channels.
    # specific channel for /cookies setting
    SETTING_CHANNEL_ID=
    
    # specific channel for /copilot
    CHAT_CHANNEL_ID=
    
    # specific channel for /create image
    CREATE_IMAGE_CHANNEL_ID=
    
    # specific channel for /reset conversation
    RESET_CHAT_CHANNEL_ID=
    
    # specific channel for /help
    HELP_CMD_CHANNEL_ID=
  2. It is not necessary to create the cookies.json file, but if you do, there will be more conversation.

    • Install the cookie editor extension for Chrome or Firefox.
    • Go to copilot.microsoft.com
    • Click "Export" on the bottom right.
    • Paste your cookies into a file cookies.json
  3. Start run your bot, hosted locally or on a server.

    -> Recommended Free Servers: fly.io

Credits

Contributors

This project exists thanks to all the people who contribute.

Star History

Star History Chart

About

Using Copilot and Bing Image Creator on discord bot.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Python 99.8%
  • Dockerfile 0.2%