scarletcafe / jishaku

A debugging and testing cog for discord.py rewrite bots.
https://jishaku.readthedocs.io/en/latest/
MIT License
541 stars 181 forks source link

Extra gateway intents when using debug entrypoint bot #123

Closed LostLuma closed 3 years ago

LostLuma commented 3 years ago

The Problem

Using python -m jishaku currently only enables the default intents, causing debugging that requires the members or presences intent to fail.

The Ideal Solution

Add extra cli arguments to enable these individually.

The Current Solution

Write a quick bot file which loads jishaku in order to debug.

Summary

Option to enable extra gateway intents in python -m jishaku.

ioistired commented 3 years ago

IMO it should include all of them, as a small bot can have them, right? or do you still have to enable them for small bots?

LostLuma commented 3 years ago

They have to be enabled on the bots application page in the developer portal beforehand.

Fetching which intents are enabled is not possible without starting a gateway connection and parsing the READY event, as the current application information endpoint does not include the flags key which shows whether they are enabled.

scarletcafe commented 3 years ago

I honestly probably should have just ripped the intents flagging system from my own debug script (on which this is based), which allows stacking of enable/disable flags for intents or intent groups (e.g. +all, -messages or such). I'll get around to it at some point.

LostLuma commented 3 years ago

I appreciate it, thank you!

scarletcafe commented 3 years ago

As in the commit, __main__ now accepts variadic arguments for intents or intent groups, so you can do e.g. python -m jishaku -- +all <token> for all intents, python -m jishaku -- +all -guild_messages <token> for everything but messages, python -m jishaku -- +presences <token> for the default with presences, etc etc. They're handled in the order you give them.