BlackList Json

Asked by At

i want to make a blacklist system for my bot in async... i want to use a json rather then a database im just really confused atm

async def blacklist(ctx, member: discord.Member = None):
    with open('blacklist.json', 'r')as f:
        users = json.load(f)
        if in users:
            await client.say("already blacklisted")
            with open('blacklist.json', 'w')as f:
                json.dump(users, f)
                if not in users:
                    users[] = {}
                await client.say(f"done!! {} has been blacklisted")```

0 Answers