@guild.command(pass_context=True)
async def create(self, ctx, name: str):
"""Create a guild for 70,000 gold."""
user = ctx.message.author
if user.id not in dev_list:
await self.bot.say(":no_entry: This command is under constrction.")
return
guildmake = 0
guildhash = random.randint(1000, 9999)
userinfo = fileIO("data/alcher/users/{}/info.json".format(user.id), "load")
userguild = fileIO("data/alcher/guilds/guilds.json", "load")
if userinfo["gold"] >= 0:
if user.id not in userguild:
userguild[user.id] = [name, guildhash]
userinfo["gold"] = userinfo["gold"] - guildmake
fileIO("data/alcher/guilds/guilds.json", "save", userguild)
给我这个:
Error in command 'guild create' - TypeError: list indices must be integers or slices, not str
userguild[user.id]=[name,guildhash]<;这给了我一个错误。它告诉我我不能用绳子
有人能帮帮我吗
目前没有回答
相关问题 更多 >
编程相关推荐