Skip to content

Commit e5a4502

Browse files
Donbur4156FayeDelEepyElvyraDamegopre-commit-ci[bot]
authored
Fix force http (#1068)
* docs: update FAQ and quickstart documentation links (#1038) * Docs: add back previous changes * docs: fix outdated links in the quickstart (#1037) Co-authored-by: Damego <damego.dev@gmail.com> * fix forcing http add force_arg which takes the pop argument to checking it twice. * ci: correct from checks. Co-authored-by: DeltaX <33706469+DeltaXWizard@users.noreply.github.com> Co-authored-by: EdVraz <88881326+EdVraz@users.noreply.github.com> Co-authored-by: Damego <damego.dev@gmail.com> Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
1 parent d0efc84 commit e5a4502

File tree

3 files changed

+17
-12
lines changed

3 files changed

+17
-12
lines changed

docs/faq.rst

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -154,21 +154,22 @@ A list of all official extensions can be found `on our github page`_
154154

155155
Those are (at the moment):
156156

157-
- A `voice client`_ - which is still WIP, but it is able to listen for the ``VOICE_STATE_UPDATE`` event.
158-
- An `autosharder`_ for automatic sharding
157+
- `voice client`_ - which is still WIP, but it is able to listen for the ``VOICE_STATE_UPDATE`` event.
158+
- `autosharder`_ for automatic sharding
159159
- `wait_for`_ allows listening and waiting for a specific event or a component inside a function
160160
- `files`_ for file sending with ctx
161161
- `Molter`_ for message commands
162162
- `enhanced`_ which enhances the DX in general
163-
- A `paginator`_ for paginating embeds on messages using components
164-
- `persistence`_ - for storing data inside your custom IDs (as an alternative to ``wait_for``)
163+
- `paginator`_ for paginating embeds on messages using components
164+
- `persistence`_ for storing data inside your custom IDs (as an alternative to ``wait_for``)
165+
- `lavalink`_ for voice sending and listening ``VOICE_STATE_UPDATE`` event
166+
- `fastapi`_ for building own API
165167
- And a `boilerplate`_
166168

167169
Below are a few unofficial exts (for the time being) which implement some functionality similar to what d.py had:
168170

169171
- `checks and cooldowns`_
170172
- `tasks`_
171-
- `get`_ for getting objects from the discord API (will be implemented into the core library at a later time)
172173

173174
Usage examples can usually be found at the linked page
174175

@@ -318,4 +319,5 @@ Please join our `Discord Server`_ for any further support regarding our library
318319
.. _persistence: https://github.com/interactions-py/persistence
319320
.. _Molter: https://github.com/interactions-py/molter
320321
.. _boilerplate: https://github.com/interactions-py/boilerplate
321-
.. _get: https://github.com/EdVraz/interactions-get
322+
.. _lavalink: https://github.com/interactions-py/interactions-lavalink
323+
.. _fastapi: https://github.com/interactions-py/interactions-fastapi

docs/quickstart.rst

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -686,6 +686,6 @@ Usage of ``@autodefer()``:
686686
await asyncio.sleep(5)
687687
await ctx.send("I'm awake now!")
688688
689-
.. _Client: https://interactionspy.rtfd.io/en/stable/client.html
690-
.. _find these component types: https://interactionspy.readthedocs.io/en/stable/models.component.html
689+
.. _Client: https://interactionspy.rtfd.io/en/latest/client.html
690+
.. _find these component types: https://interactionspy.readthedocs.io/en/latest/models.component.html
691691
.. _discord applications page: https://discord.com/developers/applications

interactions/utils/get.py

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -194,8 +194,9 @@ def _check():
194194
_objects: List[Union[_obj, Coroutine]] = []
195195
kwarg_name += "s"
196196

197-
force_cache = kwargs.pop("force", None) == "cache"
198-
force_http = kwargs.pop("force", None) == "http"
197+
force_arg = kwargs.pop("force", None)
198+
force_cache = force_arg == "cache"
199+
force_http = force_arg == "http"
199200

200201
if not force_http:
201202
_objects = _get_cache(_obj, client, kwarg_name, _list=True, **kwargs)
@@ -230,8 +231,10 @@ def _check():
230231

231232
_obj: Optional[_T] = None
232233

233-
force_cache = kwargs.pop("force", None) == "cache"
234-
force_http = kwargs.pop("force", None) == "http"
234+
force_arg = kwargs.pop("force", None)
235+
force_cache = force_arg == "cache"
236+
force_http = force_arg == "http"
237+
235238
if not force_http:
236239
_obj = _get_cache(obj, client, kwarg_name, **kwargs)
237240

0 commit comments

Comments
 (0)