INNER CODE UNIT · Go

isChannel

instead-hub/instead · src/tiny/ifbot/discord-bot/main.go:76

func isChannel(s *discordgo.Session, m *discordgo.MessageCreate) bool {
	if len(ChannelsList) == 0 {
		return true
	}
	for _, id := range ChannelsList {
		if m.ChannelID == id {
			return true
		}
	}
	return false
}

func messageCreate(s *discordgo.Session, m *discordgo.MessageCreate) {

	// Ignore all messages created by the bot itself
	// This isn't required in this specific example but it's a good practice.
	if m.Author.ID == s.State.User.ID {
		return

View source record →

📰 Research Paper
Loading…
⏳ Fetching content…