Your guide to integrating DCBL with your Discord bot
In this section, you’ll learn how to interact with the DCBL API, retrieve banned user information, and integrate it into your Discord bot.
To use the DCBL API, you first need to request a developer token.
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.")
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.
For support, token requests, and discussions, join our official Discord server. Click the link below:
Join the DCBL Discord