Skip to content

Commit

Permalink
Update README.md
Browse files Browse the repository at this point in the history
  • Loading branch information
ahmadhabibi14 committed Aug 10, 2023
1 parent 70c15dd commit fffa197
Show file tree
Hide file tree
Showing 2 changed files with 56 additions and 10 deletions.
65 changes: 56 additions & 9 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,12 +1,59 @@
## WhatsApp Bot
# WhatsApp Bot

#### How to start ?
## Development

1. Install `SQLite` in your Computer
2. Generate OpenAI API key at https://platform.openai.com/account/api-keys
3. Create `.env` file in the root directory
4. And then add variable named `OPENAI_API_KEY` with your OpenAI API key as its value
5. Run `go get` to install required modules
6. Run `start.sh` (Make sure you assign execute permission)
- **Dependencies** :
- Go Programming Language https://go.dev/
- SQLite Database https://www.sqlite.org/
- OpenAI API key, generate at https://platform.openai.com/account/api-keys
- **.env Variables**:
- `OPENAI_API_KEY`
- **How to run**:
- `go get` to install required modules
- `start.sh` (Make sure to assign execute permission)

## Deployment

#### Features still in development...
#### 1. SSH Configuration
Generate SSH key
```sh
ssh-keygen
```
At local computer, copy publickey to `~/.ssh/authorized_keys` at remote server

#### 2. Github Secrets Variables
- `SERVER_IP` remote server IP
- `SERVER_PASS` remote server Password
- `SERVER_PORT` opened port
- `SERVER_USER` remote server user to action
- `SSH_PRIVATE_KEY` generated ssh private key on local computer

#### 3. Remote Server Configuration
Install dependencies
- Go Programming Language
- SQlite

Set SystemD configuration
```sh
# Go to SystemD services directory
cd /lib/systemd/system/

# Create a SystemD service file
touch whatsappbot.service
```
At file `/lib/systemd/system/whatsappbot.service`, write this configuration
```sh
[Unit]
Description=Habi-Bot (WhatsApp Bot)

[Service]
User=root
Type=simple
Restart=always
RestartSec=5s
WorkingDirectory=/root/wabot
ExecStart=/root/wabot/main

[Install]
WantedBy=multi-user.target
```
1 change: 0 additions & 1 deletion commands/Help.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@ import "strings"
func Help() string {
const msg string = `
Ya, Ada yang bisa saya bantu ?
Akun ini adalah bot 🤖
`
return strings.TrimSpace(msg)
Expand Down

0 comments on commit fffa197

Please sign in to comment.