This file contains 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
const ws = new WebSocket("wss://gateway.discord.gg/?encoding=json&v=9") | |
const token = "" | |
const myUsername = "" | |
const channelId = "" | |
const messageId = "" | |
const randomMessages = [ | |
"Pranks are the spice of life, just be sure it's not too spicy!", | |
"Life's a stage, and pranks are the improv.", | |
"Pranking: the art of surprise with a side of laughter.", |
This file contains 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
{ | |
"security.workspace.trust.untrustedFiles": "open", | |
"git.enableSmartCommit": true, | |
"editor.defaultFormatter": "esbenp.prettier-vscode", | |
"editor.formatOnSave": true, | |
"editor.bracketPairColorization.enabled": true, | |
"editor.guides.bracketPairs": "active", | |
"editor.fontLigatures": true, | |
"editor.tabSize": 2, | |
"editor.suggest.snippetsPreventQuickSuggestion": true, |
This file contains 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
// GetFreeTCPPort asks the kernel for a free open port that is ready to use. | |
func GetFreeTCPPort() (port int, err error) { | |
var a *net.TCPAddr | |
if a, err = net.ResolveTCPAddr("tcp", "localhost:0"); err == nil { | |
var l *net.TCPListener | |
if l, err = net.ListenTCP("tcp", a); err == nil { | |
defer l.Close() | |
return l.Addr().(*net.TCPAddr).Port, nil | |
} | |
} |