示例#1
0
 async def set_prefix(self, ctx, prefix):
     data.add_prefix_mapping(ctx.guild.id, prefix)
示例#2
0
async def add_mapping(mapping: PrefixMapping, guildId: str):
    data.add_prefix_mapping(guildId, mapping.prefix)
    prefix = data.get_prefix(guildId)
    if not prefix:
        raise HTTPException(status_code=404, detail="Prefix not found")
    return {"guildId": guildId, "prefix": prefix}