You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Discord marks the ``MESSAGE_CONTENT_INTENT`` as "privileged", meaning you have to turn on a switch in the `developer portal <https://discord.com/developers/applications>`__
71
+
72
+
Creating a listener
73
+
^^^^^^^^^^^^^^^^^^^
74
+
Lets create a listener for whenever someone sends a message
75
+
76
+
A list of events can be found on the `Receive events <https://discord.dev/topics/gateway-events#receive-events>`__ page
Confused by this? Check out the :ref:`Making requests` tutorial
101
+
102
+
Connecting to Discord
103
+
^^^^^^^^^^^^^^^^^^^^^
104
+
.. code-block:: python3
105
+
106
+
await http_client.setup()
107
+
await shard_manager.connect()
108
+
109
+
.. need absolute ref for HTTPClient as its in the http module
110
+
.. warning::
111
+
:meth:`HTTPClient.setup() <nextcore.http.HTTPClient.setup>` needs to be called before :meth:`ShardManager.connect`
112
+
.. note::
113
+
:meth:`ShardManager.connect` will return once every shard has started to connect
114
+
115
+
Stopping the script from stopping
116
+
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
117
+
Since the :meth:`ShardManager.connect` function returns once every shard has started to connect, the script closes as the main thread has nothing to do.
118
+
119
+
We can wait for a critical error before closing to fix this.
The weird ``(error, )`` thing is to extract the first element out of the tuple.
19
129
130
+
Continuing
131
+
^^^^^^^^^^
132
+
We suggest you look into `interactions & application commands <https://discord.dev/interactions/application-commands>`__ as your next topic.
133
+
They allow you to add `buttons <https://discord.dev/interactions/message-components#buttons>`__ and `slash commands <https://discord.dev/interactions/application-commands#slash-commands>`__ and other cool stuff
0 commit comments