Documentation
¶
Index ¶
- Constants
- func Bypass(client *http.Client, serverid string, token string, invite string) error
- func CommonHeaders(req *http.Request) *http.Request
- func Contains(s []string, e string) bool
- func DecodeBr(data []byte) ([]byte, error)
- func EncodeImg(pathToImage string) (string, error)
- func FindMessage(channel string, messageid string, token string) (string, error)
- func GetFiles(dir string) ([]string, error)
- func GetReactions(channel string, message string, token string, emoji string, after string) ([]string, error)
- func HandleOutOfBounds()
- func ProcessAvatar(av string, memberid string) error
- func RandomResult() []string
- func ReadBody(resp http.Response) ([]byte, error)
- func ReadLines(filename string) ([]string, error)
- func RegisterHeaders(req *http.Request) *http.Request
- func RemoveDuplicateStr(strSlice []string) []string
- func RemoveSubset(s []string, r []string) []string
- func Ring(httpClient *http.Client, auth string, snowflake string) (int, error)
- func Scrape(ws *Connection, Guild string, Channel string, index int) error
- func ScrapeOffline(c *Connection, guild string, query string) error
- func Snowflake() int64
- func TruncateLines(filename string, line []string) error
- func ValidateBios(bios []string) []string
- func WriteLines(filename string, line string) error
- func XContextGen(guildID string, channelID string, ChannelType float64) (string, error)
- type AvatarChange
- type CallData
- type CallEvent
- type ClientState
- type Config
- type Connection
- type Custom
- type CustomEvent
- type Data
- type Embed
- type EmbedAuthor
- type EmbedField
- type EmbedFooter
- type EmbedProvider
- type Emoji
- type Event
- type FormField
- type Guilds
- type Identify
- type Instance
- func (in *Instance) AvatarChanger(avatar string) (http.Response, error)
- func (in *Instance) BioChanger(bios []string) error
- func (in *Instance) BlockUser(userid string) (int, error)
- func (in *Instance) Call(snowflake string) error
- func (in *Instance) CheckToken() int
- func (in *Instance) CloseDMS(snowflake string) (int, error)
- func (in *Instance) ContextProperties(invite, cookie, fingerprint string) (string, error)
- func (in *Instance) Friend(Username string, Discrim int) (*http.Response, error)
- func (in *Instance) GetCfBm(m, r, cookies string) (string, error)
- func (in *Instance) GetCookieString() (string, error)
- func (in *Instance) GetFingerprintString(cookie string) (string, error)
- func (in *Instance) Invite(Code string) error
- func (in *Instance) Inviter(invitationCode string, mode int, cookie string, fingerprint string) (int, string, string, error)
- func (in *Instance) Leave(serverid string) int
- func (in *Instance) NameChanger(name string) (http.Response, error)
- func (in *Instance) NewConnection(fatalHandler func(err error)) (*Connection, error)
- func (in *Instance) OpenChannel(recepientUID string) (string, error)
- func (in *Instance) React(channelID string, MessageID string, Emoji string) error
- func (in *Instance) SendMessage(channelSnowflake string, memberid string) (http.Response, error)
- func (in *Instance) ServerCheck(serverid string) (int, error)
- func (in *Instance) SolveCaptcha(sitekey string, cookie string, rqData string, rqToken string) (string, error)
- func (in *Instance) SolveCaptcha2Captcha(sitekey string) (string, error)
- func (in *Instance) SolveCaptchaCapmonster(sitekey string, cookies string, rqdata string) (string, error)
- func (in *Instance) SolveCaptchaDeathByCaptcha(sitekey string) (string, error)
- func (in *Instance) SolveCaptchaRucaptcha(sitekey string, rqData string, rqToken string) (string, error)
- func (in *Instance) StartWS() error
- func (in *Instance) UserInfo(userid string) (UserInf, error)
- type Intent
- type Member
- type Message
- type MessageEmbedImage
- type MessageEmbedThumbnail
- type NameChange
- type Ops
- type Pload
- type Presence
- type Properties
- type Reaction
- type Reactionx
- type Resp
- type RingData
- type Sol
- type Task
- type User
- type UserInf
- type Userinfo
- type XContext
Constants ¶
const ( OpcodeDispatch = iota OpcodeHeartbeat OpcodeIdentify OpcodePresenceUpdate OpcodeVoiceStateUpdate OpcodeResume = iota + 1 OpcodeReconnect OpcodeRequestGuildMembers OpcodeInvalidSession OpcodeHello OpcodeHeartbeatACK )
const ( EventNameMessageCreate = "MESSAGE_CREATE" EventNameMessageUpdate = "MESSAGE_UPDATE" EventNameReady = "READY" EventNameResumed = "RESUMED" )
const UserAgent = "Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:83.0) Gecko/20100101 Firefox/83.0"
const Useragent = "" /* 143-byte string literal not displayed */
const XSuper = "" /* 520-byte string literal not displayed */
const XSuperProp = "" /* 292-byte string literal not displayed */
const XTrack = "" /* 516-byte string literal not displayed */
Variables ¶
This section is empty.
Functions ¶
func GetReactions ¶
func HandleOutOfBounds ¶
func HandleOutOfBounds()
func ProcessAvatar ¶
func RandomResult ¶
func RandomResult() []string
func RemoveDuplicateStr ¶
func RemoveSubset ¶
Inputs 2 slices of strings and returns a slice of strings which does not contain elements from the second slice
func ScrapeOffline ¶
func ScrapeOffline(c *Connection, guild string, query string) error
func TruncateLines ¶
func ValidateBios ¶
func WriteLines ¶
Types ¶
type AvatarChange ¶
type AvatarChange struct {
Avatar string `json:"avatar"`
}
type ClientState ¶
type Config ¶
type Config struct {
Delay int `json:"individual_delay"`
LongDelay int `json:"rate_limit_delay"`
Offset int `json:"offset"`
Skip bool `json:"skip_completed"`
Proxy string `json:"proxy"`
Call bool `json:"call"`
Remove bool `json:"remove_dead_tokens"`
RemoveM bool `json:"remove_completed_members"`
Stop bool `json:"stop_dead_tokens"`
Mutual bool `json:"check_mutual"`
Friend bool `json:"friend_before_DM"`
Websocket bool `json:"online_tokens"`
SleepSc int `json:"online_scraper_delay"`
ProxyFromFile bool `json:"proxy_from_file"`
ProxyProtocol string `json:"proxy_protocol"`
MaxDMS int `json:"max_dms_per_token"`
Receive bool `json:"receive_messages"`
GatewayProxy bool `json:"use_proxy_for_gateway"`
Timeout int `json:"timeout"`
SkipFailed bool `json:"skip_failed"`
ClientKey string `json:"captcha_api_key"`
CaptchaAPI string `json:"captcha_api"`
MaxInvite int `json:"max_attempt_invite_rejoin"`
DisableKL bool `json:"disable_keep_alives"`
ScrapeUsernames bool `json:"scrape_usernames"`
ScrapeAvatars bool `json:"scrape_avatars"`
ProxyForCaptcha bool `json:"proxy_for_captcha"`
Block bool `json:"block_after_dm"`
Close bool `json:"close_dm_after_message"`
}
type Connection ¶
type Connection struct {
Members []string
OfflineScrape chan []byte
AllMembers []string
Messages chan []byte
Complete bool
Conn *websocket.Conn
// contains filtered or unexported fields
}
Define WebSocket connection struct
func (*Connection) Close ¶
func (c *Connection) Close() error
func (*Connection) Ping ¶
func (c *Connection) Ping(interval time.Duration)
func (*Connection) ReadHello ¶
func (c *Connection) ReadHello() (int, error)
Read Hello function to read hello message from websocket return 0 if next message is not a hello message or return the heartbeat interval
func (*Connection) WriteJSONe ¶
func (c *Connection) WriteJSONe(e *Event) error
Function to write event
func (*Connection) WriteRaw ¶
func (c *Connection) WriteRaw(e interface{}) error
Send interface to websocket
type CustomEvent ¶
type Data ¶
type Data struct {
Message
Identify
ClientState ClientState `json:"client_state,omitempty"`
HeartbeatInterval int `json:"heartbeat_interval,omitempty"`
SessionID string `json:"session_id,omitempty"`
Sequence int `json:"seq,omitempty"` // For sending only
GuildId interface{} `json:"guild_id,omitempty"`
Channels map[string]interface{} `json:"channels,omitempty"`
Ops []Ops `json:"ops,omitempty"`
ChannelID string `json:"channel_id,omitempty"`
Members []Member `json:"members,omitempty"`
Typing bool `json:"typing,omitempty"`
Threads bool `json:"threads,omitempty"`
Activities bool `json:"activities,omitempty"`
ThreadMemberLists interface{} `json:"thread_member_lists,omitempty"`
}
type Embed ¶
type Embed struct {
Title string `json:"title,omitempty"`
// The type of embed. Always EmbedTypeRich for webhook embeds.
Type string `json:"type,omitempty"`
Description string `json:"description,omitempty"`
URL string `json:"url,omitempty"`
Image *MessageEmbedImage `json:"image,omitempty"`
// The color code of the embed.
Color int `json:"color,omitempty"`
Thumbnail *MessageEmbedThumbnail `json:"thumbnail,omitempty"`
Provider EmbedProvider `json:"provider,omitempty"`
Author EmbedAuthor `json:"author,omitempty"`
Fields []EmbedField `json:"fields,omitempty"`
}
type EmbedAuthor ¶
type EmbedField ¶
type EmbedFooter ¶
type EmbedFooter struct {
}
type EmbedProvider ¶
type Identify ¶
type Identify struct {
Token string `json:"token,omitempty"`
Properties Properties `json:"properties,omitempty"`
Capabilities int `json:"capabilities,omitempty"`
Compress bool `json:"compress,omitempty"`
Presence Presence `json:"presence,omitempty"`
}
type Instance ¶
type Instance struct {
Token string
Password string
Proxy string
Cookie string
Fingerprint string
Messages []Message
Count int
LastQuery string
LastCount int
Members []User
AllMembers []User
Rejoin int
ScrapeCount int
ID string
Receiver bool
Config Config
GatewayProxy string
Client *http.Client
WG *sync.WaitGroup
Ws *Connection
// contains filtered or unexported fields
}
func (*Instance) AvatarChanger ¶
@me Discord Patch request to change Avatar
func (*Instance) BioChanger ¶
func (*Instance) CheckToken ¶
func (*Instance) ContextProperties ¶
func (*Instance) GetCookieString ¶
func (*Instance) GetFingerprintString ¶
Getting Fingerprint to use in our requests for more legitimate seeming requests.
func (*Instance) Inviter ¶
func (in *Instance) Inviter(invitationCode string, mode int, cookie string, fingerprint string) (int, string, string, error)
New Invite joiner
func (*Instance) NameChanger ¶
@me Discord Patch request to change Username
func (*Instance) NewConnection ¶
func (in *Instance) NewConnection(fatalHandler func(err error)) (*Connection, error)
Input Discord token and start a new websocket connection
func (*Instance) SendMessage ¶
Inputs the Channel snowflake and sends them the message; outputs the response code for error handling.
func (*Instance) SolveCaptcha ¶
func (*Instance) SolveCaptcha2Captcha ¶
func (*Instance) SolveCaptchaCapmonster ¶
func (in *Instance) SolveCaptchaCapmonster(sitekey string, cookies string, rqdata string) (string, error)
Function to use a captcha solving service and return a solved captcha key
func (*Instance) SolveCaptchaDeathByCaptcha ¶
Incomplete
func (*Instance) SolveCaptchaRucaptcha ¶
type Intent ¶
type Intent int
const ( IntentsGuilds Intent = 1 << 0 IntentsGuildMembers Intent = 1 << 1 IntentsGuildBans Intent = 1 << 2 IntentsGuildEmojis Intent = 1 << 3 IntentsGuildIntegrations Intent = 1 << 4 IntentsGuildWebhooks Intent = 1 << 5 IntentsGuildInvites Intent = 1 << 6 IntentsGuildVoiceStates Intent = 1 << 7 IntentsGuildPresences Intent = 1 << 8 IntentsGuildMessages Intent = 1 << 9 IntentsGuildMessageReactions Intent = 1 << 10 IntentsGuildMessageTyping Intent = 1 << 11 IntentsDirectMessages Intent = 1 << 12 IntentsDirectMessageReactions Intent = 1 << 13 IntentsDirectMessageTyping Intent = 1 << 14 IntentsAllWithoutPrivileged = IntentsGuilds | IntentsGuildBans | IntentsGuildEmojis | IntentsGuildIntegrations | IntentsGuildWebhooks | IntentsGuildInvites | IntentsGuildVoiceStates | IntentsGuildMessages | IntentsGuildMessageReactions | IntentsGuildMessageTyping | IntentsDirectMessages | IntentsDirectMessageReactions | IntentsDirectMessageTyping IntentsAll = IntentsAllWithoutPrivileged | IntentsGuildMembers | IntentsGuildPresences IntentsNone Intent = 0 )
Constants for the different bit offsets of intents
type Message ¶
type Message struct {
Content string `json:"content,omitempty"`
Embeds []Embed `json:"embeds,omitempty"`
Reactions []Reaction `json:"reactions,omitempty"`
Author User `json:"author,omitempty"`
GuildID string `json:"guild_id,omitempty"`
}
func GetMessage ¶
type MessageEmbedImage ¶
type MessageEmbedThumbnail ¶
type NameChange ¶
type Properties ¶
type Properties struct {
OS string `json:"os,omitempty"`
Browser string `json:"browser,omitempty"`
Device string `json:"device,omitempty"`
BrowserUserAgent string `json:"browser_user_agent,omitempty"`
BrowserVersion string `json:"browser_version,omitempty"`
OSVersion string `json:"os_version,omitempty"`
Referrer string `json:"referrer,omitempty"`
ReferringDomain string `json:"referring_domain,omitempty"`
ReferrerCurrent string `json:"referrer_current,omitempty"`
ReferringDomainCurrent string `json:"referring_domain_current,omitempty"`
ReleaseChannel string `json:"release_channel,omitempty"`
ClientBuildNumber int `json:"client_build_number,omitempty"`
}
type Task ¶
type Task struct {
Type string `json:"type"`
WebsiteURL string `json:"websiteURL"`
WebsiteKey string `json:"websiteKey"`
ProxyType string `json:"proxyType"`
ProxyAddress string `json:"proxyAddress"`
ProxyPort int `json:"proxyPort"`
ProxyLogin string `json:"proxyLogin"`
Data string `json:"data"`
ProxyPassword string `json:"proxyPassword"`
UserAgent string `json:"userAgent"`
Cookies string `json:"cookies`
}