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 CapmonsterOutResponse
- type CapmonsterPayload
- type CapmonsterSubmitResponse
- type CaptchaSettings
- type ClientState
- type Config
- type Connection
- type Custom
- type CustomEvent
- type Data
- type DirectMessage
- 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) Capmonster(sitekey, website, rqdata, cookies string) (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) OpenChannelHeaders(req *http.Request, cookie string) *http.Request
- 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) SendMessageHeaders(req *http.Request, cookie, recipient string) *http.Request
- func (in *Instance) ServerCheck(serverid string) (int, error)
- func (in *Instance) SolveCaptcha(sitekey string, cookie string, rqData string, rqToken string, url string) (string, error)
- func (in *Instance) StartWS() error
- func (in *Instance) TypingHeaders(req *http.Request, cookie, snowflake string) *http.Request
- func (in *Instance) UserInfo(userid string) (UserInf, error)
- type Intent
- type Member
- type Message
- type MessageEmbedImage
- type MessageEmbedThumbnail
- type NameChange
- type Ops
- type OtherSettings
- type Presence
- type Properties
- type ProxySettings
- type Reaction
- type Reactionx
- type RingData
- type ScraperSettings
- type Solution
- type SuspicionAvoidance
- 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 = "" /* 152-byte string literal not displayed */
const Useragent = "" /* 143-byte string literal not displayed */
const XSuper = "" /* 288-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 FindMessage ¶ added in v1.0.6
func GetReactions ¶ added in v1.0.7
func HandleOutOfBounds ¶ added in v1.7.7
func HandleOutOfBounds()
func ProcessAvatar ¶ added in v1.8.0
func RandomResult ¶ added in v1.8.3
func RandomResult() []string
func RemoveDuplicateStr ¶ added in v1.0.7
func RemoveSubset ¶ added in v1.0.5
Inputs 2 slices of strings and returns a slice of strings which does not contain elements from the second slice
func Scrape ¶ added in v1.0.7
func Scrape(ws *Connection, Guild string, Channel string, index int) error
func ScrapeOffline ¶ added in v1.0.7
func ScrapeOffline(c *Connection, guild string, query string) error
func TruncateLines ¶ added in v1.0.5
func ValidateBios ¶ added in v1.8.0
func WriteLines ¶
Types ¶
type AvatarChange ¶ added in v1.0.7
type AvatarChange struct {
Avatar string `json:"avatar"`
}
type CapmonsterOutResponse ¶ added in v1.18.13
type CapmonsterPayload ¶ added in v1.18.13
type CapmonsterSubmitResponse ¶ added in v1.18.13
type CaptchaSettings ¶ added in v1.8.8
type ClientState ¶ added in v1.0.7
type Config ¶ added in v1.0.6
type Config struct {
DirectMessage DirectMessage `yaml:"direct_message_settings"`
ProxySettings ProxySettings `yaml:"proxy_settings"`
ScraperSettings ScraperSettings `yaml:"scraper_settings"`
CaptchaSettings CaptchaSettings `yaml:"captcha_settings"`
OtherSettings OtherSettings `yaml:"other_settings"`
SuspicionAvoidance SuspicionAvoidance `yaml:"suspicion_avoidance"`
}
type Connection ¶ added in v1.0.7
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 ¶ added in v1.0.7
func (c *Connection) Close() error
func (*Connection) Ping ¶ added in v1.0.7
func (c *Connection) Ping(interval time.Duration)
func (*Connection) ReadHello ¶ added in v1.0.7
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 ¶ added in v1.0.7
func (c *Connection) WriteJSONe(e *Event) error
Function to write event
func (*Connection) WriteRaw ¶ added in v1.0.7
func (c *Connection) WriteRaw(e interface{}) error
Send interface to websocket
type CustomEvent ¶ added in v1.0.7
type Data ¶ added in v1.0.7
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 DirectMessage ¶ added in v1.8.8
type DirectMessage struct {
Delay int `yaml:"individual_delay"`
LongDelay int `yaml:"rate_limit_delay"`
Offset int `yaml:"offset"`
Skip bool `yaml:"skip_completed"`
Call bool `yaml:"call"`
Remove bool `yaml:"remove_dead_tokens"`
RemoveM bool `yaml:"remove_completed_members"`
Stop bool `yaml:"stop_dead_tokens"`
Mutual bool `yaml:"check_mutual"`
Friend bool `yaml:"friend_before_DM"`
Websocket bool `yaml:"online_tokens"`
MaxDMS int `yaml:"max_dms_per_token"`
Receive bool `yaml:"receive_messages"`
SkipFailed bool `yaml:"skip_failed"`
Block bool `yaml:"block_after_dm"`
Close bool `yaml:"close_dm_after_message"`
}
type Embed ¶ added in v1.0.6
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 ¶ added in v1.0.6
type EmbedField ¶ added in v1.0.6
type EmbedFooter ¶ added in v1.0.6
type EmbedFooter struct {
}
type EmbedProvider ¶ added in v1.0.6
type Identify ¶ added in v1.0.7
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 ¶ added in v1.0.7
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
Retry 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 ¶ added in v1.0.7
@me Discord Patch request to change Avatar
func (*Instance) BioChanger ¶ added in v1.8.0
func (*Instance) Capmonster ¶ added in v1.18.13
func (*Instance) CheckToken ¶ added in v1.0.7
func (*Instance) ContextProperties ¶ added in v1.7.9
func (*Instance) GetCookieString ¶ added in v1.1.0
func (*Instance) GetFingerprintString ¶ added in v1.1.0
Getting Fingerprint to use in our requests for more legitimate seeming requests.
func (*Instance) Inviter ¶ added in v1.8.1
func (in *Instance) Inviter(invitationCode string, mode int, cookie string, fingerprint string) (int, string, string, error)
New Invite joiner
func (*Instance) NameChanger ¶ added in v1.0.7
@me Discord Patch request to change Username
func (*Instance) NewConnection ¶ added in v1.7.9
func (in *Instance) NewConnection(fatalHandler func(err error)) (*Connection, error)
Input Discord token and start a new websocket connection
func (*Instance) OpenChannel ¶ added in v1.0.7
func (*Instance) OpenChannelHeaders ¶ added in v1.8.7
func (*Instance) SendMessage ¶ added in v1.0.7
Inputs the Channel snowflake and sends them the message; outputs the response code for error handling.
func (*Instance) SendMessageHeaders ¶ added in v1.8.7
func (*Instance) ServerCheck ¶ added in v1.0.7
func (*Instance) SolveCaptcha ¶ added in v1.7.9
func (*Instance) TypingHeaders ¶ added in v1.8.12
type Intent ¶ added in v1.0.7
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 ¶ added in v1.0.6
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 ¶ added in v1.0.6
type MessageEmbedImage ¶ added in v1.0.6
type MessageEmbedThumbnail ¶ added in v1.0.6
type NameChange ¶ added in v1.0.7
type OtherSettings ¶ added in v1.8.8
type OtherSettings struct {
DisableKL bool `yaml:"disable_keep_alives"`
}
type Properties ¶ added in v1.0.7
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 ProxySettings ¶ added in v1.8.8
type ScraperSettings ¶ added in v1.8.8
type Solution ¶ added in v1.18.13
type Solution struct {
CaptchaResponse string `json:"gRecaptchaResponse,omitempty"`
}
type SuspicionAvoidance ¶ added in v1.8.8
type SuspicionAvoidance struct {
RandomIndividualDelay int `yaml:"random_individual_delay"`
RandomRateLimitDelay int `yaml:"random_rate_limit_delay"`
RandomDelayOpenChannel int `yaml:"random_delay_before_dm"`
TypingVariation int `yaml:"typing_variation"`
TypingSpeed int `yaml:"typing_speed"`
TypingBase int `yaml:"typing_base"`
}
type Task ¶ added in v1.7.9
type Task struct {
CaptchaType string `json:"type,omitempty"`
WebsiteURL string `json:"websiteURL,omitempty"`
WebsiteKey string `json:"websiteKey,omitempty"`
IsInvisible bool `json:"isInvisible,omitempty"`
Data string `json:"data,omitempty"`
ProxyType string `json:"proxyType,omitempty"`
ProxyAddress string `json:"proxyAddress,omitempty"`
ProxyPort int `json:"proxyPort,omitempty"`
ProxyLogin string `json:"proxyLogin,omitempty"`
ProxyPassword string `json:"proxyPassword,omitempty"`
UserAgent string `json:"userAgent,omitempty"`
Cookies string `json:"cookies,omitempty"`
}