2020-06-01 16:18:48 +02:00
# justlog [![Build Status](https://github.com/gempir/justlog/workflows/ci/badge.svg)](https://github.com/gempir/justlog/actions?query=workflow%3Aci)
2017-03-08 22:16:37 +01:00
2020-03-08 17:54:06 +01:00
### What is this?
2018-12-01 17:46:24 +01:00
justlog is a bot I maintain for a couple of channels. Its features differ from other bots in that it doesn't support
2020-02-11 18:48:38 +01:00
commands, etc. yet, it focuses on logging and providing an api for the logs.
2020-03-08 17:54:06 +01:00
### Commands
- `!justlog status` will respond with uptime
- `!justlog join gempir,pajlada` will join the channels and append them to the config
- `!justlog messageType gempir 1,2` will set the recorded message types to 1 and 2 in channel gempir (will fetch the userid on its own)
2020-04-18 00:32:04 +02:00
- `!justlog messageType gempir reset` will reset to default
2020-03-08 17:54:06 +01:00
2020-03-02 21:29:49 +01:00
### Config
2020-02-11 18:48:38 +01:00
2020-03-02 21:29:49 +01:00
```
{
2020-08-27 03:35:20 +02:00
"admins": ["gempir"], // will only respond to commands executed by these users
2020-03-02 21:29:49 +01:00
"logsDirectory": "./logs", // the directory to log into
2020-10-11 00:00:24 +02:00
"adminAPIKey": "noshot", // your secret api key to access the admin api (documented below)
2020-03-02 21:29:49 +01:00
"username": "gempbot", // bot username (can be justinfan123123 if you don't want to use an account)
"oauth": "oauthtokenforchat", // bot token can be anything if justinfan123123
"clientID": "mytwitchclientid", // your client ID, needed for fetching userids or usernames etc
2020-10-11 00:00:24 +02:00
"clientSecret": "mysecret", // your twitch client secret
"logLevel": "info", // the log level, keep this to info probably
"channels": ["77829817", "11148817"], // the channels (userids) you want to log
"archive": true, // probably keep to true, will disable gzipping of old logs if false, useful if you setup compression on your own
"channelConfigs": {
2020-03-02 21:29:49 +01:00
"77829817": { // only applies to this channel
"messageTypes": [1] // will only log messages of type 1 (check go-twitch-irc MessageType https://github.com/gempir/go-twitch-irc/blob/master/message.go#L17 ), default is all
}
}
}
2020-03-08 17:54:06 +01:00
```
2020-09-26 01:45:18 +02:00
### Admin API
`POST` `/admin/channelConfigs/{channelID}`
2020-10-08 21:52:58 +02:00
Will set the messageTypes logged for a channel
###### Headers
2020-09-26 01:45:18 +02:00
```
X-Api-Key: yourcoolapikey
```
2020-10-08 21:52:58 +02:00
###### Body
2020-09-26 01:45:18 +02:00
```
{
"messageTypes": [1]
}
```
2020-09-26 09:13:47 +02:00
2020-10-08 21:52:58 +02:00
---
2020-09-26 09:13:47 +02:00
`DELETE` `/admin/channelConfigs/{channelID}`
2020-10-08 21:52:58 +02:00
Will reset the messageTypes logged for a channel
###### Headers
2020-09-26 09:13:47 +02:00
```
X-Api-Key: yourcoolapikey
```
2020-10-08 21:52:58 +02:00
###### Body
2020-09-26 09:13:47 +02:00
```
{
"messageTypes": true
}
```
2020-10-08 21:52:58 +02:00
---
`POST` `/admin/channels`
Will add the channels to log
###### Headers
```
X-Api-Key: yourcoolapikey
```
###### Body
```
{
"channels": ["77829817"]
}
```
---
`DELETE` `/admin/channels`
Will remove the channels to log
###### Headers
```
X-Api-Key: yourcoolapikey
```
###### Body
```
{
"channels": ["77829817"]
}
2020-10-11 00:00:24 +02:00
```