Documentation
¶
Index ¶
- Constants
- Variables
- func DecodeFilename(filename string) (string, error)
- func EncodeFilename(filename string) (string, error)
- func GetDiscordSession() (*discordgo.Session, *discordgo.Guild, []*discordgo.Channel, error)
- func GetMaxFileSizeUpload(session *discordgo.Session, guild *discordgo.Guild) (int, error)
- func ParseFileMap(channels []*discordgo.Channel) (map[string]*discordgo.Channel, error)
- func PrintFiles(files []string)
- func SetConfigVal(key, value, usage, prompt string) (string, error)
Constants ¶
View Source
const ( // Version is the current dscli app version Version = "1.13.1" // MaxDiscordFileSizeDefault represents the maximum file size in bytes that // an attachment can be for non nitro users MaxDiscordFileSizeDefault = 26214400 // MaxDiscordFileSizeNitroClassic represents the maximum file size in bytes that // an attachment can be for nitro classic users MaxDiscordFileSizeNitroClassic = 52428800 // MaxDiscordFileSizeNitro represents the maximum file size in bytes that // an attachment can be for nitro users MaxDiscordFileSizeNitro = 524288000 // MaxDiscordMessageRequest is the maximum number of messages you can query MaxDiscordMessageRequest = 100 // MaxDiscordChannels is the maximum number of channels you can have MaxDiscordChannels = 500 )
Variables ¶
View Source
var HttpClient = http.Client{Timeout: 60 * time.Second}
HttpClient is used to download file chunks from Discord
Functions ¶
func DecodeFilename ¶
DecodeFilename decodes filename to the original filename
func EncodeFilename ¶
EncodeFilename encodes filename to Discord-safe channel name
func GetDiscordSession ¶
GetDiscordSession gets the Discord session, guild and channels
func GetMaxFileSizeUpload ¶ added in v1.5.0
GetMaxFileSizeUpload gets the maximum file size that can be uploaded
func ParseFileMap ¶
ParseFileMap creates channel name to channel struct mapping
func PrintFiles ¶ added in v1.3.0
func PrintFiles(files []string)
PrintFiles print files in table format when applicable TODO: optimize algorithm
func SetConfigVal ¶
SetConfigVal sets value to key if value exists If value doesn't exist, then the value is read from stdin
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.