小编Gla*_*ung的帖子

如何在新的 .NET 6.0 中将 Main 方法更改为异步

我想将Main方法​​更改为async,但我不知道如何编辑此方法,因为它在 .NET 6.0 中是“不可见的”。我希望它看起来像这样:static async Task Main(string[] args)。那么我该如何编辑它呢?

c# asynchronous console-application main-method .net-6.0

9
推荐指数
1
解决办法
7424
查看次数

如何在discord.py中为命令参数添加描述?

假设我有这个命令:

@bot.command(description='command do some stuff')
async def somecommand(ctx: commands.Context, arg1:str, arg2:str = "hello"):
    await ctx.channel.send(arg1+arg2)
Run Code Online (Sandbox Code Playgroud)

当我调用 help command:!help somecommand或 ?help somecommand (取决于前缀)时
,它返回:

在此输入图像描述

如何为参数添加描述?

python bots discord discord.py

2
推荐指数
1
解决办法
3651
查看次数