galnir / Master-Bot

A Discord music bot and dashboard with slash commands, playlist support, Spotify, music quiz, saved playlists, lyrics, gifs and more
MIT License
464 stars 373 forks source link

Chat Gpt Command working #786

Closed Ka1-S closed 1 year ago

Ka1-S commented 1 year ago

I made a command where it uses chatgpt, sorry for the 20 commits, please ignore

Bacon-Fixation commented 1 year ago

Howdy @Ka1-S, I hope you don't mind that I remade your PR, it seems that this one includes way more than just the chatGPT command, and I just boiled it down to only the ChatGPT command. Also a couple of revisions other than translating it to English (also looking into how to add localizations, possibly) Deferred the Reply, then edited the reply when response was received, not include the command to the registry if OPEN_API is not filled out in the .env (makes it optional)

Much Love -Bacon

Ka1-S commented 1 year ago

I made some small changes so that it splits the message block into two if the request to the chat GPT is greater than 2000 characters, which is the maximum that a Discord bot can send. So, I made a new PR. Sorry, I don't know how to fix my PR to include only the CHAT PT command. I have already translated it into English to reduce the necessary changes. Thank you very much, BACON <3.

Bacon-Fixation commented 1 year ago

Added your changes to the #788

not exactly sure how to remove the other 100 file changes from this PR, so I have just been moving your changes to a clean PR, I hope you don't mind

re-included the deferReply() and editReply() for the first message if response is over 2000 characters or if the response was under 2000 characters, to remove The application did not respond message that appears above commands response in the discord channel

Much Love -Bacon

galnir commented 1 year ago

I'm closing this for #788 but @Ka1-S the credit is all yours