def react(r, ctx, ui, valids=None):
    """Check if the reaction is on the correct message, and is by the same author."""
    return (r[0].message.id, r[1]) == (ui.id, ctx.author) and (valids is None or r[0].emoji in valids)