Skip to content

Commit 03bbd08

Browse files
Deployed 03659a3 to dev with MkDocs 1.5.3 and mike 2.0.0
1 parent 7d74c87 commit 03bbd08

File tree

3 files changed

+3
-3
lines changed

3 files changed

+3
-3
lines changed

dev/search/search_index.json

Lines changed: 1 addition & 1 deletion
Large diffs are not rendered by default.

dev/sitemap.xml.gz

0 Bytes
Binary file not shown.

dev/tutorials/bases/index.html

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1941,7 +1941,7 @@ <h1 id="bases">Bases<a class="headerlink" href="#bases" title="Permanent link">&
19411941
- First, we call <code>await client.get_user(2067807455)</code>. ro.py asks Roblox for information about the user with the ID 2067807455 and returns it as a User object.<br />
19421942
- Next, we iterate through <code>user.username_history</code>. ro.py asks Roblox for the username history for user 2067807455 and returns it to you. </p>
19431943
<p>In this code, we call <code>await client.get_user()</code>, but we don't use any user information, like <code>user.name</code> or <code>user.description</code>. We don't need to make this request! </p>
1944-
<p>ro.py lets you do this with the <code>client.get_base_TYPE</code> functions. We'll can the <code>client.get_base_user()</code> function to improve the code:
1944+
<p>ro.py lets you skip the "information request" with the <code>client.get_base_TYPE</code> methods. We can use the <code>client.get_base_user()</code> function to improve this code:
19451945
<div class="highlight"><pre><span></span><code><span class="n">user</span> <span class="o">=</span> <span class="n">client</span><span class="o">.</span><span class="n">get_base_user</span><span class="p">(</span><span class="mi">2067807455</span><span class="p">)</span> <span class="c1"># no await!</span>
19461946
<span class="k">async</span> <span class="k">for</span> <span class="n">username</span> <span class="ow">in</span> <span class="n">user</span><span class="o">.</span><span class="n">username_history</span><span class="p">():</span>
19471947
<span class="nb">print</span><span class="p">(</span><span class="n">username</span><span class="p">)</span>
@@ -1955,7 +1955,7 @@ <h1 id="bases">Bases<a class="headerlink" href="#bases" title="Permanent link">&
19551955
<span class="n">user</span> <span class="o">=</span> <span class="n">client</span><span class="o">.</span><span class="n">get_base_user</span><span class="p">(</span><span class="mi">2067807455</span><span class="p">)</span>
19561956
<span class="k">await</span> <span class="n">group</span><span class="o">.</span><span class="n">kick_user</span><span class="p">(</span><span class="n">user</span><span class="p">)</span>
19571957
</code></pre></div></p>
1958-
<p>There's another technique we can use to optimize this example further. For functions that accept only one type, like <code>kick_user</code> which always accepts a user, ro.py accepts bare user IDs:
1958+
<p>There's another technique we can use to optimize this example further. For functions that accept only one type, like <code>kick_user</code> which always accepts a user, ro.py accepts bare IDs:
19591959
<div class="highlight"><pre><span></span><code><span class="n">group</span> <span class="o">=</span> <span class="n">client</span><span class="o">.</span><span class="n">get_base_group</span><span class="p">(</span><span class="mi">9695397</span><span class="p">)</span>
19601960
<span class="k">await</span> <span class="n">group</span><span class="o">.</span><span class="n">kick_user</span><span class="p">(</span><span class="mi">2067807455</span><span class="p">)</span>
19611961
</code></pre></div></p>

0 commit comments

Comments
 (0)