engineer-man / piston-bot

I Run Code bot on Discord
https://emkc.org/run
MIT License
239 stars 35 forks source link

Fix #64 #65

Closed PetitPotiron closed 2 years ago

PetitPotiron commented 2 years ago

I changed the discord.py version (in the requirements.txt file) from stable to latest (needed to support threads (issue #64)).

brtwrst commented 2 years ago

I don't understand why you mean with support threads?

What exactly will be the effect of this PR?

PetitPotiron commented 2 years ago

The threads are new in discord. They can be thought of as temporary sub-channels inside an existing channel, to help better organize conversation in a busy channel. More info here. The problem is : Threads are only available in API v9. Bots that do not update to API v9 will not receive most gateway events for threads, or things that happen in threads (such as Message Create). As the latest stable version of discord.py isn't on api v9, it doesn't support threads. It's a very big problem for a bot like this, e.g. I have a help channel in my server, every help request is on a new thread to keep it organized. The problem is, I Run Code doesn't support threads, so if I want to show people some code, it doesn't work.

Now, what does that PR changes? This PR changes the discord.py version to the latest, which uses api v9, so it receives all the gateway events related to threads.

PetitPotiron commented 2 years ago

Here's discord doc about threads

brtwrst commented 2 years ago

Discord.py v2.0 introduces a few breaking changes https://gist.github.com/apple502j/f75b4f24652f04de85c7084ffd73ec58 that already messed with some of our internal commands of the bot - if anything else breaks in production I will have to revert this.

brtwrst commented 2 years ago

I have included your change in my commit https://github.com/engineer-man/piston-bot/commit/c878d8e5795eb9a14af425d8a5260ec094d76246

It will take some time to deploy the changes