diff --git a/main.go b/main.go index 535defe..9460054 100644 --- a/main.go +++ b/main.go @@ -49,6 +49,7 @@ func lookupWaitingUserIndex(userID string) int { func main() { discordToken := os.Getenv("DISCORD_TOKEN") + discordChannelId := os.Getenv("DISCORD_CHANNEL_ID") discord, err := discordgo.New("Bot " + discordToken) if err != nil { @@ -61,6 +62,14 @@ func main() { }) discord.AddHandler(func(s *discordgo.Session, i *discordgo.InteractionCreate) { if i.Type == discordgo.InteractionApplicationCommand { + if i.ChannelID != discordChannelId { + s.InteractionRespond(i.Interaction, &discordgo.InteractionResponse{ + Type: discordgo.InteractionResponseChannelMessageWithSource, + Data: &discordgo.InteractionResponseData{ + Content: "使うチャンネルを間違ってますよ。", + }, + }) + } roles, _ := s.GuildRoles(i.GuildID) var discordWaintingRoleId string for _, role := range roles {