Discord 不协调Python-多前缀

Discord 不协调Python-多前缀,discord,discord.py,discord.py-rewrite,Discord,Discord.py,Discord.py Rewrite,一次可以有多个前缀吗? 例子: @不协调机器人帮助 ;帮助(自定义前缀) 在dms中 \帮助 (我有一个工作前缀转换器和加载器) 如果有,请给我一个例子或修复我的坏代码 守则: import discord import json from discord import Embed from discord.ext import commands from discord.ext.commands import when_mentioned def get_prefix(client, me

一次可以有多个前缀吗? 例子: @不协调机器人帮助 ;帮助(自定义前缀) 在dms中 \帮助 (我有一个工作前缀转换器和加载器)

如果有,请给我一个例子或修复我的坏代码

守则:

import discord
import json

from discord import Embed
from discord.ext import commands
from discord.ext.commands import when_mentioned

def get_prefix(client, message):

    guild = message.guild

    if guild:

        with open('prefixes.json', 'r') as f:
            prefixes = json.load(f)

        return prefixes[str(int(message.guild.id))]

    elif not guild:
        return ','

    else:
        return when_mentioned(client, message)

client = commands.client(command_prefix=get_prefix)

@client.event
async def on_guild_join(guild):
    with open('prefixes.json', 'r') as f:
        prefixes = json.load(f)

    prefixes[str(int(guild.id))] = '//'

    with open('prefixes.json', 'w') as f:
        json.dump(prefixes, f, indent=4)

@client.event
async def on_guild_remove(guild):
    with open('prefixes.json', 'r') as f:
        prefixes = json.load(f)

    prefixes.pop(str(int(guild.id)))

    with open('prefixes.json', 'w') as f:
        json.dump(prefixes, f, indent=4)

@client.command()
async def prefix(ctx, *, prefix):
    with open('prefixes.json', 'r') as f:
        prefixes = json.load(f)

    prefixes[str(int(ctx.guild.id))] = prefix

    with open('prefixes.json', 'w') as f:
        json.dump(prefixes, f, indent=4)

@client.command()
async def ping(ctx):
    await ctx.send('pong')

@client.event
async def on_ready():
    print('ready')

client.run(token)

如果没有,请给我举个例子,谢谢你可以这样做

prefixes = ";", "/" 
bot = commands.Bot(command_prefix=prefixes)