Jintaku / Jintaku-Cogs-V3

V3 Cogs made by the Jintaku community
GNU Affero General Public License v3.0
39 stars 39 forks source link

Roleplay - mention multiple users #53

Open Sandvich opened 3 years ago

Sandvich commented 3 years ago

Hi!

I think it'd be great to be able to mention multiple users in the roleplay commands without Red complaining that multiple users aren't a single user :p

I can code this myself, in theory, but I've not done any RedBot dev before. So I could do with a little bit of clarification, if that's okay? To take the cuddle command as an example:

    @commands.command()
    @commands.bot_has_permissions(embed_links=True)
    async def cuddle(self, ctx, *, user: discord.Member):
        """Cuddles a user!"""

        author = ctx.message.author
        images = await self.config.cuddle()
   -snip-

I'm guessing the , user: discord.Member will ensure that only a single member is returned, but if I were to remove that type annotation, would it give me a string that I can then convert to multiple members? Is there another approach that you can suggest?

I might also look into removing some of the duplicate code in that file, there's a fair bit of it. But that's probably a thought for another day :)

lionirdeadman commented 3 years ago

That would be cool, for sure. I think from a design perspective, it should have a way to classify how many people are present in a picture to give an accurate picture based on the amount of people are mentioned. :thinking:

I don't think much of the duplicate code can be removed because of how Red handles commands.

Sandvich commented 3 years ago

See, I thought about that initially, but I concluded that it wasn't worth the effort because the rotation of gifs for any given command would become a bit too small, I think. Maybe if we found a bunch more gifs it'd be worth doing though :)

As for duplication, I think potentially a decorator would allow us to do that. But I must confess, I've got little experience with decorators. Still, it's worth a try imo ^^