Discord Botunuza Python ile GİF'li Banner Ekleme

Durum
Üzgünüz bu konu cevaplar için kapatılmıştır...
Üye
Katılım
6 Nis 2024
Mesajlar
19
Tepki puanı
1
2 HİZMET YILI
Bu kodu profil fotosu değişmek içinde kullanabilirsinz ama düzenlemeniz gerek biraz.
Ayrıyetten bu yeni gelen bir özellik 1 ay olmuştur botlara gif ekleme teşekkürler discord.
Python:
import requests
import base64
BANNER_IMAGE_URL = "https://giffiles.alphacoders.com/906/90670.gif" ##BURAYA GİF'in Linkini Girin
banner_image_response = requests.get(BANNER_IMAGE_URL)
if banner_image_response.status_code == 200:
    banner_image_base64 = base64.b64encode(banner_image_response.content).decode('utf-8')
    payload = {
        "banner": f"data:image/gif;base64,{banner_image_base64}"
    }
    headers = {
        'Authorization': f'Bot {" "}', ##BURAYA BOT TOKENİNİZİ GİRİN
        'Content-Type': 'application/json'
    }
    response = requests.patch('https://discord.com/api/v10/users/@me', headers=headers, json=payload)
    if response.status_code == 200:
        print('Banner Başarılı Bir Şekilde Değiştirildi!')
    else:
        print('Hata Oluştu!:', response.text)
else:
    print('Hata Oluştu!')
 
Durum
Üzgünüz bu konu cevaplar için kapatılmıştır...
Üst