Skip to content

Commit

Permalink
Merge pull request #526 from senchabot-opensource/dev
Browse files Browse the repository at this point in the history
dev -> main
  • Loading branch information
senchabot-github authored Dec 22, 2024
2 parents 4f50572 + cebe629 commit bcae72e
Show file tree
Hide file tree
Showing 5 changed files with 7 additions and 222 deletions.
110 changes: 0 additions & 110 deletions .github/workflows/discord-test-bot-deploy.yml

This file was deleted.

108 changes: 0 additions & 108 deletions .github/workflows/twitch-test-bot-deploy.yml

This file was deleted.

2 changes: 1 addition & 1 deletion apps/discord-bot/internal/command/settwitch.go
Original file line number Diff line number Diff line change
Expand Up @@ -366,7 +366,7 @@ func SetTwitchCommandMetadata() *discordgo.ApplicationCommand {
// set-twitch announcement category-filter
{
Name: "category-filter",
Description: "Filtering Discord channel-specific Twitch stream category for announcement (case-sensitive). Just Chatting",
Description: "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 (büyük/küçük harf duyarlı). Just Chatting",
},
Expand Down
4 changes: 3 additions & 1 deletion apps/discord-bot/internal/handler/guildcreate.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,12 @@ import (
func (h *handler) GuildCreate() {
ctx := context.Background()
h.discordClient.AddHandler(func(s *discordgo.Session, g *discordgo.GuildCreate) {
log.Println("[handler.GuildCreate] Adding the guild `" + g.Name + "` (ID: " + g.ID + ") to the database")
err := h.service.AddServerToDB(ctx, g.ID, g.Name, g.OwnerID)
if err != nil {
log.Println("[GuildCreate] AddServerToDB error:", err.Error())
log.Println("[handler.GuildCreate] AddServerToDB error:", err.Error())
}
log.Println("[handler.GuildCreate] Initiate Twitch live streaming checks for the guild `" + g.Name + "` (ID: " + g.ID + ")")
streamer.StartCheckLiveStreams(s, ctx, h.service, g.ID)
})
}
5 changes: 3 additions & 2 deletions apps/discord-bot/internal/handler/guilddelete.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,15 +11,16 @@ import (
func (h *handler) GuildDelete() {
ctx := context.Background()
h.discordClient.AddHandler(func(s *discordgo.Session, g *discordgo.GuildDelete) {
log.Println("[handler.GuildDelete] Delete records for the guild `" + g.Name + "` (ID: " + g.ID + ")")
err := h.service.DeleteServerFromDB(ctx, g.ID)
if err != nil {
log.Println("[GuildDelete] DeleteServerFromDB error:", err.Error())
log.Println("[handler.GuildDelete] DeleteServerFromDB error:", err.Error())
}
streamer.StopCheckLiveStreams(g.ID)
streamer.DeleteServerFromData(g.ID)
_, err = h.service.DeleteDiscordTwitchLiveAnnosByGuildId(ctx, g.ID)
if err != nil {
log.Println("[GuildDelete] DeleteDiscordTwitchLiveAnnosByGuildId error:", err.Error())
log.Println("[handler.GuildDelete] DeleteDiscordTwitchLiveAnnosByGuildId error:", err.Error())
}
})
}

0 comments on commit bcae72e

Please sign in to comment.