Konuyu Oyla:
  • Toplam: 0 Oy - Ortalama: 0
  • 1
  • 2
  • 3
  • 4
  • 5
TypeError: 'function' object is not subscriptable
#1
import websocket
import json
import threading
import time

def send_json_request(ws, request):
   ws.send(json.dumps(request))

def recieve_json_response(ws):
   response = ws.recv()
   if response:
       return json.loads(response)

def heartbeat(interval, ws):
   print("heartbeat begin")
   while True:
       time.sleep(interval)
       heartbeatJSON = {
           "op": 1,
           "d": "null"
       }
       send_json_request(ws, heartbeatJSON)
       print("hearthbeat sendt")

ws = websocket.WebSocket()
ws.connect("wss://gateway.discord.gg/?v=68encording=json")
event = recieve_json_response

heartbeat_intervals = event['d']['heartbeat_interval'] / 1000
threading._start_new_thread(heartbeat, (heartbeat_intervals, ws))

token = "'HGjty4H'^Bjh4h4'^JKnNŞ%+&FLŞ92+ER"
payload = {
   'op': 2,
   'd': {
       "token": token,
       "properties": {
           "$os": "windows",
           "$browser": "chrome",
           "$device": "pc",
       }
   }
}
send_json_request(ws, payload)

while True:
   event = recieve_json_response(ws)

   try:
       print(f"{event['d']['author']['username']}: {event['d']['content']}")
       op_code = event('op')
       if op_code == 11:
           print('hearth reivedd ')
   except:
       pass

, line 29, in <module>
    heartbeat_intervals = event['d']['heartbeat_interval'] / 1000
TypeError: 'function' object is not subscriptable

bu hatayı veriyor console da şimdiden teşekkürler
Ara
Cevapla
#2
27.satırda fonksiyonu çağırmamışsın event değerini direk fonksiyona eşitlemişsin doğrusu:

Kod:
event = recieve_json_response(ws)
Ara
Cevapla
#3
[img]data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAA0sAAAC5CAYAAAD59qT5AAAgAElEQVR4nO3dPUzbWsA38L9fPSOozVIpFQY6NFJcqZ0ISL5IHVB170KG0iUDysLMxxoxoawEZpaIIUvpEJb7qGKoRC1dmolKN0gw8OGrJyMgsvsd7Di24yS2EydO+P8kJAgnzjnHJ7bPtzA1NaUBgKZpePXqFa6urkBERERERPTc/b9hR4CIiIiIiCiKWFkiIiIiIiJywco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9v0ZfgjpApZy5sZi3G+JiIiIaIxEYxgevPYuqairjr9LeZxsee2i6Nyr9LC/jUpJNVfRs37O07XHj3ChaVX8XmlO+rcfWl8KvZfV2ILyml6/8Q87ve7xVlHLW5cPB+q3gT/CN689SbVazdcPEREREQ2PMDU1pQGApml49eoVrq6uhhcZYzPThAhA0XsFbK+pJZys7LfMTep0vJndHcw1hkb10DtE1A9+K0DxeDykmBARERFRN5HpWQLsvUuQV/Eh4FLLQrqAL79+6RPt5eYcGa6AR0REREREXkWqsgTAsjKeiMRawF1LHfQhUuEtf05EREREROMnUsPwiMYdh+ERERERjY7orIZH9Ayw8kNEREQ0OqI3DI+IiIiIiCgCWFkiIiIiIiJywcoSERERERGRC1aWiIiIiIiIXLCyRERERERE5IKVJSIiIiIiIhesLBEREREREblgZYmIiIiIiMgFK0tEREREREQuWFkiIiIiIiJywcoSERERERGRC1aWiIiIiIiIXLCyRERERERE5IKVJSIiIiIiIhesLBEREREREblgZYmIiIiIiMgFK0tEREREREQuWFkiIiIiIiJywcoSERERERGRC1aWiIiIiIiIXLCyRERERERE5IKVJSIiIiIiIhesLBEREREREblgZYmIiIiIiMgFK0tEREREREQuWFkiIiIiIiJywcoSERERERGRC1aWiIiIiIiIXLCyRERERERE5IKVJSIiIiIiIhesLBEREREREblgZYmIiIiIiMgFK0tEREREREQuWFkiIiIiIiJywcoSERERERGRC1aWiIiIiIiIXLCyRERERERE5IKVJSIiIiIiIhesLBEREREREblgZYmIiIiIiMgFK0tEREREREQuWFkiIiIiIiJywcoSERERERGRC1aWiIiIiIiIXLCyRERERERE5IKVJSIiIiIiIhesLBEREREREblgZYmIiIiIiMjF/wdlvvewtdZYIAAAAABJRU5ErkJggg==[/img]

böyle diyor hocam

https://www.hizliresim.com/9krc9vq


dediğiniz gibi yaptım halen böyle hocam
Ara
Cevapla
#4
Kullandığın websocket urlsi yanlış. & yerine 8 yazmışsın.
O yüzden serverdan herhangi bir veri gelmiyor.

import websocket
import json
import threading
import time

def send_json_request(ws, request):
   ws.send(json.dumps(request))

def recieve_json_response(ws):
   response = ws.recv()
   if response:
       return json.loads(response)

def heartbeat(interval, ws):
   print("heartbeat begin")
   while True:
       time.sleep(interval)
       heartbeatJSON = {"op": 1, "d": "null"}
       send_json_request(ws, heartbeatJSON)
       print("heartbeat sent")

ws = websocket.WebSocket()
ws.connect("wss://gateway.discord.gg/?v=6&encording=json")
event = recieve_json_response(ws)

heartbeat_intervals = event['d']['heartbeat_interval'] / 10000
print("heartbeat_intervals = ", heartbeat_intervals)
threading._start_new_thread(heartbeat, (heartbeat_intervals, ws))

token = ""
payload = {'op': 2, "intents": 513, 'd':{"token": token, "properties": {"$os": "windows", "$browser": "chrome", "$device": "pc"}}}
send_json_request(ws, payload)

while True:
   event = recieve_json_response(ws)
   try:
       print(f"{event['d']['author']['username']}: {event['d']['content']}")
       op_code = event('op')
       if op_code == 11:
           print('hearth reivedd')
   except:
       pass


token kısmına çalışan bir token yazmayı unutma.

https://i.ibb.co/7VBN6Xs/heartbeat.png
Ara
Cevapla
#5
teşekkürler hocam <3
Ara
Cevapla

{lang: 'en'}


Hızlı Menü:


Konuyu Okuyanlar: 1 Ziyaretçi
Change Theme