ChaseCares / CCCogs

A collection of simple cogs, some are useful
GNU General Public License v2.0
1 stars 0 forks source link

TODO #1

Open ChaseCares opened 7 months ago

ChaseCares commented 7 months ago

Flame442 recommendations

Originally posted by @Flame442 in https://github.com/Cog-Creators/Red-Index/issues/126#issuecomment-1963373777

Flame442 commented 7 months ago

Is this different than the automatic inference of the current channel, e.g. [p]bbl add adds the current channel? Maybe we could also except a named channel?

If you still define a default value (like None), it will use that default value when the parameter is omitted, which you can test for to replace with the dynamic value for the current channel. You could also use commands.CurrentChannel as the default value (example) to have it default to the channel the command was executed in automatically.

Does this mean that if ctx.author.bot: return is also not required?

Within a command, it is not required, since bots cannot invoke commands. Within a listener, you do need to manually filter out bots (especially bot messages in on_message listeners).

ChaseCares commented 7 months ago

Amazing, thank you so much! I was leaving notes for myself so I would remember when I needed to do, I didn't mean to ping you.

I greatly appreciate your time and information.