Welcome to the DCBL Developer Area

Your guide to integrating DCBL with your Discord bot

Overview

In this section, you’ll learn how to interact with the DCBL API, retrieve banned user information, and integrate it into your Discord bot.

1. Get Your Developer Token

To use the DCBL API, you first need to request a developer token.

  1. Join the DCBL Discord server and navigate to the #developer-tokens channel.
  2. Request a token, ensuring that you are a verified bot developer.
  3. Once granted, you'll receive your token, which you will use in your API requests.

2. Making API Requests

Below is an example Python script using your developer token to make an API request to fetch the ban list.


            import requests
            
            token = 'your_generated_token_here'
            user_id = 'your_user_id_here'  # Replace with the userID you get
            headers = {
                'Authorization': f'Bearer {token}',
                'X-User-ID': user_id
            }
            
            # Example API call to fetch the ban list
            response = requests.get('https://thedcbl.online/api/banned_users', headers=headers)
            if response.status_code == 200:
                data = response.json()
                print("Ban list data:", data)
            else:
                print("Failed to fetch data.")
                    

3. Token Management

Your developer token is crucial for interacting with the DCBL API. If you need to regenerate your token for any reason, you can do so in the #developer-tokens channel of the DCBL Discord server.

4. Need Assistance?

For support, token requests, and discussions, join our official Discord server. Click the link below:

Join the DCBL Discord