display not attendings and fix being able to add yourself multiple times
All checks were successful
ci/woodpecker/push/build Pipeline was successful
All checks were successful
ci/woodpecker/push/build Pipeline was successful
This commit is contained in:
parent
2f40ad1c34
commit
69c516daf5
1 changed files with 4 additions and 1 deletions
5
main.go
5
main.go
|
|
@ -90,7 +90,7 @@ func commandListener(event *events.ApplicationCommandInteractionCreate) {
|
|||
if data.CommandName() == "schedule" {
|
||||
err := event.CreateMessage(
|
||||
discord.NewMessageCreateBuilder().
|
||||
SetContent(fmt.Sprintf("Will you attend on %s?\n", data.String("date"))).
|
||||
SetContent(fmt.Sprintf("Will you attend on %s?\nAttending:\n\nNot Attending:\n", data.String("date"))).
|
||||
AddActionRow(
|
||||
discord.ButtonComponent{
|
||||
Style: discord.ButtonStylePrimary,
|
||||
|
|
@ -116,6 +116,8 @@ func interactListener(event *events.ComponentInteractionCreate) {
|
|||
case "attend":
|
||||
currentcontent := event.Message.Content
|
||||
event.UpdateMessage(discord.NewMessageUpdateBuilder().
|
||||
SetContent(strings.ReplaceAll(currentcontent, event.User().Username, "")).
|
||||
SetContent(strings.ReplaceAll(currentcontent, "Attending:\n", fmt.Sprintf("Attending:\n%s\n", event.User().Username))).
|
||||
SetContentf("%s\n%s\n", currentcontent, event.User().Username).
|
||||
Build(),
|
||||
)
|
||||
|
|
@ -123,6 +125,7 @@ func interactListener(event *events.ComponentInteractionCreate) {
|
|||
currentcontent := event.Message.Content
|
||||
event.UpdateMessage(discord.NewMessageUpdateBuilder().
|
||||
SetContent(strings.ReplaceAll(currentcontent, event.User().Username, "")).
|
||||
SetContent(strings.ReplaceAll(currentcontent, "Not Attending:\n", fmt.Sprintf("Not Attending:\n%s\n", event.User().Username))).
|
||||
Build(),
|
||||
)
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue