Hide keyboard shortcuts

Hot-keys on this page

r m x p   toggle line displays

j k   next/prev highlighted chunk

0   (zero) top of page

1   (one) first highlighted chunk

1from http import post 

2from .client import Client 

3 

4class User: 

5 name: string 

6 

7class Message: 

8 channel: Channel 

9 author: User 

10 content: string 

11 

12class Channel: 

13 _client: Client 

14 _id: string 

15 

16 func __init__(self, client: Client, id: string): 

17 self._client = client 

18 self._id = id 

19 

20 func send(self, text: string): 

21 post("discord.com", 

22 path=f"/api/v8/channels/{self._id}/messages", 

23 port=443, 

24 secure=True, 

25 headers={ 

26 "Content-Type": "application/json", 

27 "Authorization": f"Bot {self._client.token}" 

28 }, 

29 content=f"{{\"content\":\"{text}\"}}".to_utf8())