import requests
# URL API
url = 'https://mikus-api.glitch.me/api/v1/hug'
# GET request to the API
response = requests.get(url)
if response.status_code == 200:
data = response.json()
# Get image URL
image_url = data.get('imageUrl', None)
if image_url:
print('Huggy Random Furry image:')
print(image_url)
else:
print('Furry hugs not Found :C')
else:
print('Failed to get data from API:', response.status_code)
Check out all the Python libraries!
const axios = require('axios');
// URL API
const url = 'https://mikus-api.glitch.me/api/v1/hug'; // Заміни на потрібний URL
// GET request to the API
axios.get(url)
.then(response => {
// Get data from the response
const data = response.data;
// Get the URL of the image
const imageUrl = data.imageUrl;
if (imageUrl) {
console.log('Huggy Random Furry image:');
console.log(imageUrl);
} else {
console.log('Furry hugs not Found :C');
}
})
.catch(error => {
console.error('Failed to get data from API:', error.response ? error.response.status : error.message);
});
Make sure to install the "axios" library.
$nomention
<@$authorID> hug $message[1]
$httpGet[https://mikus-api.glitch.me/api/v1/hug]
$image[$httpResult[imageUrl]]
Use BDScript 2 for accurate and reliable commands.