Discord Botu hata: 400 Bad Request (error code: 50006): Cannot send an empty message

Hata üzerinden yola çıkabilirdiniz aslında. Hatada boş mesajın gönderilemeyeceği yazıyor. Bu durum ise handle_response fonksiyonunda tüm koşullara uymadığı zaman döndüğü None değerinden dolayı oluşuyor. Kodu handle_response fonksiyonu boş olmayan bir string döndürmediği zaman mesaj gönderecek şekilde ayarlayabilirsiniz:

async def send_message(message, user_message, is_private):
    try:
        response = responses.handle_response(user_message)

        if response:
            await message.author.send(response) if is_private else await message.channel.send(response)

    except Exception as e:
        print(e)