Closed tenax66 closed 1 year ago
I got a 405 error HTTP 405 Method Not Allowed, {"message": "405: Method Not Allowed", "code": 0} for the following simple code that sends a message with a given channel ID. Did the Discord API actually not accept the method anymore?
HTTP 405 Method Not Allowed, {"message": "405: Method Not Allowed", "code": 0}
package main import ( "log" "github.com/bwmarrin/discordgo" ) func main() { token := "YOUR_BOT_TOKEN" dg, _ := discordgo.New("Bot " + token) _ = dg.Open() channelID := "TEXT_CHANNEL_ID" message := "Hello, world!" if _, err := dg.ChannelMessageSend(channelID, message); err != nil { log.Println("Error sending message:", err) return } dg.Close() }
Sorry for the trouble, I resolved this. The channelID I gave was incorrect so that error occured. (though different from the error message)
channelID
I got a 405 error
HTTP 405 Method Not Allowed, {"message": "405: Method Not Allowed", "code": 0}
for the following simple code that sends a message with a given channel ID. Did the Discord API actually not accept the method anymore?