Skip to content

Commit

Permalink
Add links to badges, add other toasts
Browse files Browse the repository at this point in the history
  • Loading branch information
stephenyeargin committed Mar 26, 2024
1 parent ed3a37f commit e71708a
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 11 deletions.
6 changes: 3 additions & 3 deletions src/untappd-friends.js
Expand Up @@ -392,10 +392,10 @@ module.exports = (robot) => {
};
if (checkin.venue.venue_name) {
chunk.author_name = `${timeAgo} at ${checkin.venue.venue_name}`;
chunk.fallback = `${formatDisplayName(checkin.user)} earned the ${badge.badge_name} Badge after drinking a ${checkin.beer.beer_name} at ${checkin.venue.venue_name} - ${timeAgo}`;
chunk.fallback = `${formatDisplayName(checkin.user)} earned the ${badge.badge_name} Badge after drinking a ${checkin.beer.beer_name} at ${checkin.venue.venue_name} - ${timeAgo} - ${formatCheckinLink(checkin)}`;
} else {
chunk.author_name = `${timeAgo}`;
chunk.fallback = `${formatDisplayName(checkin.user)} earned the ${badge.badge_name} Badge after drinking a ${checkin.beer.beer_name} - ${timeAgo}`;
chunk.fallback = `${formatDisplayName(checkin.user)} earned the ${badge.badge_name} Badge after drinking a ${checkin.beer.beer_name} - ${timeAgo} - ${formatCheckinLink(checkin)}`;
}

contents.push(chunk);
Expand Down Expand Up @@ -648,7 +648,7 @@ module.exports = (robot) => {
});

// Toast checkins
robot.respond(/untappd (?:toast|toast|prost)\s?(.*)$/i, (msg) => {
robot.respond(/untappd (?:toast|toast|prost|salud|cheers|sant茅)\s?(.*)$/i, (msg) => {
if (!checkConfiguration(msg)) { return; }
toastRecentCheckins(msg);
});
Expand Down
8 changes: 4 additions & 4 deletions test/untappd-friends-slack_test.js
Expand Up @@ -200,7 +200,7 @@ describe('hubot-untappd-friends for slack', () => {
{
author_name: 'an hour ago at 49 脟ukurcuma',
color: '#7CD197',
fallback: 'heath (heathseals) earned the Beer Foodie (Level 44) Badge after drinking a Blonde Ale at 49 脟ukurcuma - an hour ago',
fallback: 'heath (heathseals) earned the Beer Foodie (Level 44) Badge after drinking a Blonde Ale at 49 脟ukurcuma - an hour ago - https://untappd.com/user/heathseals/checkin/578981788',
footer: 'Blonde Ale',
footer_icon: 'https://untappd.akamaized.net/site/beer_logos/beer-764911_07c43_sm.jpeg',
thumb_url: 'https://untappd.akamaized.net/badges/bdg_BeerFoodie_sm.jpg',
Expand All @@ -210,7 +210,7 @@ describe('hubot-untappd-friends for slack', () => {
{
author_name: 'an hour ago at 49 脟ukurcuma',
color: '#7CD197',
fallback: 'heath (heathseals) earned the 99 Bottles (Level 38) Badge after drinking a Blonde Ale at 49 脟ukurcuma - an hour ago',
fallback: 'heath (heathseals) earned the 99 Bottles (Level 38) Badge after drinking a Blonde Ale at 49 脟ukurcuma - an hour ago - https://untappd.com/user/heathseals/checkin/578981788',
footer: 'Blonde Ale',
footer_icon: 'https://untappd.akamaized.net/site/beer_logos/beer-764911_07c43_sm.jpeg',
thumb_url: 'https://untappd.akamaized.net/badges/bdg_99Bottles_sm.jpg',
Expand All @@ -220,7 +220,7 @@ describe('hubot-untappd-friends for slack', () => {
{
author_name: 'an hour ago at 49 脟ukurcuma',
color: '#7CD197',
fallback: 'heath (heathseals) earned the Pizza & Brew (Level 4) Badge after drinking a Blonde Ale at 49 脟ukurcuma - an hour ago',
fallback: 'heath (heathseals) earned the Pizza & Brew (Level 4) Badge after drinking a Blonde Ale at 49 脟ukurcuma - an hour ago - https://untappd.com/user/heathseals/checkin/578981788',
footer: 'Blonde Ale',
footer_icon: 'https://untappd.akamaized.net/site/beer_logos/beer-764911_07c43_sm.jpeg',
thumb_url: 'https://untappd.akamaized.net/badges/bdg_PizzaAndBrew_sm.jpg',
Expand All @@ -230,7 +230,7 @@ describe('hubot-untappd-friends for slack', () => {
{
author_name: '8 hours ago at DERALIYE OTTOMAN CUISINE',
color: '#7CD197',
fallback: 'heath (heathseals) earned the Beer Connoisseur (Level 8) Badge after drinking a Efes Pilsen at DERALIYE OTTOMAN CUISINE - 8 hours ago',
fallback: 'heath (heathseals) earned the Beer Connoisseur (Level 8) Badge after drinking a Efes Pilsen at DERALIYE OTTOMAN CUISINE - 8 hours ago - https://untappd.com/user/heathseals/checkin/578869664',
footer: 'Efes Pilsen',
footer_icon: 'https://untappd.akamaized.net/site/beer_logos/beer-EfesPilsener_17259.jpeg',
thumb_url: 'https://untappd.akamaized.net/badges/bdg_connoiseur_sm.jpg',
Expand Down
8 changes: 4 additions & 4 deletions test/untappd-friends_test.js
Expand Up @@ -166,10 +166,10 @@ describe('hubot-untappd-friends', () => {
try {
expect(selfRoom.messages).to.eql([
['alice', '@hubot untappd badges'],
['hubot', 'heath (heathseals) earned the Beer Foodie (Level 44) Badge after drinking a Blonde Ale at 49 脟ukurcuma - an hour ago'],
['hubot', 'heath (heathseals) earned the 99 Bottles (Level 38) Badge after drinking a Blonde Ale at 49 脟ukurcuma - an hour ago'],
['hubot', 'heath (heathseals) earned the Pizza & Brew (Level 4) Badge after drinking a Blonde Ale at 49 脟ukurcuma - an hour ago'],
['hubot', 'heath (heathseals) earned the Beer Connoisseur (Level 8) Badge after drinking a Efes Pilsen at DERALIYE OTTOMAN CUISINE - 8 hours ago'],
['hubot', 'heath (heathseals) earned the Beer Foodie (Level 44) Badge after drinking a Blonde Ale at 49 脟ukurcuma - an hour ago - https://untappd.com/user/heathseals/checkin/578981788'],
['hubot', 'heath (heathseals) earned the 99 Bottles (Level 38) Badge after drinking a Blonde Ale at 49 脟ukurcuma - an hour ago - https://untappd.com/user/heathseals/checkin/578981788'],
['hubot', 'heath (heathseals) earned the Pizza & Brew (Level 4) Badge after drinking a Blonde Ale at 49 脟ukurcuma - an hour ago - https://untappd.com/user/heathseals/checkin/578981788'],
['hubot', 'heath (heathseals) earned the Beer Connoisseur (Level 8) Badge after drinking a Efes Pilsen at DERALIYE OTTOMAN CUISINE - 8 hours ago - https://untappd.com/user/heathseals/checkin/578869664'],
]);
done();
} catch (err) {
Expand Down

0 comments on commit e71708a

Please sign in to comment.