Python 在获取通道函数中未定义公会?

Python 在获取通道函数中未定义公会?,python,discord.py,Python,Discord.py,这是我的代码,但当我运行命令时,我得到以下错误: test2中的第43行“/Users/jbvann05/Documents/ColtsTARBot/bot.py” 通道=机器人获取通道(706573119325995109) 名称错误:未定义名称“帮会” 我该如何解决这个问题?还有更多的代码,如发送消息,但它不希望我使用太多的代码 @bot.command(pass\u context=True) @commands.has_角色(724348979533316115) 异步def测试2(c

这是我的代码,但当我运行命令时,我得到以下错误:

test2中的第43行“/Users/jbvann05/Documents/ColtsTARBot/bot.py” 通道=机器人获取通道(706573119325995109) 名称错误:未定义名称“帮会” 我该如何解决这个问题?还有更多的代码,如发送消息,但它不希望我使用太多的代码

@bot.command(pass\u context=True)
@commands.has_角色(724348979533316115)
异步def测试2(ctx):
服务器=ctx.message.guild
通道=机器人获取通道(706573119325995109)
member=server.get_成员(449692646315786240)
role=discord.utils.get(server.roles,name='Leg 1 Pitstop')
member=server.get_成员(643885922240430091)
等待成员。添加_角色(角色)

我会尝试使用
fetch
函数,这些函数是异步函数,将返回所需的对象

@bot.command(pass\u context=True)
@commands.has_角色(724348979533316115)
异步def测试2(ctx):
服务器=ctx.message.guild
#异步获取文本通道。
通道=等待bot.fetch_通道(706573119325995109)
#异步获取成员。
member=wait server.fetch_成员(449692646315786240)
role=discord.utils.get(server.roles,name='Leg 1 Pitstop')
#异步获取成员。
member=wait server.fetch_成员(643885922240430091)
等待成员。添加_角色(角色)
fetch\u成员
函数:

fetch\u channel
函数:

bot.get\u channel()方法需要哪些参数?有关整个问题的更多上下文以及代码的作用也会有所帮助