Example #1
0
async def user(ctx, id):
    try:
        query = api.get_single_contributor(id)
        message = printer.user(query)
    except:
        message = printer.not_found(error.format("user"))

    await ctx.send(embed=message)
Example #2
0
async def cve(ctx, id):
    try:
        query = api.get_topics(name=id)
        message = printer.topic(query[0])
    except:
        message = printer.not_found(error.format("CVE"))

    await ctx.send(embed=message)
Example #3
0
async def topic(ctx, id):
    try:
        query = api.get_single_topic(id)
        message = printer.topic(query)
    except:
        message = printer.not_found(error.format("topic"))

    await ctx.send(embed=message)
Example #4
0
async def query(ctx, *, keywords):
    try:
        query = api.get_topics(q=keywords, size=queryMaxTopics)
        message = printer.topic_list(keywords, query, queryMaxTopics)
    except:
        message = printer.not_found(error.format("query"))

    await ctx.send(embed=message)
Example #5
0
async def assessment(ctx, id):
    try:
        query = api.get_single_assessment(id)

        author_name = api.get_single_contributor(query["editorId"])["username"]
        topic_name = api.get_single_topic(query["topicId"])["name"][:15]

        message = printer.assessment(query, author_name, topic_name)
    except:
        message = printer.not_found(error.format("assessment"))

    await ctx.send(embed=message)