Skip to content

Commit

Permalink
refactor: apply few changes on readme files
Browse files Browse the repository at this point in the history
  • Loading branch information
Robso-creator committed Feb 6, 2024
1 parent 3152d96 commit 21bbdcf
Show file tree
Hide file tree
Showing 2 changed files with 93 additions and 39 deletions.
87 changes: 57 additions & 30 deletions docs/README-en.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,78 +3,105 @@
[![pytest](https://img.shields.io/badge/pytest-enabled-brightgreen?logo=pytest&logoColor=#0A9EDC)](https://docs.pytest.org/en/7.4.x/)

# Discord Bot
<sub>Não fala inglês? [Clique aqui](https://github.com/Robso-creator/discord_bot/blob/main/README.md) para ver esta página em português</sub>

This is a Discord bot project developed in Python that offers a variety of features to enhance the user experience on Discord servers. The bot was created to be flexible, user-friendly, and expandable, allowing customization of commands and integration with other services.
<sub>Don't speak Portuguese? [Click here](https://github.com/Robso-creator/discord_bot/blob/main/README-en.md) to view
this page in English</sub>

Commands documentation available [here](https://robso-creator.github.io/discord_bot/commands/)
This is a Discord bot project developed in Python that offers a variety of features to enhance the user experience on
Discord servers. The bot was created to be flexible, user-friendly, and expandable, allowing customization of commands
and integration with other services.

# Table of Contents
Documentation of commands is available [here](https://robso-creator.github.io/discord_bot/commands/)

* [Generating Required Tokens](#generating-required-tokens)
* [Creating a Discord Bot Account](#creating-a-discord-bot-account)
* [Generating NASA API Authentication Token](#generating-nasa-api-authentication-token)
# Summary

* [Creating Necessary Tokens](#creating-necessary-tokens)
* [Generate bot account on Discord](#generate-bot-account-on-discord)
* [Generate NASA API authentication token](#generate-nasa-api-authentication-token)
* [Setup & Launch](#setup-&-launch)

# Generating Required Tokens
# Creating Necessary Tokens

For the bot to function properly, some tokens need to be provided. Below you can understand how to generate them.

For the bot to function properly, some tokens need to be provided. Below, you can understand how to generate them.
## Generate bot account on Discord

## Creating a Discord Bot Account
<sub>Step-by-step from [freecodecamp](https://www.freecodecamp.org/portuguese/news/tutorial-de-criacao-de-bot-para-o-discord-em-python/)</sub>
<sub>Step by step guide
from [freecodecamp](https://www.freecodecamp.org/portuguese/news/tutorial-de-criacao-de-bot-para-o-discord-em-python/)</sub>

1. Be logged into the [platform](https://discord.com/);
2. Access the [developer page](https://discord.com/developers/applications);
3. Click on the "New Application" button in the top right corner:<br>
![img.png](../static/new_application_img.png)
4. Go to the "Bot" tab and click "Add Bot";

1. Be logged into the [platform](https://discord.com/).
2. Access the [developer portal](https://discord.com/developers/applications).
3. Click on the "New Application" button in the upper right corner:
![img.png](../static/new_application_img.png)
4. Go to the "Bot" tab and click "Add Bot".
> Keep the default settings for Public Bot (checked) and Require OAuth2 Code Grant (unchecked).
5. Copy the Token; it will be used for bot authentication.
## Generating NASA API Authentication Token
5. Copy the Token, it will be used for authenticating your bot.<br>
6. While you're at it, on the same page, click "OAuth2" and select "bot"

> In this step, we're going to add the bot to your server.
<sub>This token is not mandatory; for testing, the DEMO_KEY is sufficient.</sub>
<sub>With authentication, the API rate limit increases significantly.</sub>
7. Then choose the permissions you want to give to your bot, for the default of this repository only text message
permissions are sufficient.
8. Click the 'copy' button above the permissions and paste it into your browser, select the server you want to add the
bot to and then click "Authorize"

## Generate NASA API authentication token

<sub>This token is not mandatory, for testing purposes only the DEMO_KEY is sufficient.</sub>
<sub>With authentication, the hit limit on the API increases dramatically</sub>

1. The first thing to do is to request the [generation of your token](https://api.nasa.gov/) for access to the space
agency's API;
2. After filling in the form fields with your first name, last name, and email address, your token will be sent to the
provided email address;
3. Copy the Token, it will be used to authenticate the NASA API.

1. Request the [generation of your token](https://api.nasa.gov/) for access to the space agency's API.
2. After filling out the form fields with your name, last name, and email, your token will be sent to the provided email address.
3. Copy the Token; it will be used for NASA API authentication.
> Your token is for personal use and should not be shared.
# Setup & Launch

1. Clone this repository:
1. Clone this repository:<br>

```terminal
git clone git@github.com:Robso-creator/discord_bot.git
```

2. `cd` into the new repository:
2. `cd` into the new repository: <br>

```terminal
cd discord_bot
```

3. Create a new virtual environment:
3. Create a new virtual environment: <br>

```terminal
python -m venv venv
```

4. Activate the new virtual environment:
4. Activate the new virtual environment: <br>

```terminal
.\venv\Scripts\Activate
```

5. Install dependencies:
5. Install the dependencies: <br>

```terminal
pip install -r requirements.txt
```

6. Create a `.env` file in the root folder of the project:
6. Create a `.env` file in the root project folder: <br>

```terminal
DISCORD_TOKEN=
DISCORD_SERVER_ID=
NASA_TOKEN=DEMO_KEY
```
7. Run de .py file: <br>

7. Run the .py file: <br>

```terminal
python -m main
```
45 changes: 36 additions & 9 deletions docs/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,9 @@
[![pytest](https://img.shields.io/badge/pytest-enabled-brightgreen?logo=pytest&logoColor=#0A9EDC)](https://docs.pytest.org/en/7.4.x/)

# Bot do Discord
<sub>Don't speak portuguese? [Click here](https://github.com/Robso-creator/discord_bot/blob/main/README-en.md) to view this page in English</sub>

<sub>Don't speak portuguese? [Click here](https://github.com/Robso-creator/discord_bot/blob/main/README-en.md) to view
this page in English</sub>

Este é um projeto de bot para Discord desenvolvido em Python
que oferece uma variedade de funcionalidades para
Expand All @@ -16,8 +18,8 @@ Documentação dos comandos disponível [aqui](https://robso-creator.github.io/d
# Sumário

* [Criação de Tokens necessários](#criação-de-tokens-necessários)
* [Gerar conta de bot no discord](#gerar-conta-de-bot-no-discord)
* [Gerar token de autenticação API NASA](#gerar-token-de-autenticação-api-nasa)
* [Gerar conta de bot no discord](#gerar-conta-de-bot-no-discord)
* [Gerar token de autenticação API NASA](#gerar-token-de-autenticação-api-nasa)
* [Setup & Launch](#setup-&-launch)

# Criação de Tokens necessários
Expand All @@ -26,58 +28,83 @@ Para que o bot funcione corretamente alguns tokens precisam ser fornecidos,
a seguir poderá entender como gerá-los

## Gerar conta de bot no discord
<sub>Passo a passo de [freecodecamp](https://www.freecodecamp.org/portuguese/news/tutorial-de-criacao-de-bot-para-o-discord-em-python/)</sub>

<sub>Passo a passo
de [freecodecamp](https://www.freecodecamp.org/portuguese/news/tutorial-de-criacao-de-bot-para-o-discord-em-python/)</sub>

1. Esteja logado na [plataforma](https://discord.com/);
2. Acesse a [página de desenvolvedores](https://discord.com/developers/applications);
3. Clique no botão de "Nova Aplicação" no canto superior direito:<br>
![img.png](../static/new_application_img.png)
4. Vá até a aba “Bot” e clique em “Add Bot”;
>Mantenha as configurações padrão para Public Bot (marcado) e Require OAuth2 Code Grant (desmarcado).
![img.png](../static/new_application_img.png)
4. Vá até a aba “Bot” e clique em “Add Bot”;

> Mantenha as configurações padrão para Public Bot (marcado) e Require OAuth2 Code Grant (desmarcado).
5. Copie o Token, ele será utilizado para a autenticação do seu bot.<br>
6. Aproveitando o embalo, na mesma página, clique em "OAuth2" e selecione "bot"

> Nesse etapa vamos adicionar o bot ao seu servidor
7. Em seguida escolha as permissões que deseja dar ao seu bot, para o padrão deste reposítório somente as permissões de
mensagem de texto bastam
8. Clique no botão 'copy' acima das permissões e cole no seu navegador, selecione o servidor que deseja adicionar o bot
e depois clique em "Authorize"

## Gerar token de autenticação API NASA

<sub>Esse token não é obrigatório, para teste somente a DEMO_KEY já é suficiente.</sub>
<sub>Com a autenticação, o limite de batida na API aumenta drasticamente</sub>

1. Primeira coisa a se fazer é solicitar a [geração do seu token](https://api.nasa.gov/) para acesso à API da agência espacial;
2. Após preencher os campos do formulário com seu nome, sobrenome e e-mail, seu token será encaminhado para o endereço de e-mail fornecido;
1. Primeira coisa a se fazer é solicitar a [geração do seu token](https://api.nasa.gov/) para acesso à API da agência
espacial;
2. Após preencher os campos do formulário com seu nome, sobrenome e e-mail, seu token será encaminhado para o endereço
de e-mail fornecido;
3. Copie o Token, ele será utilizado para autenticação da API da NASA

> Seu token é para uso pessoal e não deve ser compartilhado
# Setup & Launch

1. Clone esse repositório:<br>

```terminal
git clone git@github.com:Robso-creator/discord_bot.git
```

2. `cd` para o novo repositório: <br>

```terminal
cd discord_bot
```

3. Crie um novo ambiente virtual: <br>

```terminal
python -m venv venv
```

4. Ative o novo ambiente virtual: <br>

```terminal
.\venv\Scripts\Activate
```

5. Instale as dependências: <br>

```terminal
pip install -r requirements.txt
```

6. Crie um arquivo `.env` na sua pasta na pasta `root` do projeto: <br>

```terminal
DISCORD_TOKEN=
DISCORD_SERVER_ID=
NASA_TOKEN=DEMO_KEY
```

7. Execute o arquivo .py: <br>

```terminal
python -m main
```

0 comments on commit 21bbdcf

Please sign in to comment.