Last active
September 19, 2020 12:26
-
-
Save maiacodes/f937d3d1371062b6b917219656ebb801 to your computer and use it in GitHub Desktop.
Send DMs in DiscordGo
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| package main | |
| import ( | |
| "github.com/bwmarrin/discordgo" | |
| ) | |
| func sendDM(userID string, content string, session *discordgo.Session) { | |
| DMChannel, err := session.UserChannelCreate(userID) | |
| if err != nil { | |
| return | |
| } | |
| session.ChannelMessageSend(DMChannel.ID, content) | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment