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
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.NOTE: Had to re-upload the binaries and they show as v2.5.2-dev in-program. Treat this as v2.5.1.
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."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 default