Skip to content

Commit

Permalink
Merge pull request #516 from barbequeorbarbecue/fix-category-filter-u…
Browse files Browse the repository at this point in the history
…pdate

fix: category filter condition_type is not updated when condition_type value is 0
  • Loading branch information
senchabot-github authored Oct 12, 2024
2 parents 7ce984f + c80a5de commit 7baee74
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 6 deletions.
8 changes: 4 additions & 4 deletions apps/discord-bot/internal/command/settwitch.go
Original file line number Diff line number Diff line change
Expand Up @@ -366,9 +366,9 @@ func SetTwitchCommandMetadata() *discordgo.ApplicationCommand {
// set-twitch announcement category-filter
{
Name: "category-filter",
Description: "Filtering Discord channel-specific Twitch stream category for announcement. (?i)Just Chatting",
Description: "Filtering Discord channel-specific Twitch stream category for announcement (case-sensitive). Just Chatting",
DescriptionLocalizations: map[discordgo.Locale]string{
discordgo.Turkish: "Discord kanalına özgü yayın duyurularının filtrelenmesi. (?i)Just Chatting",
discordgo.Turkish: "Discord kanalına özgü yayın duyurularının filtrelenmesi (büyük/küçük harf duyarlı). Just Chatting",
},
Type: discordgo.ApplicationCommandOptionSubCommand,
Options: []*discordgo.ApplicationCommandOption{
Expand All @@ -388,9 +388,9 @@ func SetTwitchCommandMetadata() *discordgo.ApplicationCommand {
{
Type: discordgo.ApplicationCommandOptionString,
Name: "regex",
Description: "RegEx string. For example: (?i)Just Chatting",
Description: "RegEx string. For example(case-sensitive): Just Chatting",
DescriptionLocalizations: map[discordgo.Locale]string{
discordgo.Turkish: "RegEx dizesi. Örneğin: (?i)Just Chatting",
discordgo.Turkish: "RegEx dizesi. Örneğin(büyük/küçük harf duyarlı): Just Chatting",
},
Required: true,
},
Expand Down
1 change: 1 addition & 0 deletions apps/discord-bot/internal/service/service.go
Original file line number Diff line number Diff line change
Expand Up @@ -218,6 +218,7 @@ func (s *service) DeleteDiscordTwitchLiveAnnosByGuildId(ctx context.Context, ser
return s.DB.DeleteDiscordTwitchLiveAnnosByGuildId(ctx, serverId)
}
func (s *service) DeleteDiscordTwitchLiveAnnosByChannelId(ctx context.Context, channelId string) (bool, error) {
// TODO: Delete streamers from streamers data
return s.DB.DeleteDiscordTwitchLiveAnnosByChannelId(ctx, channelId)
}
func (s *service) GetDiscordChannelTwitchCategoryFilter(ctx context.Context, serverId string, channelId string) ([]*model.DiscordChannelTwitchCategoryFilter, error) {
Expand Down
2 changes: 1 addition & 1 deletion apps/discord-bot/internal/service/streamer/streamer.go
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@ func DeleteServerFromData(serverId string) bool {
func GetTwitchUserInfo(twitchUsername string) (string, *model.TwitchUserInfo) {
userInfo, err := twsrvc.GetTwitchUserInfo("login", twitchUsername)
if err != nil {
log.Println("[GetTwitchUserInfo] twsrvc.GetTwitchUserInfo error:", err.Error())
log.Println("[GetTwitchUserInfo] twsrvc.GetTwitchUserInfo (login: "+twitchUsername+") error:", err.Error())
//return fmt.Sprintf("`%v` kullanıcı adlı Twitch yayıncısı Twitch'te bulunamadı.", twitchUsername), nil
return "Twitch streamer with username `" + twitchUsername + "` was not found.", nil
}
Expand Down
2 changes: 1 addition & 1 deletion db/postgresql/discord.go
Original file line number Diff line number Diff line change
Expand Up @@ -397,7 +397,7 @@ func (m *postgresql) SetDiscordChannelTwitchCategoryFilter(ctx context.Context,
return false, errors.New("(SetDiscordChannelTwitchCategoryFilter) GetDiscordChannelTwitchCategoryFilter Error:" + err.Error())
}
if len(dcTwitchCF) > 0 {
result := m.DB.Model(&dcTwitchCF).Updates(model.DiscordChannelTwitchCategoryFilter{
result := m.DB.Model(&dcTwitchCF).Select("anno_server_id", "anno_channel_id", "category_filter_regex", "condition_type").Updates(model.DiscordChannelTwitchCategoryFilter{
AnnoChannelID: annoChannelId,
AnnoServerID: annoServerId,
CategoryFilterRegex: categoryFilterRegex,
Expand Down

0 comments on commit 7baee74

Please sign in to comment.