Это видео недоступно.
Сожалеем об этом.
Save Images From Discord Chat Using a Bot
HTML-код
- Опубликовано: 8 окт 2020
- 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....
Github repository for this project:
github.com/Ben...
Check out my Object-Detection series:
• TensorFlow Object Dete...
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
도움이 되었습니다. 감사합니다. 앞으로도 이런 영상들을 올려주세요.
Thanks. This video helped me. I wish you upload more videos like this.
Good video, it's really nice
It is very interesting, thank you.
'pip' is not recognized as an internal or external command,
operable program or batch file.
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.
Thank you. Will you get banned for using this? (terms of service violation) What about 10.000 images, will discord kick me?
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)
how to save uploaded file to directory without any command?
You can use client.event instead of client.command()
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
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
@@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
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
:D