get-got / discord-downloader-go

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
271 stars 30 forks source link

Personal Downloader Example #142

Closed shadybrady101 closed 2 months ago

shadybrady101 commented 2 months ago

I keep trying to use the personal self bot example and I always get an error, I'm trying to get two channels to download to separate folders.

get-got commented 2 months ago

Can you show the error you're getting as well as your config with login/sensitive info removed?

shadybrady101 commented 2 months ago

image_2024-04-28_121628653 { "_constants": null, "credentials": { "token": "token", "flickrApiKey": "flickr_api_key" }, "admins": [ "USER_ME" ], "adminChannels": [ { "channel": "__CHANNEL_P_DDG_UBADMIN" } ], "overwriteTwitterPath": "/home/bots/shared/twitter_cookies.json", "overwriteInstagramPath": "/home/bots/shared/instagram_cookies.json", "debug": true, "allowSkipping": true, "scanOwnMessages": false, "autoHistory": true, "githubUpdateChecking": false, "presenceEnabled": false, "exitOnBadConnection": false, "presenceStatus": "invisible", "channels": [ { "channels": [ "CHANNEL_MEMESERVER1_MEMES", "CHANNEL_MEMESERVER2_MEMES", "CHANNEL_MEMESERVER3_SHITPOSTING", "__CHANNEL_MEMESERVER4_MEMES" ], "destination": "/var/www/html/files/ddg/memes", "enabled": true, "allowCommands": false, "sendErrorMessages": false, "scanEdits": true,

        "presenceEnabled": false,
        "reactWhenDownloaded": false,

        "subfolders": [
            "{{serverName}}"
        ],
    },
    {
        "channels": [
            "__CHANNEL_MEMESERVER2_NSFW_MEMES",
            "__CHANNEL_MEMESERVER4_NSFW_MEMES"
         ],
        "destination": "/var/www/html/files/ddg/nsfw",
        "enabled": true,
        "allowCommands": false,
        "sendErrorMessages": false,
        "scanEdits": true,

        "presenceEnabled": false,
        "reactWhenDownloaded": false,

        "subfolders": [
            "{{serverName}}"
        ],
    }
]

}

get-got commented 2 months ago

You have some trailing commas, those cause errors in json. The last object in a group can't have a comma. I think it's just your subfolder objects:

image

shadybrady101 commented 2 months ago

Thank you, of course its a comma, I got it from the example, it might be good to fix that.

get-got commented 2 months ago

Fixed it thanks, didn't realize you meant that section, I must have left that when I stripped my other settings out.