【发布时间】:2021-10-23 08:24:09
【问题描述】:
我想知道星号作为ban_user函数的参数有什么作用?。我们在哪些情况下使用它?它对 *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)
【问题讨论】:
-
@luk2302 哦,是的,谢谢
标签: python discord.py