Я хочу получить идентификатор сервера и вернуть все идентификаторы каналов на этом сервере.
Я не хочу добавлять бота на сервер.
Вот мой код:
import requests
import json
import sys
BOT_TOKEN = "not today you aint getting this"
API_BASE = "https://discord.com/api/v10"
def get_channels(server_id):
headers = {
'Authorization': f'Bot {BOT_TOKEN}'
}
channels_url = f'https://discord.com/api/v10/guilds/{server_id}/channels'
response = requests.get(channels_url, headers=headers)
print(response.json()) # {'message': '401: Unauthorized', 'code': 0}
get_channels(1454583875786506444)
Подробнее здесь: https://stackoverflow.com/questions/798 ... ing-python
Мобильная версия