Home python how to make the bot discord send a random picture from the...

how to make the bot discord send a random picture from the Internet

Author

Date

Category

Recently faced the problem that my discord bot must be developed. I decided to make the shipment of a random image from the Internet, but how much does not run on the Internet, I did not find information about it. Is it possible to do this and preferably through cloud storage or simply on the link of the VK album or another, for example: search by tag in Google.

tried to use a banal code, but it does not work on links.

Simplest code:

@ bot.command ()
ASYNC DEF SENDPEPE (CTX):
  AWAIT CTX.SEND ("https://i.imgur.com/hab3rjo.jpg")

Answer 1

@ bot.command ()
ASYNC DEF SENDPEPE (CTX):
  EMB = Discord.Embed (title = "Pepe", Color = Discord.colour.dark_green ())
  Emb.Set_Image (url = "https://i.imgur.com/hab3rjo.jpg")
  AWAIT CTX.SEND (Embed = EMB)

Programmers, Start Your Engines!

Why spend time searching for the correct question and then entering your answer when you can find it in a second? That's what CompuTicket is all about! Here you'll find thousands of questions and answers from hundreds of computer languages.

Recent questions