123456789101112131415161718192021222324 |
- package discord
- import (
- "github.com/bwmarrin/discordgo"
- )
- // GetMember gets a discord member.
- // session : An active discordgo session
- // guid : The ID of the Guild
- // uid : The ID of a User.
- func GetMember(session *discordgo.Session, guid, uid string) (*discordgo.Member, error) {
- return session.GuildMember(guid, uid)
- }
- // UpdateMember edits the roles of a member.
- // session : An active discordgo session
- // guid : The ID of the Guild
- // template : GuildMemberParams for Role and Nick
- // roles : A list of role ID's to set on the member.
- func UpdateMember(session *discordgo.Session, guid, uid string, template *discordgo.GuildMemberParams) error {
- _, err := session.GuildMemberEdit(guid, uid, template)
- return err
- }
|