Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

dev -> main #514

Merged
merged 27 commits into from
Sep 15, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
27 commits
Select commit Hold shift + click to select a range
75b0882
refactor(apps/web): add dynamic `platform` route
eckoln Jun 26, 2024
53ca7e4
refactor(apps/web)!: codebase
eckoln Jul 6, 2024
99029c0
Merge pull request #8 from eckoln:eckoln/codebase
eckoln Jul 14, 2024
da93759
chore(apps/web): upgrade `[email protected]`
eckoln Jul 14, 2024
760032d
feat(apps/web): add `platform` label to before entity-names
eckoln Jul 14, 2024
1764989
refactor(apps/web): `commands-list`
eckoln Jul 14, 2024
e2513c7
refactor(apps/web): `create-command` & `share-command` button changes
eckoln Jul 14, 2024
31dd026
refactor(apps/web): `entities-dropdown` popover width
eckoln Jul 14, 2024
191ad04
fix(apps/web): added missing scope to discord join
eckoln Jul 21, 2024
314aee7
feat(apps/web): add cached use-session hook
eckoln Aug 10, 2024
2417508
refactor(apps/web)!: codebase
eckoln Aug 23, 2024
cdc5c64
feat(apps/web): added `event-channels` feature
eckoln Aug 23, 2024
99b15f0
Merge pull request #9 from eckoln/eckoln/codebase
eckoln Aug 23, 2024
d859450
Merge pull request #10 from eckoln/eckoln/feature-event-channels
eckoln Aug 23, 2024
df754ad
feat(apps/web): ui changes for `event-channels`
eckoln Aug 25, 2024
352db15
Merge pull request #11 from eckoln/eckoln/feature-event-channels
eckoln Aug 25, 2024
a5dfb96
fix(apps/web): text ui
eckoln Aug 26, 2024
af58e80
fix(apps/web): command update schema & added revalidation to after su…
eckoln Aug 26, 2024
0d28c85
fix(apps/web): typo
eckoln Aug 26, 2024
86d8ae2
fix(apps/web): typo
eckoln Aug 26, 2024
3846d28
Merge pull request #506 from eckoln/eckoln/dev
eckoln Aug 26, 2024
79112b9
feat(apps/discord-bot): add category filter and announcement channel …
barbequeorbarbecue Sep 8, 2024
dec6dcf
feat(apps/twitch-bot): add leave command (#510)
barbequeorbarbecue Sep 8, 2024
590b943
Translate Description (#508)
igdiaysu Sep 12, 2024
bd6b662
feat(apps/discord-bot): add English translations for set-twitch and d…
barbequeorbarbecue Sep 14, 2024
57afdb3
fix(apps/twitch-bot): add cmdResp nil check for system command respon…
barbequeorbarbecue Sep 15, 2024
7ce984f
feat(apps/twitch-bot): add timer command for command timer info (#513)
barbequeorbarbecue Sep 15, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
66 changes: 44 additions & 22 deletions apps/discord-bot/internal/command/deltwitch.go
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,9 @@ func (c *commands) DelTwitchCommand(ctx context.Context, s *discordgo.Session, i
}

if !ok {
ephemeralRespond(s, i, "`"+twitchUsername+"` kullanıcı adlı Twitch yayıncısı veritabanında bulunamadı.")
// * TR
// ephemeralRespond(s, i, "`"+twitchUsername+"` kullanıcı adlı Twitch yayıncısı veritabanında bulunamadı.")
ephemeralRespond(s, i, "Twitch streamer with username `"+twitchUsername+"` is not found in our database.")
return
}

Expand All @@ -45,7 +47,9 @@ func (c *commands) DelTwitchCommand(ctx context.Context, s *discordgo.Session, i
ephemeralRespond(s, i, "There was a problem when deleting Twitch streamer `"+uInfo.Login+"`")
return
}
ephemeralRespond(s, i, "`"+uInfo.Login+"` kullanıcı adlı Twitch streamer veritabanından silindi.")
// TR
// ephemeralRespond(s, i, "`"+uInfo.Login+"` kullanıcı adlı Twitch streamer veritabanından silindi.")
ephemeralRespond(s, i, "Twitch streamer with username `"+uInfo.Login+"` deleted from the database.")

// del-twitch event-channel
case "event-channel":
Expand All @@ -60,10 +64,14 @@ func (c *commands) DelTwitchCommand(ctx context.Context, s *discordgo.Session, i
return
}
if !ok {
ephemeralRespond(s, i, "`"+channelName+"` isimli yazı kanalı yayın etkinlik yazı kanalları listesinde bulunamadı.")
// TR
// ephemeralRespond(s, i, "`"+channelName+"` isimli yazı kanalı yayın etkinlik yazı kanalları listesinde bulunamadı.")
ephemeralRespond(s, i, "The text channel named `"+channelName+"` was not found in the list of event text channels.")
return
}
ephemeralRespond(s, i, "`"+channelName+"` isimli yazı kanalı yayın etkinlik yazı kanalları listesinden kaldırıldı.")
// TR
// ephemeralRespond(s, i, "`"+channelName+"` isimli yazı kanalı yayın etkinlik yazı kanalları listesinden kaldırıldı.")
ephemeralRespond(s, i, "The text channel named `"+channelName+"` removed from the list of event text channels.")

// del-twitch announcement
case "announcement":
Expand All @@ -78,10 +86,10 @@ func (c *commands) DelTwitchCommand(ctx context.Context, s *discordgo.Session, i
return
}

log.Println("liveAnnosLength", liveAnnosLength)
if liveAnnosLength > 0 {
ephemeralRespond(s, i, "Twitch yayıncısına özgü yayın duyuru kanalı olmayan yayıncılar veritabanında bulunduğu için varsayılan Twitch canlı yayın duyuru kanalı ayarını silemezsiniz.")
// EN: You cannot delete the default channel setting as there are streamers without a custom channel setting
ephemeralRespond(s, i, "You cannot delete the default Twitch live stream announcement channel setting because there are streamers in the database who do not have a custom stream announcement channel set.")
// TR
// Veritabanında özel yayın duyuru kanalı ayarlanmamış yayıncılar bulunduğu için varsayılan Twitch canlı yayın duyuru kanalı ayarını silemezsiniz.
return
}

Expand All @@ -96,18 +104,23 @@ func (c *commands) DelTwitchCommand(ctx context.Context, s *discordgo.Session, i
ephemeralRespond(s, i, config.ErrorMessage+"#0002")
return
}
ephemeralRespond(s, i, "Varsayılan Twitch canlı yayın duyuru kanalı ayarı kaldırıldı.")
// TR
// ephemeralRespond(s, i, "Varsayılan Twitch canlı yayın duyuru kanalı ayarı kaldırıldı.")
ephemeralRespond(s, i, "The default Twitch live stream announcement channel setting removed.")

// del-twitch announcement default-content
case "default-content":
_, err := service.DeleteDiscordBotConfig(ctx, i.GuildID, "stream_anno_default_content")
if err != nil {
log.Println("[command.DelTwitchCommand.announcement.default-content] DeleteDiscordBotConfig error:", err.Error())
// TODO: edit response message
ephemeralRespond(s, i, config.ErrorMessage+"#0001")
return
}

ephemeralRespond(s, i, "Yayın duyuru mesajı içeriği varsayılan olarak ayarlandı: `{stream.user}, {stream.category} yayınına başladı! {stream.url}`")
// TR
// ephemeralRespond(s, i, "Tarafınızdan ayarlanan varsayılan yayın duyuru mesajı içeriği kaldırıldı. Ve varsayılan yayın duyuru mesajı Senchabot varsayılanlarına sıfırlandı: `{twitch.username}, {stream.category} yayınına başladı! {twitch.url}`")
ephemeralRespond(s, i, "Removed the default stream announcement message content set by you. And message content has been reset to Senchabot defaults: `{twitch.username} has started streaming {stream.category}! {twitch.url}`")

// del-twitch announcement custom-content
case "custom-content":
Expand All @@ -129,11 +142,15 @@ func (c *commands) DelTwitchCommand(ctx context.Context, s *discordgo.Session, i
}

if !ok {
// TODO: edit response message
ephemeralRespond(s, i, config.ErrorMessage+"del-twitch:custom-content#0002")
return
}

ephemeralRespond(s, i, twitchUsername+" kullanıcı adlı Twitch yayıncısına özgü yayın duyuru mesajı silindi.")
//TR
// ephemeralRespond(s, i, twitchUsername+" kullanıcı adlı Twitch yayıncısının özel yayın duyuru mesajı silindi.")
ephemeralRespond(s, i, "Twitch streamer `"+twitchUsername+"` 's custom stream announcement message content has been deleted.")

// del-twitch announcement category-filter
case "category-filter":
options = options[0].Options
Expand All @@ -147,10 +164,14 @@ func (c *commands) DelTwitchCommand(ctx context.Context, s *discordgo.Session, i
return
}
if !ok {
ephemeralRespond(s, i, "`"+channelName+"` isimli yazı kanalı Twitch yayın duyurusu kategori filtrelemesi bulunamadı.")
// TR
// ephemeralRespond(s, i, "`"+channelName+"` isimli yazı kanalı için Twitch yayın duyuru kategori filtrelemesi bulunamadı.")
ephemeralRespond(s, i, "For the text channel named `"+channelName+"`, Twitch stream announcement category filtering was not found.")
return
}
ephemeralRespond(s, i, "`"+channelName+"` isimli yazı kanalı Twitch yayın duyurusu kategori filtrelemesi kaldırıldı.")
// TR
// ephemeralRespond(s, i, "`"+channelName+"` isimli yazı kanalı için Twitch yayın duyuru kategori filtrelemesi kaldırıldı.")
ephemeralRespond(s, i, "For the text channel named `"+channelName+"`, Twitch stream announcement category filtering removed.")
}
}
}
Expand All @@ -167,18 +188,19 @@ func DelTwitchCommandMetadata() *discordgo.ApplicationCommand {
// del-twitch streamer
{
Name: "streamer",
Description: "Delete the stream from live stream announcements.",
Description: "Delete streamer from live stream announcements.",
DescriptionLocalizations: map[discordgo.Locale]string{
// TODO: edit
discordgo.Turkish: "Yayın duyuru mesajı atılan yayıncıyı sil.",
},
Type: discordgo.ApplicationCommandOptionSubCommand,
Options: []*discordgo.ApplicationCommandOption{
{
Type: discordgo.ApplicationCommandOptionString,
Name: "twitch-username-or-url",
Description: "Twitch profile url or username",
Description: "Type Twitch profile url or username.",
DescriptionLocalizations: map[discordgo.Locale]string{
discordgo.Turkish: "Twitch kullanıcı profil linki veya kullanıcı adı",
discordgo.Turkish: "Twitch kullanıcı profil linkini veya kullanıcı adını yazınız.",
},
Required: true,
},
Expand Down Expand Up @@ -210,18 +232,18 @@ func DelTwitchCommandMetadata() *discordgo.ApplicationCommand {
// del-twitch announcement custom-content
{
Name: "custom-content",
Description: "Delete the streamer specific custom live stream announcement message content.",
Description: "Delete the streamer custom live stream announcement message content.",
DescriptionLocalizations: map[discordgo.Locale]string{
discordgo.Turkish: "Yayıncıya özgü yayın duyuru mesajını sil.",
discordgo.Turkish: "Yayıncıya özel yayın duyuru mesajını sil.",
},
Type: discordgo.ApplicationCommandOptionSubCommand,
Options: []*discordgo.ApplicationCommandOption{
{
Type: discordgo.ApplicationCommandOptionString,
Name: "twitch-username-or-url",
Description: "Twitch profile url or username",
Description: "Type Twitch profile url or username.",
DescriptionLocalizations: map[discordgo.Locale]string{
discordgo.Turkish: "Twitch kullanıcı profil linki veya kullanıcı adı",
discordgo.Turkish: "Twitch kullanıcı profil linkini veya kullanıcı adını yazınız.",
},
Required: true,
},
Expand Down Expand Up @@ -259,16 +281,16 @@ func DelTwitchCommandMetadata() *discordgo.ApplicationCommand {
Name: "event-channel",
Description: "Delete the live stream announcements channel setting to create Discord events for live streams.",
DescriptionLocalizations: map[discordgo.Locale]string{
discordgo.Turkish: "Canlı yayınların Discord etkinliklerini oluşturmak için canlı yayın duyuruları kanalını seç.",
discordgo.Turkish: "Canlı yayın Discord etkinliklerinin oluşturulduğu duyuru kanalını sil.",
},
Type: discordgo.ApplicationCommandOptionSubCommand,
Options: []*discordgo.ApplicationCommandOption{
{
Type: discordgo.ApplicationCommandOptionChannel,
Name: "channel",
Description: "The text channel where Twitch live stream announcements will be unfollowed",
Description: "Type the text channel where Twitch live stream announcements will be unfollowed",
DescriptionLocalizations: map[discordgo.Locale]string{
discordgo.Turkish: "Twitch yayın duyurularının takipten çıkarılacağı yazı kanalı",
discordgo.Turkish: "Twitch yayın duyurularının takipten çıkarılacağı yazı kanalını yazınız.",
},
ChannelTypes: []discordgo.ChannelType{
discordgo.ChannelTypeGuildNews,
Expand Down
2 changes: 1 addition & 1 deletion apps/discord-bot/internal/command/invite.go
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,6 @@ func (c *commands) InviteCommand(ctx context.Context, s *discordgo.Session, i *d
func InviteCommandMetadata() *discordgo.ApplicationCommand {
return &discordgo.ApplicationCommand{
Name: "invite",
Description: "Senchabot Discord bot invite url.",
Description: "Get Senchabot Discord bot invite url.",
}
}
8 changes: 6 additions & 2 deletions apps/discord-bot/internal/command/purge.go
Original file line number Diff line number Diff line change
Expand Up @@ -20,14 +20,16 @@ func (c *commands) PurgeCommand(ctx context.Context, s *discordgo.Session, i *di
events, err := s.GuildScheduledEvents(i.GuildID, false)
if err != nil {
log.Println("[command.PurgeCommand.events] GuildScheduledEvents error:", err.Error())
// TODO: edit respond or create errorMessage sheet
ephemeralRespond(s, i, config.ErrorMessage+"#1011")
}

for _, e := range events {
s.GuildScheduledEventDelete(i.GuildID, e.ID)
}

ephemeralRespond(s, i, "Tüm planlanmış etkinlikler silindi.")
// TR
// ephemeralRespond(s, i, "Tüm planlanmış etkinlikler silindi.")
ephemeralRespond(s, i, "All scheduled events have been deleted.")

case "last-100-channel-messages":
options = options[0].Options
Expand All @@ -38,6 +40,8 @@ func (c *commands) PurgeCommand(ctx context.Context, s *discordgo.Session, i *di
return
}

// TODO: "Something went wrong" → // TODO: edit respond + add error code or create errorMessage sheet

optionValue := options[0].StringValue()
channelID := i.ChannelID
var messageIDs []string
Expand Down
Loading
Loading