-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
Browse the repository at this point in the history
Merge feature/post as user, fixes #5
- Loading branch information
Showing
13 changed files
with
532 additions
and
95 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,13 +1,84 @@ | ||
# Mercatino unixMiB | ||
|
||
## Che cosa è il mercatino? | ||
## Che cosa è il mercatino | ||
|
||
Il mercatino dell'usato di unixMiB ti permette di creare inserzioni per vendere quello che non usi più. | ||
|
||
## Cosa ho bisogno per accedere al mercatino? | ||
## Cosa ho bisogno per accedere al mercatino | ||
|
||
Per utilizzare il mercatino è sufficiente un account [Telegram](https://telegram.org/) per iniziare subito a chattare. | ||
|
||
## Come accedo al mercatino? | ||
## Come accedo al mercatino | ||
|
||
Per avviare una chat con il bot recati alla pagina [https://t.me/unixmib_mercatino_bot](https://t.me/unixmib_mercatino_bot) o cerca [@unixmib_mercatino_bot](https://t.me/unixmib_mercatino_bot) in Telegram | ||
Per iniziare una chat con il bot recati alla pagina [https://t.me/unixmib_mercatino_bot](https://t.me/unixmib_mercatino_bot) o cerca [@unixmib_mercatino_bot](https://t.me/unixmib_mercatino_bot) in Telegram | ||
|
||
## Configurazione del bot | ||
|
||
- Bot token di Telegram da [@botfather](https://t.me/botfather) | ||
- ID del canale da usare come bacheca del mercatino | ||
- ID degli amministratori iniziali (opzionale) | ||
- ID del gruppo di amministrazione (opzionale) | ||
|
||
|
||
### Parametri mediante file JSON | ||
|
||
`config.json` | ||
|
||
```json | ||
{ | ||
"token": "Token del bot", | ||
"board": "ID del canale usato come bacheca", | ||
"admins": [123456, 123456, 123456], | ||
"group": "ID del gruppo di amministratori" | ||
} | ||
``` | ||
|
||
### Parametri mediante variabili d'ambiente | ||
|
||
Configurazione consigliata con un container Docker | ||
|
||
- `MERCATUNO_TOKEN` = "Token del bot" | ||
- `MERCATINO_BOARD` = "ID del canale usato come bacheca" | ||
- `MERCATINO_ADMINS` = 123456:123456:123456 | ||
- `MERCATINO_GROUP` = "ID del gruppo di amministratori" | ||
|
||
Un esempio nella riga di comando sarà: | ||
|
||
```bash | ||
java -DMERCATUNO_TOKEN=token -DMERCATINO_BOARD=id -DMERCATINO_ADMINS=id:id:id -DMERCATINO_GROUP=id -jar mercatino.jar | ||
``` | ||
|
||
### Parametri mediante argomento | ||
|
||
- `-t`: Token del bot | ||
- `-b`: ID del canale usato come bacheca | ||
- `-a`: Stringa di amministratori separata da ':' | ||
- `-g`: ID del gruppo di amministratori | ||
|
||
Un esempio nella riga di comando sarà: | ||
|
||
```bash | ||
java -jar mercatino.jar -t token -b id -a 123456:123456:123456 -g id | ||
``` | ||
|
||
## Docker container tags | ||
|
||
- `190304`, `190304-alpine`, `alpine`, `latest` (190304/alpine) | ||
|
||
- `190304-windowsservercore`, `190304-windowsservercore-ltsc2019`, `windowsservercore`, `windowsservercore-ltsc2019` (190304/windows/servercore/ltsc2019) | ||
|
||
- `190303`, `190303-alpine` (190303/alpine) | ||
|
||
- `190303-windowsservercore`, `190303-windowsservercore-ltsc2019` (190303/windows/servercore/ltsc2019) | ||
|
||
- `190228`, `190228-alpine` (190228/alpine) | ||
|
||
- `190228-windowsservercore`, `190228-windowsservercore-ltsc2019` (199228/windows/servercore/ltsc2019) | ||
|
||
- `190223`, `190223-stretch`, `stretch` (190223/stretch) | ||
|
||
- `190223-windowsservercore`, `190223-windowsservercore-ltsc2019` (190223/windows/servercore/ltsc2019) | ||
|
||
### Shared tags | ||
|
||
- `latest` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
/** | ||
* Copyright (C) 2019 Kowalski7cc | ||
* | ||
* This program is free software: you can redistribute it and/or modify | ||
* it under the terms of the GNU Affero General Public License as | ||
* published by the Free Software Foundation, either version 3 of the | ||
* License, or (at your option) any later version. | ||
* | ||
* This program is distributed in the hope that it will be useful, | ||
* but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
* GNU Affero General Public License for more details. | ||
* | ||
* You should have received a copy of the GNU Affero General Public License | ||
* along with this program. If not, see <http://www.gnu.org/licenses/>. | ||
*/ | ||
|
||
package io.github.unixmib.mercatino; | ||
|
||
public interface BotCommand { | ||
|
||
String getCommand(); | ||
|
||
String getState(); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,46 @@ | ||
/** | ||
* Copyright (C) 2019 Kowalski7cc | ||
* | ||
* This program is free software: you can redistribute it and/or modify | ||
* it under the terms of the GNU Affero General Public License as | ||
* published by the Free Software Foundation, either version 3 of the | ||
* License, or (at your option) any later version. | ||
* | ||
* This program is distributed in the hope that it will be useful, | ||
* but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
* GNU Affero General Public License for more details. | ||
* | ||
* You should have received a copy of the GNU Affero General Public License | ||
* along with this program. If not, see <http://www.gnu.org/licenses/>. | ||
*/ | ||
|
||
package io.github.unixmib.mercatino; | ||
|
||
public enum Command implements BotCommand { | ||
|
||
START("start", "start"), | ||
VENDI("vendi", "new_advertisement"), | ||
HELP("help", "show_hint"), | ||
BACHECA("bacheca", "bacheca"), | ||
ANNULLA("annulla", "abort"), | ||
SELFPROMOTE("selfpromote", "selfpromote"); | ||
|
||
private String command; | ||
private String state; | ||
|
||
Command(String command, String state) { | ||
this.command = command; | ||
this.state = state; | ||
} | ||
|
||
@Override | ||
public String getCommand() { | ||
return command; | ||
} | ||
|
||
@Override | ||
public String getState() { | ||
return state; | ||
} | ||
} |
Oops, something went wrong.