Kav-K / GPTDiscord

A robust, all-in-one GPT interface for Discord. ChatGPT-style conversations, image generation, AI-moderation, custom indexes/knowledgebase, youtube summarizer, and more!
MIT License
1.83k stars 301 forks source link

[BUG] Unable to set ALLOWED_GUILDS #41

Closed cooperlees closed 1 year ago

cooperlees commented 1 year ago

Describe the bug I added the new params to env and hit:

cooper@us:~$ docker run --name gpt3discord -v /containers/gpt3discord/env:/bin/.env -v /containers/gpt3discord/data:/data gpt3discord:latest
Traceback (most recent call last):
  File "/bin/gpt3discord", line 10, in <module>
    from cogs.draw_image_generation import DrawDallEService
  File "/usr/local/lib/python3.9/site-packages/cogs/draw_image_generation.py", line 18, in <module>
    ALLOWED_GUILDS = EnvService.get_allowed_guilds()
  File "/usr/local/lib/python3.9/site-packages/models/env_service_model.py", line 23, in get_allowed_guilds
    raise ValueError(
ValueError: ALLOWED_GUILDS is not defined properly in the environment file!Please copy your server's guild ID and put it into ALLOWED_GUILDS in the .env file.For example a line should look like: `ALLOWED_GUILDS="971268468148166697"`f

My env:

cooper@us:~/repos/GPT3Discord$ cat /containers/gpt3discord/env
DATA_DIR="/data"

OPENAI_TOKEN="NO"

DISCORD_TOKEN="NONO"

ALLOWED_GUILDS="811050810460078100"
ALLOWED_ROLES="Admin,gpt"
DEBUG_GUILD="811050810460078100"
DEBUG_CHANNEL="1058174617287663689"

To Reproduce Run from trunk with my config

Expected behavior Start and download the files ...

Close away if you're working on this. I found this trying to move to latest published docker containers via ansible.

MX10-AC2N commented 1 year ago

Thank @Hikari-Haru I can start my docker with docker run -d --name gpt3discord --env-file=/media/GPT3_Discord/env/.env -v /media/GPT3_Discord/data:/data kaveenk/gpt3discord:latest some modification in my .env for deleting the "

OPENAI_TOKEN=sk-qv6hl5xWCm~~~~~JzfOu5TybHHj3lCbKCgiO
DISCORD_TOKEN=MTA2MTcxN~~~~~g.GUuMPC.JNqMrcHny62rdifPr9VOXsaSvbHPEDtP6AWkgc
DEBUG_GUILD=106172~~~~09
DEBUG_CHANNEL=10618985~~~~22984
ALLOWED_GUILDS=1061722~~~~461609
ADMIN_ROLES=Admin,Owner
DALLE_ROLES=Admin,Openai,Dalle,Gpt
GPT_ROLES=Openai,Gpt
MODERATIONS_ALERT_CHANNEL=1061898~~~~22984
WELCOME_MESSAGE="Salut..! ~Bienvenue sur my Discord.~"

and I start my docker et can see my bot but now I don't have permission for /gpt converse or /system

cherryroots commented 1 year ago

It should be fixed properly after #53 is merged, there's another current bug not related to this for /gpt converse, remove self.awaiting_thread_responses.remove(thread.id) on line 1207 of gpt_3_commands_and_converser.py it's an older bug that snuck it's way in again with the recent permanent memory release @MX10-AC2N Permissions can also just be needing to reduce it to 1 role due to how messy the env parsing of docker is when removing quotes or remove the whole role lines to let anyone use it

Kav-K commented 1 year ago

53 has been merged and the bug with awaiting thread responses was also fixed, the docker instructions have been updated, big thanks to @justinmcp and @Hikari-Haru and @cooperlees for this