A Discord bot program to download and otherwise handle files sent in Discord channels with extensive configuration. Can be used as a genuine Discord Bot or user account / self-bot
MIT License
Bot releases are hidden (Show)
Skipping v2.5.2 because I accidentally released v2.5.1 as internal version "v2.5.2-dev".
sendFile
data keys were previously very limited, now it supports the same data keys as discord messages / downloads.{{serverName}}
is more reliable, previously often failed to parse. Discord-related data keys are now more reliable in general.subfoldersFallback
setting alongside subfolders
. If this setting is present when subfolders
encounters an unparsed data key ({{example}}
), it will use subfoldersFallback
in place of subfolders
.sendFileCaption
{{usernameNoLeadPeriod}}
- username of message author but with leading periods (".") stripped.commandPrefix
to source configs.
blockedReactions
& allowedReactions
in filters
now accepts standard Discord emoji names.instagramTOTP
in the credentials section with your TOTP seed, or enter your OTP code upon login. TOTP seed should always work, OTP code will apply to your login cache but if the cache expires, you'll need to re-enter the code upon new login.filepathNormalizeText
& filepathStripSymbols
to global config, source configs, and source message/download logging.
outputHistoryStatus
& outputHistoryErrors
globally and per-source to optionally disable history outputting.content
setting to download & message logging. Currently accepts {{message}}
for message logging and {{msgContent}}
and {{link}}
and {{embedDesc}}
for download logging.{{attachmentID}}
key to filenameFormat
data keys.{{userName}}
to {{username}}
for consistency.commandPrefix
to global config and source configs.
blockedReactions
& allowedReactions
in filters
now accepts standard Discord emoji names.instagramTOTP
in the credentials section with your TOTP seed, or enter your OTP code upon login. TOTP seed should always work, OTP code will apply to your login cache but if the cache expires, you'll need to re-enter the code upon new login.filepathNormalizeText
& filepathStripSymbols
to global config, source configs, and source message/download logging.
outputHistoryStatus
& outputHistoryErrors
globally and per-source to optionally disable history outputting.content
setting to download & message logging. Currently accepts {{message}}
for message logging and {{msgContent}}
and {{link}}
and {{embedDesc}}
for download logging.{{attachmentID}}
key to filenameFormat
data keys.{{userName}}
to {{username}}
for consistency.Published by get-got 8 months ago
commandPrefix
to global config and source configs.
blockedReactions
& allowedReactions
in filters
now accepts standard Discord emoji names.instagramTOTP
in the credentials section with your TOTP seed, or enter your OTP code upon login. TOTP seed should always work, OTP code will apply to your login cache but if the cache expires, you'll need to re-enter the code upon new login.filepathNormalizeText
& filepathStripSymbols
to global config, source configs, and source message/download logging.
outputHistoryStatus
& outputHistoryErrors
globally and per-source to optionally disable history outputting.content
setting to download & message logging. Currently accepts {{message}}
for message logging and {{msgContent}}
and {{link}}
and {{embedDesc}}
for download logging.{{attachmentID}}
key to filenameFormat
data keys.{{userName}}
to {{username}}
for consistency."subfolders"
setting."#"
from {{channelName}}
for "subfolders"
."alias"
(string) and "aliases"
(list of strings) to sources. These keywords can be used to call history commands. If a server/channel/etc config has something like "alias": "abc",
you can use ddg history abc
. Multiple configs can use the same aliases to call them all with 1 command. Aliases will not work if they contain spaces or commas.logLinks
and logMessages
reworked - "divideBy____"
settings removed and replaced with "subfolders"
and "filenameFormat"
like the download sources.logLinks
and logMessages
global default options added (unused by default)."debug"
are now under "verbose"
.Applies to subfolders
, filenameFormat
, linePrefix
, lineSuffix
WITHIN logLinks
and logMessages
, globally and per-source.
Key | Value |
---|---|
{{year}} |
Year message was sent (2016+) |
{{monthNum}} |
Month of year message was sent (1-12) |
{{dayOfMonth}} |
Day of month message was sent (1-31) |
{{hour}} |
Hour of day message was sent (0-23) |
{{minute}} |
Minute of hour message was sent (0-59) |
{{second}} |
Second of minute message was sent (0-59) |
{{timestamp}} |
Message timestamp, "2006-01-02 15-04-05" format |
{{timestampYYYYMMDD}} |
Message timestamp, "2006-01-02" format |
{{timestampHHMMSS}} |
Message timestamp, "15-04-05" format |
{{messageID}} |
Discord Source Message ID |
{{channelID}} |
Discord Source Message Channel ID |
{{serverID}} |
Discord Source Message Server ID |
{{userID}} |
ID of Discord user who sent the message |
{{username}} |
Username of Discord user who sent the message |
{{userDisc}} |
User discriminator number of Discord user who sent the message |
{{channelName}} |
Discord Source Message Channel Name |
{{channelTopic}} |
Discord Source Message Channel Topic |
{{categoryID}} |
Discord Source Message Category ID |
{{categoryName}} |
Discord Source Message Category Name |
{{threadID}} |
Discord Source Message Thread ID (if thread) |
{{threadName}} |
Discord Source Message Thread Name (if thread) |
{{threadTopic}} |
Discord Source Message Thread Topic (if thread) |
{{forumID}} |
Discord Source Message Forum ID (if forum) |
{{forumName}} |
Discord Source Message Forum Name (if forum) |
{{downloadStatus}} |
[logLinks ONLY] Short Status of Download |
{{downloadStatusLong}} |
[logLinks ONLY] Long Status of Download |
{{downloadFilename}} |
[logLinks ONLY] Filename of Download |
{{downloadExt}} |
[logLinks ONLY] File Extension of Download |
{{downloadPath}} |
[logLinks ONLY] Save Path for Download |
!! IMPORTANT !!
All divideBy\_\_\_\_\_
settings have been removed and been replaced with subfolders
, see below.
Added "subfolders"
and removed all divideBy
settings, a list of strings for each subfolder title.
{{serverID}}
, {{serverName}}
, {{categoryID}}
, {{categoryName}}
, {{channelID}}
, {{channelName}}
, {{userID}}
, {{userName}}
, {{fileType}}
, {{year}}
, {{monthNum}}
, {{dayOfMonth}}
, {{hour}}
, {{message}}
, {{messageID}}
."subfolders": [ "{{fileType}}" ],
."subfolders": [ "{{serverName}}", "{{categoryName}}", "{{channelName}}", "{{year}}", "{{fileType}}" ],
will equate to "BASE_DESTINATION/My Server/Category/Channel/2023/images/"
.Reworked Emoji & Sticker Support
ddg emojis
command."emojisServers"
, "stickersServers"
are lists of server IDs to download from. ex: "emojisServers": [ "123", "456" ],
"emojisFilenameFormat"
, "stickersFilenameFormat"
to override the filename format. Default is "{{ID}} {{name}}
, only accepts {{ID}}
and {{name}}
as keys."emojisDestination"
, "stickersDestination"
to override the destination folders. If these settings are missing, it will use "emojis" and "stickers" within the bot folder. The bot will automatically create subfolders by channel name within whatever destination.Hopefully fixed Discord timestamp snowflake issues regarding history date range filters.
Fixed error upon exit if Twitter / X is disabled.
Added "verbose"
and "debugV"
but they currently do nothing, just future variants of "debug"
.
filters.allowedFilenames
not working..YAML
format. Settings are identical to the JSON structuring, just an alternative format option. Upon launch, if using a .JSON/.JSONC
config, the bot will translate it to "cache/settings.yaml"
and alternatively when using a .YAML
config it will translate it to "cache/settings.json"
.settingsOutput
and program-generated settings.downloadRetryMax
changed from 3 to 2.overwriteDefaultReaction
(text), "✅" by default.overwriteCachePath
(text), "cache" by default.overwriteHistoryPath
(text), "cache/history" by default.overwriteDuploPath
(text), "cache/.duplo" by default.overwriteTwitterPath
(text), "cache/twitter.json" by default.overwriteInstagramPath
(text), "cache/instagram.json" by default.overwriteConstantsPath
(text), "cache/constants.json" by default.overwriteDatabasePath
(text), "database" by default.overwriteDatabaseBackupsPath
(text), "backups" by default.historyManagerRate
(number), 5 by default, seconds between rechecking the queued history jobs.twitterEnabled
(bool), true by default, optionally completely disable the Twitter Scraper section.instagramEnabled
(bool), true by default, optionally completely disable the Instagram Scraper section.twitterProxy
(text), if this setting isn't blank, the Twitter scraper will use it as a proxy address.instagramProxy
(text), if this setting isn't blank, the Instagram scraper will use it as a proxy address.instagramProxyInsecure
(bool), false by default.instagramProxyForceHTTP2
(bool), false by default.logOutput
(text), if this setting isn't blank the program will log all console output as a text file, the setting should be a complete filepath including .txt or the desired extension.logIndent
(bool), enabled by default, if disabled the program will not indent between timestamps and log content.Over the next week (since posting this) I'll be improving the readme.
commandTagging
to main settings. True by default. Controls whether command senders should be tagged in replies from the bot.historyRequestDelay
to delay between requests of history messages.historyRequestCount
to limit messages per-request in history. Default and max value is 100.delayHandling
and delayHandlingHistory
(in milliseconds) to delay handling/downloading.divideByDay
and divideByHour
to main settings and source settings.categoryBlacklist
not functioning properly.blockedPhrases
and allowedPhrases
not ignoring empty entries.savePossibleDuplicates
now false by defaultPublished by get-got over 1 year ago
I'm going to stop using the automated builds for releases and post all builds that succeeded. Let me know if any don't work for certain architectures.
HISTORY
historyMaxJobs
, limited by processLimit
.history list
(or status or output) subcommand for outputting job statuses.history dbwipe
/wipedb
subcommand to purge the specified channel(s) from the download database.history cachewipe
/wipecache
subcommand to purge the specified channel(s) from the cache folder.UPGRADED DISCORDGO & Fixed Related Issues - Now using the latest release of discordgo, I modified it to re-allow user accounts to be authenticated.
Added Instagram Support - requires account username & password. Sometimes requires captcha popup completion.
Added Thread Support (for genuine Discord Bots ONLY)
Added Users as Sources - download/monitor from any channel the bot can access so long as the message belongs to specified users. Settings follow channels.
Added Categories as Sources - Settings follow channels.
Removed Google Drive support, will re-add in the future, the prior one was ported from Seklfreak's original.
Upgraded all dependencies.
Removed Mastodon support
Fixed Reddit support (if building yourself, GODEBUG=http2client=0
before build)
Discord, Twitter, Instagram logins retry 3-5 times if failed.
Fixed issue with Twitter API ignoring certain urls.
Fixed several nil crashes.
Commands run asynchronously now.
Changed a lot of console output styling and formatting.
Optionally target specific settings file to run multiple instances off one executable & database with arg1, no file extension, example: ddg.exe customSettingsFile
Added Filesize info for downloads
Better handles download errors. Retries X times unless 404 or 403.
Removed permissions check, won't check if user account since it always errors.
Added checkup / heartbeat console output, control rate with checkupRate
Admin channel status messages alert to detected settings modifications.
filenameFormat
now also uses generic data key replacements from presence.
I changed a lot of things, see the examples in the README for the full list and comments.
userBot
. Automatically detects and corrects if neededinstagramUsername
, instagramPassword
logProgram
users
, categories
settingsOutput
messageOutputHistory
processLimit
, historyMaxJobs
checkupRate
, connectionCheckRate
, presenceRefreshRate
sendAutoHistoryStatus
allBlacklistUsers
, allBlacklistCategories
allowCommands
to set default for all sourcesdivideByChannel
to set default for all sourcesdivideByMonth
to set default for all sourcesdivideByServer
to set default for all sourcesdivideByType
to set default for all sourcesdivideByUser
to set default for all sourcesdivideByYear
to set default for all sourcesdivideFoldersUseID
to set default for all sourcesfilters
to set default for all sourceshistoryTyping
to set default for all sourcesignoreBots
to set default for all sourcesreactWhenDownloadedEmoji
to set default for all sourcessave
to set default for all sourcessaveAudioFiles
to set default for all sourcessaveImages
to set default for all sourcessaveOtherFiles
to set default for all sourcessavePossibleDuplicates
to set default for all sourcessaveTextFiles
to set default for all sourcessaveVideos
to set default for all sourcesscanEdits
to set default for all sourcessendErrorMessages
to set default for all sourcessendFileCaption
to set default for all sourcessendFileDirectly
to set default for all sourcessendFileToChannel
to set default for all sourcessendFileToChannels
to set default for all sourcesallowSkipping
asyncHistory
checkPermissions
allowGlobalCommands
to allowGeneralCommands
autorunHistory
to autoHistory
autorunHistoryBefore
to autoHistoryBefore
autorunHistorySince
to autoHistorySince
debugOutput
to debug
filterDuplicateImages
to duplo
filterDuplicateImagesThreshold
to duploThreshold
numberFormatEuropean
to europeanNumbers
presenceOverwrite
to presenceLabel
presenceOverwriteDetails
to presenceDetails
presenceOverwriteState
to presenceState
inflateCount
to inflateDownloadCount
divideByMonth
divideByYear
duplo
, duploThreshold
sendAutoHistoryStatus
sendFileCaption
sendHistoryStatus
user
, users
, category
, categories
, categoryBlacklist
overwriteAllowSkipping
autorunHistory
to autoHistory
autorunHistoryBefore
to autoHistoryBefore
autorunHistorySince
to autoHistorySince
divideFoldersByChannel
to divideByChannel
divideFoldersByServer
to divideByServer
divideFoldersByType
to divideByType
divideFoldersByUser
to divideByUser
overwriteEmbedColor
to embedColor
overwriteFilenameDateFormat
to filenameDateFormat
overwriteFilenameFormat
to filenameFormat
updatePresence
to presenceEnabled
blockedFilenames
, allowedFilenames
blockedReactions
, allowedReactions
reactWhenDownloadedHistory
to toggle reactions for processing history messages, false by default.errorMessages
to sendErrorMessages
Currently working on a rewrite as a v2.0.0 with a modified version of the latest discordgo that restores selfbot functionality with no need to have multiple versions of the bot for genuine bots to take advantage of latest api features.
Published by get-got almost 2 years ago
config.exitOnBadConnection
(bool, false by default). Exits bot upon connection disruption, good for Process Managers or Docker containers.config.discordTimeout
(seconds, 180 by default). Overrides the bot clients timeout in seconds.*/cache/history/
and delete it. If desired this will become optional in settings for future releases.autorunHistoryBefore
and autorunHistorySince
(as well as overwriteAutorun...
for server/channel specific overrides) to specify date ranges for history running upon launch. Follows YYYY-MM-DD format.{{fileType}}
, {{nanoID}}
, {{shortID}}
keys to filename formatting. Nano ID is a 21 character unique string generated randomly upon download, Short ID is the same but 10 characters. -- Big thanks to @Twinki14 for this!vxtwitter.com
sendFileToChannel
(and sendFileToChannels
for multiple channels) to forward/crosspost detected files into another channel.filenameFormat
alongside the existing filenameDateFormat
in general settings, as well as overwriteFilenameFormat
for channels/servers. Formats the entire filename, default is "{{date}} {{file}}"
. Currently supports {{date}}, {{file}}, {{messageID}}, {{userID}}, {{username}}, {{channelID}}, {{serverID}}, {{message}}
.divideFoldersUseID
to channels/servers, uses ID for divideFoldersBy_ settings rather than name, good for sources that change names often.save
setting to channels/servers (enabled by default, of course) to not actually download detected filesblacklistChannels
to serverBlacklist
filterDuplicateImages
logs score comparisons when debugOutput
is enabledreactWhenDownloaded
, sets the default for the server/channel equivelant of reactWhenDownloaded
reactWhenDownloadedHistory
to server/channel configs, default is false
, toggles reactions for downloaded messages processed in historychannels
alternative for adminChannels
, to have multi-channel configssourceConfig.Enabled
not working for history when falsecache/constants.json
every login