Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func SendProfInformation ¶
func SendProfInformation(sess *discordgo.Session, i *discordgo.InteractionCreate, prof ProfNode) error
SendProfInformation reply to an interaction with information about a professor. sess : discord session. i : discord interaction. prof : professor information to send. return: error if any.
Types ¶
type Node ¶ added in v1.5.0
type Node struct { Typename string `json:"__typename"` AvgDifficulty float64 `json:"avgDifficulty"` AvgRating float64 `json:"avgRating"` Department string `json:"department"` FirstName string `json:"firstName"` ID string `json:"id"` IsSaved bool `json:"isSaved"` LastName string `json:"lastName"` LegacyID int64 `json:"legacyId"` NumRatings int64 `json:"numRatings"` School struct { ID string `json:"id"` Name string `json:"name"` } `json:"school"` WouldTakeAgainPercent float64 `json:"wouldTakeAgainPercent"` }
Node represents a single professor
type ProfNode ¶
a single prof from rmp
func FilterProfNodes ¶
func FilterProfNodes(profs SearchResponse) []ProfNode
FilterProfNodes get prof nodes from search result. return: list of prof nodes
type SearchQuery ¶
type SearchQuery struct { Query string `json:"query"` Variables struct { SchoolID string `json:"schoolID"` // contains filtered or unexported fields } `json:"variables"` }
a search query for rmp
type SearchResponse ¶ added in v1.5.0
type SearchResponse struct { Data struct { Search struct { Teachers struct { DidFallback bool `json:"didFallback"` Edges []ProfNode `json:"edges"` Filters []struct { Field string `json:"field"` Options []struct { ID string `json:"id"` Value string `json:"value"` } `json:"options"` } `json:"filters"` PageInfo struct { EndCursor string `json:"endCursor"` HasNextPage bool `json:"hasNextPage"` } `json:"pageInfo"` ResultCount int64 `json:"resultCount"` } `json:"teachers"` } `json:"search"` } `json:"data"` Errors []struct { Locations []struct { Column int64 `json:"column"` Line int64 `json:"line"` } `json:"locations"` Message string `json:"message"` Path []string `json:"path"` } `json:"errors"` }
api response when searching for a prof
func SearchRmpProfByName ¶
func SearchRmpProfByName(name string) SearchResponse
SearchRmpProfByName search for a Seneca professor by name on RMP, using the graphql api name: the name of the professor to search for Returns a `searchResponse` struct
Click to show internal directories.
Click to hide internal directories.