VTGare / boe-tea-go

Source image bot for Discord
MIT License
20 stars 7 forks source link

Switch share and shareinclude #30

Closed XangelMusic closed 1 year ago

XangelMusic commented 1 year ago

Switched the share() and shareInclude() functions and commands to share() and shareExclude(). Modified command descriptions. share and shareExclude has the following Aliases:

pixiv, twitter, include, shareinclude, si
exclude, ex
VTGare commented 1 year ago

LGTM. I'll test this tomorrow before merging.

VTGare commented 1 year ago

While this works fine I want to propose a small change to the code, I would do it myself but since you're already on it, it can be a good exercise.

share and shareExclude are pretty much identical functions, we can remove some duplicate code here.

You can pass post.SkipMode argument to share, delete shareExclude entirely, replace hardcoded post.SkipMode in the function with the new argument, then just set the skip mode during command initialization.

VTGare commented 1 year ago

The branch got a little dirty, closing this.