Skip to content

How to run eval commands on versions 2.25 and above

ContestedWheel edited this page Aug 12, 2025 · 6 revisions

You may notice that you cannot use the eval command when updating to Ballsdex versions 2.25 and above. This is because it is disabled by default, and you will need to enable it back in order to get the command back.

Caution

If you re-enable the eval command, you are responsible for what code you run. If you run code that is malicious, that's on you for not checking what it does before running it. I'm not saying to be cautious of every eval you run, as most of them are safe. However, if you think that the code you are going to run is malicious, it is best not to run it. Double check with the Ballsdex Developers server to see if an eval is safe to run. It's better to be safe than sorry.

Important

If you are on version 2.26.0 or above and try any eval that imports CountryBall by using from ballsdex.packages.countryballs.countryball import CountryBall, it will not work. This is because the spawner got reworked in 2.26.0 replacing the "CountryBall" class with "BallSpawnView" which is very different from the CountryBall class. You can either recode it yourself to work with BallSpawnView or you can ask someone else.

Tip

If you are doing this on a new bot, I recommend you do this before building the bot. That way, the bot will be built along with the --dev argument.

Re-enabling the eval command

  1. Turn off your bot using docker compose down if you haven't already.

  2. Open docker-compose.yml in your text editor.

  3. Find the line that says command: python3 -m ballsdex. It will be under the bot service.

  4. Add --dev at the end of the command. It should look like this:

command: python3 -m ballsdex --dev
  1. Save your changes and close the file. Do not start the bot up yet!

  2. Rebuild the bot using docker compose build. Once it is done building, turn on your bot using docker compose up -d.

You will now be able to run the eval command again.

How to run the eval command

If you don't know how to run the eval command, here is an example below:

image

Optionally, you can put the code itself in codeblock format to let you and other people read the code easier.

image
Clone this wiki locally