예제 #1
0
파일: main.py 프로젝트: Vulom/PilavBot
 def prefix(bot, ctx):
     try:
         guildId = ctx.guild.id
         return data.get_prefix(guildId) or default_prefix
     except:
         return default_prefix
예제 #2
0
async def read_mapping(guildId: str):
    prefix = data.get_prefix(guildId)
    if not prefix:
        raise HTTPException(status_code=404, detail="Prefix not found")
    return {"guildId": guildId, "prefix": prefix}
예제 #3
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}
예제 #4
0
def prefix(_, ctx):
    try:
        return data.get_prefix(ctx.guild.id) or default_prefix
    except:
        return default_prefix