In my discord bot, I have 2 commands do give and create roles. They work perfectly fine, but if the role name includes a space, I have an issue. It counts the second word to
You have a few options:
Use a role converter and require the role to be mentioned:
async def giverole(ctx, role: discord.Role, member: discord.Member):
Require the role to be wrapped in quotes:
k!giverole "Bot Tester" @user
Switch the positions of the two arguments so that the converted user comes first, and the potentially spaced name comes as the keyword-only argument.
async def giverole(ctx, member: discord.Member, *, rname):
I would recommend the first option, but you may want to try the others as well to see which one you prefer.