我目前正在编写一个不和谐的机器人,它允许你和其他人一起玩扑克。不幸的是,错误出现了:模块'discord‘没有'Channel’属性。还有人能进一步帮助我吗?非常感谢!诚挚的问候
代码:
from collections import namedtuple
from typing import Dict, List
import discord
from game import Game, GAME_OPTIONS, GameState
POKER_BOT_TOKEN = "My_Token"
client = discord.Client()
games: Dict[discord.Channel, Game] = {}
...发布于 2021-03-09 05:35:50
回溯完全解释了这个问题。Channel不是一个已知的不和谐模型。
如果你的机器人将在文本通道中运行,你可以使用discord.TextChannel。
https://discordpy.readthedocs.io/en/latest/api.html#discord-models
https://stackoverflow.com/questions/66537305
复制相似问题