lucascprazeres / Alfred

Your personal butler on discord

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Alfred

Your personal butler on discord.

About

This is a fun purpose project made using nodejs with TypeScript. It uses the Discord.js library to connect with the discord api and interprete the given commands. Also, it consumes two external services to provide gif and news fetching!

Technologies

Implemented patterns and principles

  • Dependency Injection
  • S and D from SOLID

Commands

Currently, the bot only responds to these commands:

$gif searchTerm - which, of course, sends the fetched gif to the current channel

$news [--country] searchTerm - which fetches and retrives some links (max to 5) to headlines on news platforms

ps: the argumet --country should be replaced for a to etter representation of a country, such as us, br, uk and so forth. Besides, since it is optional, the default value is br, which fetch news on brazillian vehicles.

Project requirements

Connecting with external services is awesome, but it has it's trade-offs. If you check the .env.example file, you should find the necessary tokens to connect to those platforms. Make sure to get all of the listed keys and to create a .env file on the root dir to have access to the command functionalities.

Another quick note: this project uses dependency injenction to make it more flexible, so feel free to add your own providers

Besides, this project uses yarn as the dependency manager, so don't forget to install it.

HOWTO

To clone this project to your machine and download it's dependencies, you just have to run

git clone https://github.com/lucascprazeres/alfred

cd Alfred

yarn

Once you have done this and configured the environment variables as shown above, you're ready to go!

Run the project

# As a user
yarn tsc #builds the typescript code into regular js
yarn start

#OR, as a dev
yarn dev # initialize the dev server

The bot should then begin to react to your $ prefixed commands.

Contribute

Create your own branch on the project with

git checkout -b your-branch

Make your changes and send back to this repository

git add .
git commit -m 'tell me what have you done'
git push origin my-branch

Go back to the github repository page and create your pull request. I'll check it as soon as possible.

License

This project is under the MIT License. Consult the LICENSE file for further information.

Thanks!

If you liked the idea or it's implementation, don't forget to 🌟 this repository :)


Made with ❤️ by Lucas Prazeres

About

Your personal butler on discord

License:MIT License


Languages

Language:TypeScript 91.9%Language:JavaScript 7.2%Language:Shell 1.0%