Skip to content

Commit

Permalink
Merge pull request #164 from zekroTJA/dev
Browse files Browse the repository at this point in the history
1.2.1
  • Loading branch information
zekroTJA authored Sep 16, 2020
2 parents bf62c98 + e83bf3b commit 50e81cb
Show file tree
Hide file tree
Showing 34 changed files with 325 additions and 195 deletions.
50 changes: 11 additions & 39 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,55 +1,27 @@
1.2.0
1.2.1

> MAJOR PATCH
> MINOR PATCH
## Major
## Minor Improvements

- **Karma system implementation.** [#134, #145]
Karma is a value which shall provide a scale of the trustworthyness of a user on the guild. The system works similar to the karma system of Reddit or Stackoverflow, for example.
You can gain karma when other users react to your messages with `👍, 👌, ⭐, ✔` and you lose karma when users react with `👎, ❌` to your message.
The value of karma is shown in the profile command and in the web interface. Also, you can view a scoreboard of the members with most karma.
You can read the full proposal here in this issue: #134.
![](https://i.imgur.com/xia2aeN.png)
![](https://i.imgur.com/9sROCVi.png)
- Discord assets in web interface are now requested with a proper resolution. [#163]
- Report revoke link in web interface is now only shown if the user has the permission to do so.

- **shireikan implementation.** [#152]
[shireikan](https://github.com/zekroTJA/shireikan) is a command handler package which replaces the internal command handler of shinpuru. Read more about the advantages of this implementation in issue #152. In order of this implementation, a lot of commands and modules needed to be refactored.
## Bug Fixes

- **Web frontend changes.** [#151, #153]
The layout of the front end is now kept at a max width and centered which leads to a way more clear and nice-looking design. Also, it is now possible to revoke reports via the web interface.
![](https://i.imgur.com/7DXTeXL.png)

- **Add color reactions.** [#155]
Color reactions are a system which, when enabled by the [`color`](https://github.com/zekroTJA/shinpuru/wiki/Commands#color) command, scrapes messages for hexadecimal color codes. Then, a reaction is added which shows the color. After clicking the reaction, more information about the color is shown.
![](https://i.imgur.com/VICm9BV.gif)

- **Command overview in web interface.** [#158]
Add a command list in the web interface where you have a clear overview over all commands of shinpuru and how they are used.
![](https://i.imgur.com/sTHzdEN.gif)

## Minor

- Add edit flag to [say command](https://github.com/zekroTJA/shinpuru/wiki/Commands#say). [#142]
- Update Header in Web Interface which is now static at the top of the window and has a drop shadow for better visual seperation.
- Optimize permission role input in web interface. [#148]
- Add fuzzy search for help command. [#157]

## Fixes

- Fix typo in security cards in web interface. [#140]
- Fix self-member button in web interface. [#141]
- Unify command descriptions.
- Fix permission update handling when adding the same permission rule as existent. [#161]
- Fix dropdown style in web interface ([old](https://i.imgur.com/m5uQZdq.png) vs [new](https://i.imgur.com/PWet0kD.png)).
- Fix color reaction spam on message edit. [#162]

## Backstage

- Database drivers are now moved to the internal package `internal/core/middleware` to make middleware drivers available for usage as database and general purpose cache or other use cases.
- Add service which starts the Angular dev server alongside with shinpuru when passing the `-devmode` flag on start.
- Moved the [permissions](https://github.com/zekroTJA/shinpuru/tree/master/pkg/permissions) and the [twitchnotify](https://github.com/zekroTJA/shinpuru/tree/master/pkg/twitchnotify) packages to the `pkg` public package domain.

# Docker

[Here](https://hub.docker.com/r/zekro/shinpuru) you can find the docker hub page of shinpuru.

Pull the docker image of this release:
```
$ docker pull zekro/shinpuru:1.2.0-rc.1
$ docker pull zekro/shinpuru:1.2.1
```
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -149,9 +149,11 @@ Some of the independant utilities and functionalities shinpuru uses are publicly
- [`github.com/zekroTJA/shinpuru/pkg/lctimer`](https://github.com/zekroTJA/shinpuru/tree/master/pkg/lctimer)
- [`github.com/zekroTJA/shinpuru/pkg/msgcollector`](https://github.com/zekroTJA/shinpuru/tree/master/pkg/msgcollector)
- [`github.com/zekroTJA/shinpuru/pkg/multierror`](https://github.com/zekroTJA/shinpuru/tree/master/pkg/multierror)
- [`github.com/zekroTJA/shinpuru/pkg/permissions`](https://github.com/zekroTJA/shinpuru/tree/master/pkg/permissions)
- [`github.com/zekroTJA/shinpuru/pkg/random`](https://github.com/zekroTJA/shinpuru/tree/master/pkg/random)
- [`github.com/zekroTJA/shinpuru/pkg/roleutil`](https://github.com/zekroTJA/shinpuru/tree/master/pkg/roleutil)
- [`github.com/zekroTJA/shinpuru/pkg/timeutil`](https://github.com/zekroTJA/shinpuru/tree/master/pkg/timeutil)
- [`github.com/zekroTJA/shinpuru/pkg/twitchnotify`](https://github.com/zekroTJA/shinpuru/tree/master/pkg/twitchnotify)

---

Expand Down
44 changes: 23 additions & 21 deletions bughunters.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,24 +2,26 @@

A list to honor all people who found some bugs, had some great ideas or contributed directly to shinpuru. ❤️

| GitHub | Issues / PRs |
|--------|--------------|
| [anathemamask](https://github.com/anathemamask) | [#85](https://github.com/zekroTJA/shinpuru/issues/85) |
| [codacy-badger](https://github.com/codacy-badger) | [#136](https://github.com/zekroTJA/shinpuru/pull/136) |
| [DarkAmy](https://github.com/DarkAmy) | [#46](https://github.com/zekroTJA/shinpuru/issues/46) |
| [dependabot](https://github.com/dependabot) | [#84](https://github.com/zekroTJA/shinpuru/pull/84), [#87](https://github.com/zekroTJA/shinpuru/pull/87), [#89](https://github.com/zekroTJA/shinpuru/pull/89) |
| [Eli-Dev](https://github.com/Eli-Dev) | [#45](https://github.com/zekroTJA/shinpuru/issues/45), [#47](https://github.com/zekroTJA/shinpuru/issues/47), [#49](https://github.com/zekroTJA/shinpuru/issues/49) |
| [error2507](https://github.com/error2507) | [#1](https://github.com/zekroTJA/shinpuru/pull/1), [#2](https://github.com/zekroTJA/shinpuru/pull/2), [#28](https://github.com/zekroTJA/shinpuru/issues/28), [#29](https://github.com/zekroTJA/shinpuru/issues/29), [#55](https://github.com/zekroTJA/shinpuru/issues/55) |
| [InterXellar](https://github.com/InterXellar) | [#70](https://github.com/zekroTJA/shinpuru/issues/70), [#73](https://github.com/zekroTJA/shinpuru/issues/73), [#74](https://github.com/zekroTJA/shinpuru/issues/74) |
| [JahisanaMalimimbra](https://github.com/JahisanaMalimimbra) | [#25](https://github.com/zekroTJA/shinpuru/pull/25), [#26](https://github.com/zekroTJA/shinpuru/pull/26), [#27](https://github.com/zekroTJA/shinpuru/pull/27) |
| [Lukaesebrot](https://github.com/Lukaesebrot) | [#90](https://github.com/zekroTJA/shinpuru/issues/90) |
| [nanderLP](https://github.com/nanderLP) | [#41](https://github.com/zekroTJA/shinpuru/issues/41) |
| [newtox](https://github.com/newtox) | [#57](https://github.com/zekroTJA/shinpuru/issues/57) |
| [Not-Nik](https://github.com/Not-Nik) | [#53](https://github.com/zekroTJA/shinpuru/issues/53), [#56](https://github.com/zekroTJA/shinpuru/pull/56) |
| [pavll](https://github.com/pavll) | [#108](https://github.com/zekroTJA/shinpuru/issues/108) |
| [rmcproductions](https://github.com/rmcproductions) | [#52](https://github.com/zekroTJA/shinpuru/issues/52), [#61](https://github.com/zekroTJA/shinpuru/issues/61), [#67](https://github.com/zekroTJA/shinpuru/issues/67), [#147](https://github.com/zekroTJA/shinpuru/issues/147), [#148](https://github.com/zekroTJA/shinpuru/issues/148) |
| [Ron31](https://github.com/Ron31) | [#32](https://github.com/zekroTJA/shinpuru/pull/32), [#33](https://github.com/zekroTJA/shinpuru/pull/33) |
| [ShowMeYourSkil](https://github.com/ShowMeYourSkil) | [#140](https://github.com/zekroTJA/shinpuru/issues/140) |
| [Skillkiller](https://github.com/Skillkiller) | [#79](https://github.com/zekroTJA/shinpuru/pull/79) |
| [SnowLeoo](https://github.com/SnowLeoo) | [#129](https://github.com/zekroTJA/shinpuru/issues/129), [#145](https://github.com/zekroTJA/shinpuru/issues/145) |
| [zori4004](https://github.com/zori4004) | [#128](https://github.com/zekroTJA/shinpuru/issues/128) |
| GitHub | Issues | PRs | Points* |
|--------|--------|-----|---------|
| [rmcproductions](https://github.com/rmcproductions) | [#52](https://github.com/zekroTJA/shinpuru/issues/52), [#61](https://github.com/zekroTJA/shinpuru/issues/61), [#67](https://github.com/zekroTJA/shinpuru/issues/67), [#147](https://github.com/zekroTJA/shinpuru/issues/147), [#148](https://github.com/zekroTJA/shinpuru/issues/148), [#150](https://github.com/zekroTJA/shinpuru/issues/150), [#153](https://github.com/zekroTJA/shinpuru/issues/153), [#159](https://github.com/zekroTJA/shinpuru/issues/159), [#163](https://github.com/zekroTJA/shinpuru/issues/163) | | `9` |
| [error2507](https://github.com/error2507) | [#28](https://github.com/zekroTJA/shinpuru/issues/28), [#29](https://github.com/zekroTJA/shinpuru/issues/29), [#55](https://github.com/zekroTJA/shinpuru/issues/55) | [#1](https://github.com/zekroTJA/shinpuru/pull/1), [#2](https://github.com/zekroTJA/shinpuru/pull/2) | `7` |
| [Eli-Dev](https://github.com/Eli-Dev) | [#45](https://github.com/zekroTJA/shinpuru/issues/45), [#47](https://github.com/zekroTJA/shinpuru/issues/47), [#49](https://github.com/zekroTJA/shinpuru/issues/49) | | `3` |
| [Not-Nik](https://github.com/Not-Nik) | [#53](https://github.com/zekroTJA/shinpuru/issues/53) | [#56](https://github.com/zekroTJA/shinpuru/pull/56) | `3` |
| [InterXellar](https://github.com/InterXellar) | [#70](https://github.com/zekroTJA/shinpuru/issues/70), [#73](https://github.com/zekroTJA/shinpuru/issues/73), [#74](https://github.com/zekroTJA/shinpuru/issues/74) | | `3` |
| [SnowLeoo](https://github.com/SnowLeoo) | [#129](https://github.com/zekroTJA/shinpuru/issues/129), [#145](https://github.com/zekroTJA/shinpuru/issues/145) | | `2` |
| [Ron31](https://github.com/Ron31) | | [#32](https://github.com/zekroTJA/shinpuru/pull/32) | `2` |
| [Skillkiller](https://github.com/Skillkiller) | | [#79](https://github.com/zekroTJA/shinpuru/pull/79) | `2` |
| [nanderLP](https://github.com/nanderLP) | [#41](https://github.com/zekroTJA/shinpuru/issues/41) | | `1` |
| [DarkAmy](https://github.com/DarkAmy) | [#46](https://github.com/zekroTJA/shinpuru/issues/46) | | `1` |
| [newtox](https://github.com/newtox) | [#57](https://github.com/zekroTJA/shinpuru/issues/57) | | `1` |
| [anathemamask](https://github.com/anathemamask) | [#85](https://github.com/zekroTJA/shinpuru/issues/85) | | `1` |
| [Lukaesebrot](https://github.com/Lukaesebrot) | [#90](https://github.com/zekroTJA/shinpuru/issues/90) | | `1` |
| [pavll](https://github.com/pavll) | [#108](https://github.com/zekroTJA/shinpuru/issues/108) | | `1` |
| [Zoriot](https://github.com/Zoriot) | [#128](https://github.com/zekroTJA/shinpuru/issues/128) | | `1` |
| [ShowMeYourSkil](https://github.com/ShowMeYourSkil) | [#140](https://github.com/zekroTJA/shinpuru/issues/140) | | `1` |
| [okrplay](https://github.com/okrplay) | [#162](https://github.com/zekroTJA/shinpuru/issues/162) | | `1` |


---
*For explaination: A contributor gets `1` point(s) for each created issue and `2` point(s) for each **merged** pull request.
12 changes: 7 additions & 5 deletions internal/commands/cmdperms.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,10 @@ import (

"github.com/bwmarrin/discordgo"
"github.com/zekroTJA/shinpuru/internal/core/database"
"github.com/zekroTJA/shinpuru/internal/core/permissions"
"github.com/zekroTJA/shinpuru/internal/util"
"github.com/zekroTJA/shinpuru/internal/util/static"
"github.com/zekroTJA/shinpuru/pkg/fetch"
"github.com/zekroTJA/shinpuru/pkg/permissions"
"github.com/zekroTJA/shinpuru/pkg/roleutil"
"github.com/zekroTJA/shireikan"
)
Expand Down Expand Up @@ -113,11 +113,13 @@ func (c *CmdPerms) Exec(ctx shireikan.Context) error {
cPerm = make(permissions.PermissionArray, 0)
}

cPerm = cPerm.Update(perm, false)
cPerm, changed := cPerm.Update(perm, false)

err := db.SetGuildRolePermission(ctx.GetGuild().ID, r.ID, cPerm)
if err != nil {
return err
if changed {
err := db.SetGuildRolePermission(ctx.GetGuild().ID, r.ID, cPerm)
if err != nil {
return err
}
}
}

Expand Down
2 changes: 1 addition & 1 deletion internal/commands/cmdtwitchnotify.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,10 @@ import (
"github.com/bwmarrin/discordgo"

"github.com/zekroTJA/shinpuru/internal/core/database"
"github.com/zekroTJA/shinpuru/internal/core/twitchnotify"
"github.com/zekroTJA/shinpuru/internal/util"
"github.com/zekroTJA/shinpuru/internal/util/static"
"github.com/zekroTJA/shinpuru/pkg/acceptmsg"
"github.com/zekroTJA/shinpuru/pkg/twitchnotify"
"github.com/zekroTJA/shireikan"
)

Expand Down
4 changes: 2 additions & 2 deletions internal/core/database/database.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,13 +6,13 @@ import (
"github.com/bwmarrin/discordgo"
"github.com/bwmarrin/snowflake"
"github.com/zekroTJA/shinpuru/internal/core/backup/backupmodels"
"github.com/zekroTJA/shinpuru/internal/core/permissions"
"github.com/zekroTJA/shinpuru/internal/core/twitchnotify"
"github.com/zekroTJA/shinpuru/internal/shared/models"
"github.com/zekroTJA/shinpuru/internal/util/imgstore"
"github.com/zekroTJA/shinpuru/internal/util/report"
"github.com/zekroTJA/shinpuru/internal/util/tag"
"github.com/zekroTJA/shinpuru/internal/util/vote"
"github.com/zekroTJA/shinpuru/pkg/permissions"
"github.com/zekroTJA/shinpuru/pkg/twitchnotify"
)

// ErrDatabaseNotFound is returned when no value was
Expand Down
4 changes: 2 additions & 2 deletions internal/core/middleware/mysql.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,16 +10,16 @@ import (
"github.com/zekroTJA/shinpuru/internal/core/backup/backupmodels"
"github.com/zekroTJA/shinpuru/internal/core/config"
"github.com/zekroTJA/shinpuru/internal/core/database"
"github.com/zekroTJA/shinpuru/internal/core/permissions"
"github.com/zekroTJA/shinpuru/internal/core/twitchnotify"
"github.com/zekroTJA/shinpuru/internal/shared/models"
"github.com/zekroTJA/shinpuru/internal/util"
"github.com/zekroTJA/shinpuru/internal/util/imgstore"
"github.com/zekroTJA/shinpuru/internal/util/report"
"github.com/zekroTJA/shinpuru/internal/util/tag"
"github.com/zekroTJA/shinpuru/internal/util/vote"
"github.com/zekroTJA/shinpuru/pkg/multierror"
"github.com/zekroTJA/shinpuru/pkg/permissions"
"github.com/zekroTJA/shinpuru/pkg/roleutil"
"github.com/zekroTJA/shinpuru/pkg/twitchnotify"

"github.com/bwmarrin/discordgo"
"github.com/bwmarrin/snowflake"
Expand Down
2 changes: 1 addition & 1 deletion internal/core/middleware/permissions.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,9 @@ import (
"github.com/bwmarrin/discordgo"
"github.com/zekroTJA/shinpuru/internal/core/config"
"github.com/zekroTJA/shinpuru/internal/core/database"
"github.com/zekroTJA/shinpuru/internal/core/permissions"
"github.com/zekroTJA/shinpuru/internal/util/static"
"github.com/zekroTJA/shinpuru/pkg/discordutil"
"github.com/zekroTJA/shinpuru/pkg/permissions"
"github.com/zekroTJA/shireikan"
)

Expand Down
4 changes: 2 additions & 2 deletions internal/core/middleware/redis.go
Original file line number Diff line number Diff line change
Expand Up @@ -13,12 +13,12 @@ import (
"github.com/bwmarrin/snowflake"
"github.com/go-redis/redis"
"github.com/zekroTJA/shinpuru/internal/core/backup/backupmodels"
"github.com/zekroTJA/shinpuru/internal/core/permissions"
"github.com/zekroTJA/shinpuru/internal/core/twitchnotify"
"github.com/zekroTJA/shinpuru/internal/util/imgstore"
"github.com/zekroTJA/shinpuru/internal/util/report"
"github.com/zekroTJA/shinpuru/internal/util/tag"
"github.com/zekroTJA/shinpuru/internal/util/vote"
"github.com/zekroTJA/shinpuru/pkg/permissions"
"github.com/zekroTJA/shinpuru/pkg/twitchnotify"
)

const (
Expand Down
4 changes: 2 additions & 2 deletions internal/core/middleware/sqlite.go
Original file line number Diff line number Diff line change
Expand Up @@ -13,14 +13,14 @@ import (
"github.com/zekroTJA/shinpuru/internal/core/backup/backupmodels"
"github.com/zekroTJA/shinpuru/internal/core/config"
"github.com/zekroTJA/shinpuru/internal/core/database"
"github.com/zekroTJA/shinpuru/internal/core/permissions"
"github.com/zekroTJA/shinpuru/internal/core/twitchnotify"
"github.com/zekroTJA/shinpuru/internal/shared/models"
"github.com/zekroTJA/shinpuru/internal/util"
"github.com/zekroTJA/shinpuru/internal/util/imgstore"
"github.com/zekroTJA/shinpuru/internal/util/report"
"github.com/zekroTJA/shinpuru/internal/util/tag"
"github.com/zekroTJA/shinpuru/internal/util/vote"
"github.com/zekroTJA/shinpuru/pkg/permissions"
"github.com/zekroTJA/shinpuru/pkg/twitchnotify"

"github.com/bwmarrin/discordgo"
"github.com/bwmarrin/snowflake"
Expand Down
2 changes: 1 addition & 1 deletion internal/inits/cmdhandler.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,10 @@ import (
"github.com/zekroTJA/shinpuru/internal/core/database"
"github.com/zekroTJA/shinpuru/internal/core/middleware"
"github.com/zekroTJA/shinpuru/internal/core/storage"
"github.com/zekroTJA/shinpuru/internal/core/twitchnotify"
"github.com/zekroTJA/shinpuru/internal/util"
"github.com/zekroTJA/shinpuru/pkg/discordutil"
"github.com/zekroTJA/shinpuru/pkg/lctimer"
"github.com/zekroTJA/shinpuru/pkg/twitchnotify"
"github.com/zekroTJA/shireikan"
)

Expand Down
8 changes: 5 additions & 3 deletions internal/inits/twitchnotifyer.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,9 @@ import (
"github.com/bwmarrin/discordgo"
"github.com/zekroTJA/shinpuru/internal/core/config"
"github.com/zekroTJA/shinpuru/internal/core/database"
"github.com/zekroTJA/shinpuru/internal/core/twitchnotify"
"github.com/zekroTJA/shinpuru/internal/listeners"
"github.com/zekroTJA/shinpuru/internal/util"
"github.com/zekroTJA/shinpuru/pkg/twitchnotify"
)

func InitTwitchNotifyer(session *discordgo.Session, config *config.Config, db database.Database) (*twitchnotify.NotifyWorker, *listeners.ListenerTwitchNotify) {
Expand All @@ -15,8 +15,10 @@ func InitTwitchNotifyer(session *discordgo.Session, config *config.Config, db da
}

listener := listeners.NewListenerTwitchNotify(session, config, db)
tnw, err := twitchnotify.New(config.TwitchApp,
listener.HandlerWentOnline, listener.HandlerWentOffline)
tnw, err := twitchnotify.New(twitchnotify.Credentials{
ClientID: config.TwitchApp.ClientID,
ClientSecret: config.TwitchApp.ClientSecret,
}, listener.HandlerWentOnline, listener.HandlerWentOffline)

if err != nil {
util.Log.Fatalf("twitch app credentials are invalid: %s", err)
Expand Down
Loading

0 comments on commit 50e81cb

Please sign in to comment.