1import base64
2
3API_ENDPOINT = 'https://discord.com/api/v6'
4CLIENT_ID = '332269999912132097'
5CLIENT_SECRET = '937it3ow87i4ery69876wqire'
6
7def get_token():
8 data = {
9 'grant_type': 'client_credentials',
10 'scope': 'identify connections'
11 }
12 headers = {
13 'Content-Type': 'application/x-www-form-urlencoded'
14 }
15 r = requests.post('%s/oauth2/token' % API_ENDPOINT, data=data, headers=headers, auth=(CLIENT_ID, CLIENT_SECRET))
16 r.raise_for_status()
17 return r.json()