Este é um robô do Discord que usa a API do GNews para pesquisar notícias de tecnologia e as envia para um canal especificado. 📰
- Pesquisa artigos de notícias sobre tecnologia utilizando a API do GNews;
- Envia artigos de notícias para um canal específico do Discord;
- Utiliza um prefixo (!) para acionar o comando
- Apaga o mensagem de comando após enviar as notícias
Para usar o robô, siga estas etapas:
- Instale as dependências executando
npm install discord.js axios dotenvno seu terminal.
- Crie um arquivo
.envna raiz do projeto e adicione as seguintes variáveis:
BOT_TOKEN=SEU_BOT_TOKEN
GNEWS_API_KEY=SEU_GNEWS_API_KEY
TARGET_CHANNEL_ID=SEU_TARGET_CHANNEL_IDVocê pode configurar o robô editando o arquivo bot.js. Você pode alterar os seguintes valores:
- PREFIX: O prefixo utilizado para acionar o comando (padrão é !)
- BOT_TOKEN: O token de bot do portal do Desenvolvedor do Discord
- GNEWS_API_KEY: A chave de API do GNews
- TARGET_CHANNEL_ID: O ID do canal donde você deseja enviar as notícias
- GNEWS_API_URL: A URL da API do GNews (padrão é
https://gnews.io/api/v4/search)
Substitua "SEU_BOT_TOKEN", "SEU_GNEWS_API_KEY" e "SEU_TARGET_CHANNEL_ID" pelos valores adequados para o seu robô.
- Execute
node bot.jspara iniciar o robô no terminal
O comando para acionar o robô é !nf. Isso pesquisará notícias de tecnologia e as enviará para o canal especificado.
As contribuições são bem-vindas! Se você gostaria de contribuir para o desenvolvimento deste robô, por favor faça um fork do repositório e suba una solicitação de pull com suas alterações.
Se por acaso você adora este projeto, deixe uma estrela no repo. Isso vai me manter motivado. Deixe-me saber sua opinião com a resposta. Clique Diego Melo.
Este projeto é licenciado sob a Licença MIT.
MIT License
Copyright (c) [2023] [Diego Melo]
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.