<commit_before>// import { getDocument } from './lib/couchdb';
// getDocument('3cfc9a96341c0e24')
//   .then(d => console.log(d))
//   .catch(d => console.log(d))

export default (bot) => {
  return async (payload, reply) => {
    let text = payload.postback.payload;

    try {
      const profile = await bot.getProfile(payload.sender.id);
      await reply({
        attachment: {
          type: 'template',
          payload: {
            template_type: 'button',
            text: 'EBudgie needs to log you',
            buttons: [{
              type: 'account_link',
              url: process.env.LOGIN_URL
            }]
          }
        }
      });
      console.log(`Postback to ${profile.first_name} ${profile.last_name}: ${text}`);
    } catch (e) {
      console.log('ERROR in bot.on(\'postback\')', e);
    }
  };
};<commit_msg>Change the template for account linking<commit_after>// import { getDocument } from './lib/couchdb';
// getDocument('3cfc9a96341c0e24')
//   .then(d => console.log(d))
//   .catch(d => console.log(d))

export default (bot) => {
  return async (payload, reply) => {
    let text = payload.postback.payload;

    try {
      const profile = await bot.getProfile(payload.sender.id);
      await reply({
        attachment: {
          type: 'template',
          payload: {
            template_type: 'generic',
            elements: [{
              title: 'EBudgie needs to log you',
              image_url: 'https://petersfancybrownhats.com/company_image.png',
              subtitle: 'To see what is going on with your account you need to login first.',
              buttons: [{
                type: 'account_link',
                url: process.env.LOGIN_URL
              }]
            }]
          }
        }
      });
      console.log(`Postback to ${profile.first_name} ${profile.last_name}: ${text}`);
    } catch (e) {
      console.log('ERROR in bot.on(\'postback\')', e);
    }
  };
};
{'fraction_non_alphanumeric': 0.15202876219825373, 'fraction_numerical': 0.01027221366204417, 'mean_word_length': 1.9161676646706587, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 11, 'https://': 1, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '4968899', 'n_tokens_mistral': 607, 'n_tokens_neox': 593, 'n_words': 133}