INNER CODE UNIT · Go

isPrivate

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

func isPrivate(s *discordgo.Session, m *discordgo.MessageCreate) bool {
	channel, err := s.State.Channel(m.ChannelID)
	if err != nil {
		if channel, err = s.Channel(m.ChannelID); err != nil {
			return false
		}
	}
	return channel.Type == discordgo.ChannelTypeDM
}

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
		}

View source record →

📰 Research Paper
Loading…
⏳ Fetching content…