async def add(ctx, user: discord.Member, delta: int): if not (ctx.author.id in admin_ids): return member = Member(user) prev_point = member.get_point() member.set_point(prev_point + delta) await ctx.send( f"Successfully added {delta} points to {user.display_name}, now {member.get_point()}" ) return
async def force_setup(ctx, user: discord.Member, point, combo): if not (ctx.author.id in admin_ids): return member = Member(user) prev_point = member.get_point() prev_combo = member.get_combo() member.set_point(point) member.set_combo(combo) await ctx.send( "{:s}'s point and combo changed: {:d}, {:d} -> {:d}, {:d}".format( member.name, prev_point, prev_combo, point, combo)) return
async def api_point_add(ctx, user: discord.Member, delta: int): member = Member(user) if not member.exist_db(): await ctx.channel.send("등록되지 않은 사용자입니다.") return prev_point = member.get_point() if (prev_point + delta < 0): await ctx.send("점수가 부족합니다.") return member.set_point(prev_point + delta) if (delta >= 0): await ctx.send( f"{user.display_name}에게 {delta}점이 추가되었습니다. 이제 {member.get_point()}점입니다." ) else: await ctx.send( f"{user.display_name}이 {-delta}점 잃었습니다. 이제 {member.get_point()}점입니다." ) return