|
|
|
@ -4,6 +4,7 @@ import { getProjects } from '../api';
|
|
|
|
|
import { getQuote } from '../api';
|
|
|
|
|
import { getReadme } from '../api';
|
|
|
|
|
import { getWeather } from '../api';
|
|
|
|
|
import { getPostsDevTo } from '../api';
|
|
|
|
|
|
|
|
|
|
export const projects = async (args: string[]): Promise<string> => {
|
|
|
|
|
const projects = await getProjects();
|
|
|
|
@ -34,3 +35,16 @@ export const weather = async (args: string[]): Promise<string> => {
|
|
|
|
|
const weather = await getWeather(city);
|
|
|
|
|
return weather;
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
export const posts = async (args: string[]): Promise<string> => {
|
|
|
|
|
const posts = await getPostsDevTo();
|
|
|
|
|
if (posts.length) {
|
|
|
|
|
return `My Latest posts on Dev.To:<br>${posts
|
|
|
|
|
.map(
|
|
|
|
|
(post) =>
|
|
|
|
|
` - <a class="text-light-blue dark:text-dark-blue underline" href="${post.url}" target="_blank">${post.title}</a>`,
|
|
|
|
|
).join('\n')}`;
|
|
|
|
|
} else {
|
|
|
|
|
return `I don't have any posts on Dev.to yet :(`;
|
|
|
|
|
}
|
|
|
|
|
};
|