Unofficial Global Blacklist API Checker Discord Bot

image.png

Repository

https://github.com/anthonyadavisii/blacklist_check

New Projects

This code will allow you to run a Discord bot that is able to query the Steem Global Blacklist API created by witness @themarkymark. This is useful so users will know the blacklists that the abuser is yet to be added thus preventing duplication of efforts in reporting.

The relevant function is as follows:

@bot.command()
async def blacklist_check(user):
    """Queries blacklist status of user using @themarkymark's Blacklist API."""
    contents = urllib.request.urlopen("http://blacklist.usesteem.com/user/"+user).read()
    bl = (str(contents).split('"blacklisted":[')[1]).split(']')[0]
    if bl == '':
        await bot.say('@'+user+' is not on any blacklist tracked via the API')
        return
    else:
        blacklists = []
        bl = bl.split(',')
        for b in bl:
            blacklists.append(b.replace('"',''))
        await bot.say('@'+user+' is on the following blacklists: ')
        for b in blacklists:
            await bot.say(b)

More general information about the API:
@themarkymark/global-blacklist-api-2-0-released

  • Technology Stack

The following version of Discord.py created by Rapptz, API wrapper for Discord, was used and verified as functional for this project:

https://github.com/Rapptz/discord.py@rewrite#egg=discord.py[voice]

  • Roadmap

Was considering adding the AccountDoesNotExist exception from Beem but I am not sure if the benefit is worth having an additional dependency. Unless there is a compelling reason to do otherwise, think we will keep this as it as.

  • How to contribute?

I am on Discord (@anthonyadavisi#5095) and steem.chat (same as my Steem user) and am happy to add any improvements or you can simply add a pull request to the Github repo.

Example of command being used:

image.png

GitHub Account

https://github.com/anthonyadavisii

H2
H3
H4
Upload from PC
Video gallery
3 columns
2 columns
1 column
7 Comments