0

I want to know what does asterisk do as a parameter in ban_user function?. In which situations do we use it? What's its advantage against *args?

import discord
from discord.ext import commands


intents = discord.Intents(messages=True, guilds=True, reactions=True, members=True,presences=True)


client = commands.Bot(command_prefix="!dc ", intents=intents)


@client.command(aliases=["ban"])
@commands.has_role("admin")

async def ban_user(ctx, member: discord.Member, *, reason=None):
    await member.ban(reason=reason)

client.run(Token)
Timothy G.
  • 6,335
  • 7
  • 30
  • 46
hARASİVa
  • 15
  • 5

1 Answers1

0

It makes it so all content/provided args after member count as the reason. basically just specify's that all following words are also part of the reason argument.

Anthony D
  • 36
  • 4