Save Images From Discord Chat Using a Bot

Hey welcome back, Ben again! Today is a video about how to make a discord bot that is able to save images from chat! I learned how to do this as I'm trying to work on a project that will (hopefully) incorporate Tensorflow Object Detection into a discord bot. I couldn't find many great examples of how to do this, so I thought I'd make my own! The base of the code came from a short example I found on stackoverflow, so original credit goes here: stackoverflow.com/questions/5...
Github repository for this project:
github.com/Bengemon825/Save-I...
Check out my Object-Detection series:
• TensorFlow Object Dete...

Пікірлер: 16

  • @LazyTech825
    @LazyTech8253 жыл бұрын

    After doing more work on this project I realized that there is actually a built in method to save attachments (facepalm moment). If you want to do it using the built in way you can just use 'await ctx.message.attachments[0].save('image.jpg')' --> the 'image.jpg' can be changed to whatever name you'd like

  • @bloodboy21
    @bloodboy213 жыл бұрын

    Good video, it's really nice

  • @Aaron-yu6zo
    @Aaron-yu6zo3 жыл бұрын

    It is very interesting, thank you.

  • @LawsaeFilms
    @LawsaeFilms2 жыл бұрын

    Is there anyway to do this in javascript? I dont know coding but the other tutorial i followed to get my bot online used js for their base. I want to add this into theirs I just need what the command would be.

  • @que_bic
    @que_bic3 жыл бұрын

    도움이 되었습니다. 감사합니다. 앞으로도 이런 영상들을 올려주세요. Thanks. This video helped me. I wish you upload more videos like this.

  • @hektua
    @hektua2 жыл бұрын

    'pip' is not recognized as an internal or external command, operable program or batch file.

  • @demotest3demotest381
    @demotest3demotest3812 жыл бұрын

    how to save uploaded file to directory without any command?

  • @nikitali4180

    @nikitali4180

    2 жыл бұрын

    You can use client.event instead of client.command()

  • @mazleens
    @mazleens Жыл бұрын

    Thank you. Will you get banned for using this? (terms of service violation) What about 10.000 images, will discord kick me?

  • @LazyTech825

    @LazyTech825

    Жыл бұрын

    You’d probably have to do some digging in their policies, but I’d imagine you’d probably get temporarily kicked or something like if you start doing massive data operations (like downloading 10,000 images)

  • @jacknicholson337
    @jacknicholson337 Жыл бұрын

    I got this error when i ran the code with absolutely no changes: Traceback (most recent call last): File "c:\Users\Jack\AppData\Local\Programs\Python\Python39\Python Projects\DiscordImageSaver\imagebot.py", line 6, in client=commands.Bot(command_prefix='.') TypeError: __init__() missing 1 required keyword-only argument: 'intents' I'm not sure what to do

  • @LazyTech825

    @LazyTech825

    Жыл бұрын

    Looks like the api has been updated, try doing commands.Bot(command_prefix='.', Intents.all()) let me know if this works or you need more help

  • @jacknicholson337

    @jacknicholson337

    Жыл бұрын

    @@LazyTech825 thanks it works now. Is there a way to make all images that are sent to a channel automatically download to my PC without having to type .save

  • @LazyTech825

    @LazyTech825

    Жыл бұрын

    Instead of having " async def save(ctx): " you could use " async def on_message(message): " which would activate any time there is a message sent in the chat. Within that function you could then set something up to see if the message has an attachment and then save it

  • @beng9305
    @beng930510 ай бұрын

    :D