-> Create a Listener
We're going to make the simplest possible listener - one that listens for movedCard
event and logs out the name of the card that moved.
#
Adding a New ListenerNavigate to the listeners page and click the "+" in the bottom right of the browser window.
#
Name Your ListenerCall this listener "myFirstListener". We know it's a bit weird that the first letter is lowercase and you can't have any spaces but it's just one of those things.
#
Choose "Trello" as the Listener TypeYou can also make a Listener that is a simple webhook but that's not what we're doing.
#
Choose "Moved" as the Event TypeWe're going to be listening for cards being moved so we choose the "moved" event first.
#
Choose "Card" as the Event ObjectSince cards are the only thing that can move on a Trello board, that's the only option.
#
We Generate Code for the EventTo save you looking up the docs, we write the code to listen for the movedCard
event. DO NOT include this code in your code again - we're just showing you so you know what to reference in your own code - the card
object in this case.
#
Log Out The Name of The CardWe could do anything here - literally anything you can do in Trello or with javascript on the web - but instead we're just going to log out the name of the card we just moved.
#
Choose Which Board to Listen ToThe boards your bot's Trello account is invited to will show up in this list. If the board you're looking for isn't here, make sure you have invited your bot to the board and also that you've logged into BenkoBot wih the right account.
#
Save It#
Open the Detail ViewIt might not be clear if this is your fist Listener, but the page you a directed to when you save is the list view showing all your Listeners. If you only have one then it is a list of one. You need to click the little "watch" icon to open the detail view of the Listener.
#
Turn on LoggingLike we did with the Action, we will need to toggle on logging so we can see the console.log
statement we wrote. You'll need to open the developer tools Console too.
#
Marvel At The OutputsiWith logging already toggled on, go to the board your Listener is listening to and move a card from one list to another. After a short delay, you should see the name of the card logged to the console.