Ejemplo n.º 1
0
async def remove_keyword(ctx, *arg):
    keyword = " ".join(arg)

    con = mysql.connector.connect(**con_info)
    num_removed = remove(con, "keywords_users", ["user_id", "keyword_id"],
                         [ctx.message.author.id, keyword])
    con.close()

    if num_removed != 0:
        await ctx.send(f"Done! I removed **{keyword}** from your Keywords.")
    else:
        await ctx.send(f"Oh Nyo! I couldn't find **{keyword}**....")
Ejemplo n.º 2
0
def remove_from_table(table_name, column, value):
    logging.info(
        f'{str(datetime.datetime.now())}: Removing {value} from {table_name}')
    con = psycopg2.connect(DATABASE_URL, sslmode='require')
    remove(con, table_name, column, value)
    con.close()