Sopur / Discord-user-bots

Working discord user bots library.
MIT License
81 stars 35 forks source link

feat(message.attachements): allow send message with attachments #23

Closed gearintellix closed 2 years ago

gearintellix commented 2 years ago

Fix https://github.com/Sopur/Discord-user-bots/issues/22

How to use?

client.send(
    "794326789480120374", // Channel to send in
    {
        content: "Hello Discord-user-bots!", // Content of the message to send (Optional when sending stickers) (Default null)
        reply: "914533507890565221", // Reply to the message ID given with this message (Optional) (Default null)
        tts: false, // Use text to speech when sending (Only works if you have the permissions to do so) (Optional) (Default false)
        embeds: [], // Embeds to send with your message (Not optional, must be an array, can be unset for default) (Default empty array)
        allowed_mentions: {
            // Allow mentions settings (Not optional, but can be unset for default) (Default all true mentions object)
            allowUsers: true, // Allow message to ping user (Default true)
            allowRoles: true, // Allow message to ping roles (Default true)
            allowEveryone: true, // Allow message to ping @everyone and @here (Default true)
            allowRepliedUser: true, // If the message is a reply, ping the user you are replying to (Default true)
        },
        components: [], // Message components (Not optional, must be an array, can be unset for default) (Default empty array)
        stickers: [], // Stickers to go with your message (Not optional, must be an array, can be unset for default) (Default empty array),
        attachments: [
                "path/to/file1",
                {
                        "path": "path/to/file2",
                        "name": "Custom File Name",
                        "description": "File description"
                },
                ...
        ],
    }
);