2019-08-22 17:26:58 +02:00
|
|
|
|
export const searchCityTemplate = (data) => (
|
|
|
|
|
`==========
|
|
|
|
|
*Id*: ${data.id}
|
|
|
|
|
*City*: ${data.name}
|
|
|
|
|
*Country*: ${data.country}`
|
|
|
|
|
);
|
|
|
|
|
|
|
|
|
|
|
2019-08-26 17:48:40 +02:00
|
|
|
|
export const welcomeTemplate = () => (
|
|
|
|
|
`*Welcome to umbrello-bot* ☂ ️
|
|
|
|
|
|
|
|
|
|
An opensource telegram bot to know if you need to take the umbrella.
|
|
|
|
|
|
2020-03-01 23:43:01 +01:00
|
|
|
|
Made with ❤️ by @franjsco.
|
2019-08-26 17:48:40 +02:00
|
|
|
|
`
|
|
|
|
|
);
|
|
|
|
|
|
|
|
|
|
export const helpTemplate = () => (
|
|
|
|
|
`*umbrello-bot commands*:
|
|
|
|
|
/search {city name} - search city.
|
|
|
|
|
/set {city id} - set city id.
|
|
|
|
|
/get - get forecast.`
|
2019-08-22 17:26:58 +02:00
|
|
|
|
);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
export const errorTemplate = () => (
|
|
|
|
|
"*Ops*, there's a problem. Check the log."
|
|
|
|
|
);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
export const setLocationTemplate = (location) => (
|
|
|
|
|
`Location setted: ${location}`
|
|
|
|
|
);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
export const weatherTemplate = () => (
|
|
|
|
|
'Hey, today take the umbrella ☂️'
|
|
|
|
|
);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
export const weatherDetailsTemplate = (data) => {
|
|
|
|
|
let msg = `*Information:*
|
|
|
|
|
City: ${data.city}\n\n`;
|
|
|
|
|
|
|
|
|
|
msg += '*Details*:';
|
|
|
|
|
data.list.forEach((e) => {
|
|
|
|
|
msg += `
|
|
|
|
|
🕓 ${new Date(e.date).toLocaleTimeString()}
|
|
|
|
|
☔ ${e.rain_flag === 'Y' ? 'Yes' : 'No'}
|
|
|
|
|
🌡️ ${e.temperature}
|
|
|
|
|
----`;
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
return msg;
|
|
|
|
|
};
|