-
Notifications
You must be signed in to change notification settings - Fork 0
/
migrating.html
1449 lines (1411 loc) · 172 KB
/
migrating.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>1.0 버전으로 이전하기</title>
<!-- end extra head -->
<link href="https://fonts.googleapis.com/icon?family=Material+Icons" rel="stylesheet">
<link rel="stylesheet" href="_static/style.css" type="text/css" />
<link rel="stylesheet" href="_static/codeblocks.css" type="text/css" />
<link rel="stylesheet" href="_static/icons.css" type="text/css" />
<script id="documentation_options" data-url_root="./" src="_static/documentation_options.js"></script>
<script src="_static/jquery.js"></script>
<script src="_static/underscore.js"></script>
<script src="_static/doctools.js"></script>
<script src="_static/language_data.js"></script>
<script src="_static/custom.js"></script>
<script src="_static/settings.js"></script>
<script src="_static/copy.js"></script>
<script src="_static/sidebar.js"></script>
<script src="_static/translations.js"></script>
<link rel="shortcut icon" href="_static/discord_py_logo.ico"/>
<link rel="index" title="색인" href="genindex.html" />
<link rel="search" title="검색" href="search.html" />
<link rel="prev" title="버전 개런티" href="version_guarantees.html" />
</head>
<body>
<div class="main-grid">
<header class="grid-item">
<nav>
<a href="index.html" class="main-heading">discord.py</a>
<a href="https://github.com/Rapptz/discord.py" title="GitHub"><span class="material-icons custom-icons">github</span></a>
<a href="https://discord.gg/YbfbxpX" title="Discord"><span class="material-icons custom-icons">discord</span></a>
<a href="faq.html" title="FAQ"><span class="material-icons">help_center</span></a>
<a onclick="mobileSearch.open();" title="검색" id="open-search" class="mobile-only"><span class="material-icons">search</span></a>
<a onclick="mobileSearch.close();" title="Close" id="close-search" class="mobile-only" hidden><span class="material-icons">close</span></a>
</nav>
<nav class="mobile-only">
<form role="search" class="search" action="search.html" method="get">
<div class="search-wrapper">
<input type="search" name="q" placeholder="Search documentation" />
<button type="submit">
<span class="material-icons">search</span>
</button>
</div>
</form>
</nav>
</header>
<div class="sub-header grid-item">
<label for="documentation_select">View Documentation For</label>
<select id="documentation_select" onchange="window.location = this.value;">
<option value="#" selected>discord</option>
<option value="ext/commands/index.html" >discord.ext.commands</option>
<option value="ext/tasks/index.html" >discord.ext.tasks</option>
</select>
<form role="search" class="search" action="search.html" method="get">
<div class="search-wrapper">
<input type="search" name="q" placeholder="Search documentation" />
<button type="submit">
<span class="material-icons">search</span>
</button>
</div>
</form>
<a accesskey="S" class="settings" onclick="settingsModal.open();"><span class="material-icons">settings</span></a>
</div>
<aside class="grid-item">
<span id="hamburger-toggle">
<span class="material-icons">menu</span>
</span>
<span id="settings-toggle" class="settings" onclick="settingsModal.open();">
<span class="material-icons">settings</span>
</span>
<div id="sidebar">
<h3><a href="index.html">목차</a></h3>
<ul>
<li><a class="reference internal" href="#">1.0 버전으로 이전하기</a><ul>
<li><a class="reference internal" href="#python-version-change">파이썬의 버전 변화</a></li>
<li><a class="reference internal" href="#major-model-changes">주요 모델 변화</a><ul>
<li><a class="reference internal" href="#snowflakes-are-int">Snowflake는 정수형입니다.</a></li>
<li><a class="reference internal" href="#server-is-now-guild">Server는 이제 Guild입니다.</a></li>
<li><a class="reference internal" href="#models-are-stateful">모델들은</a></li>
<li><a class="reference internal" href="#property-changes">속성 변화</a></li>
<li><a class="reference internal" href="#dict-value-change">딕셔너리 값 변화</a></li>
<li><a class="reference internal" href="#voice-state-changes">Voice State Changes</a></li>
<li><a class="reference internal" href="#user-and-member-type-split">User and Member Type Split</a></li>
<li><a class="reference internal" href="#channel-type-split">Channel Type Split</a></li>
<li><a class="reference internal" href="#miscellaneous-model-changes">Miscellaneous Model Changes</a></li>
</ul>
</li>
<li><a class="reference internal" href="#sending-messages">Sending Messages</a></li>
<li><a class="reference internal" href="#asynchronous-iterators">Asynchronous Iterators</a></li>
<li><a class="reference internal" href="#event-changes">Event Changes</a></li>
<li><a class="reference internal" href="#voice-changes">Voice Changes</a></li>
<li><a class="reference internal" href="#waiting-for-events">Waiting For Events</a></li>
<li><a class="reference internal" href="#upgraded-dependencies">Upgraded Dependencies</a></li>
<li><a class="reference internal" href="#sharding">Sharding</a></li>
<li><a class="reference internal" href="#connection-improvements">Connection Improvements</a></li>
<li><a class="reference internal" href="#command-extension-changes">Command Extension Changes</a><ul>
<li><a class="reference internal" href="#context-changes">Context Changes</a><ul>
<li><a class="reference internal" href="#subclassing-context">Subclassing Context</a></li>
<li><a class="reference internal" href="#removed-helpers">Removed Helpers</a></li>
</ul>
</li>
<li><a class="reference internal" href="#command-changes">Command Changes</a></li>
<li><a class="reference internal" href="#check-changes">Check Changes</a></li>
<li><a class="reference internal" href="#id2">Event Changes</a></li>
<li><a class="reference internal" href="#helpformatter-and-help-command-changes">HelpFormatter and Help Command Changes</a></li>
<li><a class="reference internal" href="#cog-changes">Cog Changes</a></li>
<li><a class="reference internal" href="#before-and-after-invocation-hooks">Before and After Invocation Hooks</a></li>
<li><a class="reference internal" href="#converter-changes">Converter Changes</a></li>
</ul>
</li>
</ul>
</li>
</ul>
</div>
</aside>
<main class="grid-item" role="main">
<section id="migrating-to-v1-0">
<span id="migrating-1-0"></span><h1>1.0 버전으로 이전하기<a class="headerlink" href="#migrating-to-v1-0" title="제목 주소">¶</a></h1>
<p>1.0 버전은 전체적인 재설계로 인해 구버전과 크게 달라졌습니다.</p>
<p>모든 의도와 목적들을 위한 변경 점들은 매우 방대하고 기므로,이것은 완전히 새로운 라이브러리가 되었습니다.</p>
<p>재설계에는 여러 가지 요소들을 더 쉽게, 그리고 더 자연스럽게 만드는 것이 포함됩니다.이러한 작업은 어떤 일을 하기 위해 <a class="reference internal" href="api.html#discord.Client" title="discord.Client"><code class="xref py py-class docutils literal notranslate"><span class="pre">Client</span></code></a> 의 객체를 요구하는 대신에 <a class="reference internal" href="api.html#discord-api-models"><span class="std std-ref">models</span></a> 위에서 완료됩니다.</p>
<section id="python-version-change">
<h2>파이썬의 버전 변화<a class="headerlink" href="#python-version-change" title="제목 주소">¶</a></h2>
<p>개발을 더 쉽게 만들기 위해, 그리고 우리가 의존하는 라이브러리들이3.7 이상의 버전들을 지원하는 것을 허락하기 위해 버전을 올리는 것을 허락하기 위해, discord.py는3.5.3 아래의 파이썬 버전들을 지원하지 않기로 했습니다. 이것은 본질적으로 <strong>파이썬 3.4버전을 지원하는 일이 취소되었음</strong> 을 의미합니다.</p>
</section>
<section id="major-model-changes">
<h2>주요 모델 변화<a class="headerlink" href="#major-model-changes" title="제목 주소">¶</a></h2>
<p>아래는 1.0 버전에서 발생한 주요 모델들의 변경 점들입니다.</p>
<section id="snowflakes-are-int">
<h3>Snowflake는 정수형입니다.<a class="headerlink" href="#snowflakes-are-int" title="제목 주소">¶</a></h3>
<p>1.0 이전 버전에서는, 모든 snowflake들은(<code class="docutils literal notranslate"><span class="pre">id</span></code> 특성) 문자열이었습니다. 이것은 <a class="reference external" href="https://docs.python.org/ko/3/library/functions.html#int" title="(in Python v3.9)"><code class="xref py py-class docutils literal notranslate"><span class="pre">int</span></code></a> 로 변경되었습니다.</p>
<p>간단한 예제입니다:</p>
<div class="highlight-default notranslate"><div class="highlight"><pre><span></span><span class="c1"># before</span>
<span class="n">ch</span> <span class="o">=</span> <span class="n">client</span><span class="o">.</span><span class="n">get_channel</span><span class="p">(</span><span class="s1">'84319995256905728'</span><span class="p">)</span>
<span class="k">if</span> <span class="n">message</span><span class="o">.</span><span class="n">author</span><span class="o">.</span><span class="n">id</span> <span class="o">==</span> <span class="s1">'80528701850124288'</span><span class="p">:</span>
<span class="o">...</span>
<span class="c1"># after</span>
<span class="n">ch</span> <span class="o">=</span> <span class="n">client</span><span class="o">.</span><span class="n">get_channel</span><span class="p">(</span><span class="mi">84319995256905728</span><span class="p">)</span>
<span class="k">if</span> <span class="n">message</span><span class="o">.</span><span class="n">author</span><span class="o">.</span><span class="n">id</span> <span class="o">==</span> <span class="mi">80528701850124288</span><span class="p">:</span>
<span class="o">...</span>
</pre></div>
</div>
<p>이 변경 점은 ID를 따옴표로 감싸지 않게 만들어 공식 클라이언트에서 ID를 복사하는 기능을 사용했을 때 발생하는 오류의 수를 줄일 수 있게 합니다.또한, 이 변경 점은 내부적으로 JSON 대신 ETF가 사용될 수 있게 해 최적화를 했습니다.</p>
</section>
<section id="server-is-now-guild">
<h3>Server는 이제 Guild입니다.<a class="headerlink" href="#server-is-now-guild" title="제목 주소">¶</a></h3>
<p>공식 API 문서는 《Server》의 개념을 《Guild》라고 부릅니다. API 문서와 더욱 일관되게 만들기 위해서, 이 모델은 <a class="reference internal" href="api.html#discord.Guild" title="discord.Guild"><code class="xref py py-class docutils literal notranslate"><span class="pre">Guild</span></code></a> 로 개명되었고 이를 참조하는 모든 객체 또한 변경되었습니다.</p>
<p>아래는 변경된 항목들입니다.</p>
<div class="table-wrapper"><table class="docutils align-default">
<colgroup>
<col style="width: 48%" />
<col style="width: 52%" />
</colgroup>
<tbody>
<tr class="row-odd"><td><p>이전</p></td>
<td><p>이후</p></td>
</tr>
<tr class="row-even"><td><p><code class="docutils literal notranslate"><span class="pre">Message.server</span></code></p></td>
<td><p><a class="reference internal" href="api.html#discord.Message.guild" title="discord.Message.guild"><code class="xref py py-attr docutils literal notranslate"><span class="pre">Message.guild</span></code></a></p></td>
</tr>
<tr class="row-odd"><td><p><code class="docutils literal notranslate"><span class="pre">Channel.server</span></code></p></td>
<td><p><a class="reference internal" href="api.html#discord.abc.GuildChannel.guild" title="discord.abc.GuildChannel.guild"><code class="xref py py-attr docutils literal notranslate"><span class="pre">GuildChannel.guild</span></code></a></p></td>
</tr>
<tr class="row-even"><td><p><code class="docutils literal notranslate"><span class="pre">Client.servers</span></code></p></td>
<td><p><a class="reference internal" href="api.html#discord.Client.guilds" title="discord.Client.guilds"><code class="xref py py-attr docutils literal notranslate"><span class="pre">Client.guilds</span></code></a></p></td>
</tr>
<tr class="row-odd"><td><p><code class="docutils literal notranslate"><span class="pre">Client.get_server</span></code></p></td>
<td><p><a class="reference internal" href="api.html#discord.Client.get_guild" title="discord.Client.get_guild"><code class="xref py py-meth docutils literal notranslate"><span class="pre">Client.get_guild()</span></code></a></p></td>
</tr>
<tr class="row-even"><td><p><code class="docutils literal notranslate"><span class="pre">Emoji.server</span></code></p></td>
<td><p><a class="reference internal" href="api.html#discord.Emoji.guild" title="discord.Emoji.guild"><code class="xref py py-attr docutils literal notranslate"><span class="pre">Emoji.guild</span></code></a></p></td>
</tr>
<tr class="row-odd"><td><p><code class="docutils literal notranslate"><span class="pre">Role.server</span></code></p></td>
<td><p><a class="reference internal" href="api.html#discord.Role.guild" title="discord.Role.guild"><code class="xref py py-attr docutils literal notranslate"><span class="pre">Role.guild</span></code></a></p></td>
</tr>
<tr class="row-even"><td><p><code class="docutils literal notranslate"><span class="pre">Invite.server</span></code></p></td>
<td><p><a class="reference internal" href="api.html#discord.Invite.guild" title="discord.Invite.guild"><code class="xref py py-attr docutils literal notranslate"><span class="pre">Invite.guild</span></code></a></p></td>
</tr>
<tr class="row-odd"><td><p><code class="docutils literal notranslate"><span class="pre">Member.server</span></code></p></td>
<td><p><a class="reference internal" href="api.html#discord.Member.guild" title="discord.Member.guild"><code class="xref py py-attr docutils literal notranslate"><span class="pre">Member.guild</span></code></a></p></td>
</tr>
<tr class="row-even"><td><p><code class="docutils literal notranslate"><span class="pre">Permissions.manage_server</span></code></p></td>
<td><p><a class="reference internal" href="api.html#discord.Permissions.manage_guild" title="discord.Permissions.manage_guild"><code class="xref py py-attr docutils literal notranslate"><span class="pre">Permissions.manage_guild</span></code></a></p></td>
</tr>
<tr class="row-odd"><td><p><code class="docutils literal notranslate"><span class="pre">VoiceClient.server</span></code></p></td>
<td><p><a class="reference internal" href="api.html#discord.VoiceClient.guild" title="discord.VoiceClient.guild"><code class="xref py py-attr docutils literal notranslate"><span class="pre">VoiceClient.guild</span></code></a></p></td>
</tr>
<tr class="row-even"><td><p><code class="docutils literal notranslate"><span class="pre">Client.create_server</span></code></p></td>
<td><p><a class="reference internal" href="api.html#discord.Client.create_guild" title="discord.Client.create_guild"><code class="xref py py-meth docutils literal notranslate"><span class="pre">Client.create_guild()</span></code></a></p></td>
</tr>
</tbody>
</table>
</div></section>
<section id="models-are-stateful">
<span id="migrating-1-0-model-state"></span><h3>모델들은<a class="headerlink" href="#models-are-stateful" title="제목 주소">¶</a></h3>
<p>이전에 언급했듯이, 많은 기능이 <a class="reference internal" href="api.html#discord.Client" title="discord.Client"><code class="xref py py-class docutils literal notranslate"><span class="pre">Client</span></code></a> 의 밖으로 이동해 각각의 <a class="reference internal" href="api.html#discord-api-models"><span class="std std-ref">model</span></a>에 포함되었습니다.</p>
<p>변경된 항목들은 아래에 기재되어 있습니다.</p>
<div class="table-wrapper"><table class="docutils align-default">
<colgroup>
<col style="width: 33%" />
<col style="width: 67%" />
</colgroup>
<tbody>
<tr class="row-odd"><td><p>이전</p></td>
<td><p>이후</p></td>
</tr>
<tr class="row-even"><td><p><code class="docutils literal notranslate"><span class="pre">Client.add_reaction</span></code></p></td>
<td><p><a class="reference internal" href="api.html#discord.Message.add_reaction" title="discord.Message.add_reaction"><code class="xref py py-meth docutils literal notranslate"><span class="pre">Message.add_reaction()</span></code></a></p></td>
</tr>
<tr class="row-odd"><td><p><code class="docutils literal notranslate"><span class="pre">Client.add_roles</span></code></p></td>
<td><p><a class="reference internal" href="api.html#discord.Member.add_roles" title="discord.Member.add_roles"><code class="xref py py-meth docutils literal notranslate"><span class="pre">Member.add_roles()</span></code></a></p></td>
</tr>
<tr class="row-even"><td><p><code class="docutils literal notranslate"><span class="pre">Client.ban</span></code></p></td>
<td><p><a class="reference internal" href="api.html#discord.Member.ban" title="discord.Member.ban"><code class="xref py py-meth docutils literal notranslate"><span class="pre">Member.ban()</span></code></a> 또는 <a class="reference internal" href="api.html#discord.Guild.ban" title="discord.Guild.ban"><code class="xref py py-meth docutils literal notranslate"><span class="pre">Guild.ban()</span></code></a></p></td>
</tr>
<tr class="row-odd"><td><p><code class="docutils literal notranslate"><span class="pre">Client.change_nickname</span></code></p></td>
<td><p><a class="reference internal" href="api.html#discord.Member.edit" title="discord.Member.edit"><code class="xref py py-meth docutils literal notranslate"><span class="pre">Member.edit()</span></code></a></p></td>
</tr>
<tr class="row-even"><td><p><code class="docutils literal notranslate"><span class="pre">Client.clear_reactions</span></code></p></td>
<td><p><a class="reference internal" href="api.html#discord.Message.clear_reactions" title="discord.Message.clear_reactions"><code class="xref py py-meth docutils literal notranslate"><span class="pre">Message.clear_reactions()</span></code></a></p></td>
</tr>
<tr class="row-odd"><td><p><code class="docutils literal notranslate"><span class="pre">Client.create_channel</span></code></p></td>
<td><p><a class="reference internal" href="api.html#discord.Guild.create_text_channel" title="discord.Guild.create_text_channel"><code class="xref py py-meth docutils literal notranslate"><span class="pre">Guild.create_text_channel()</span></code></a> 과 <a class="reference internal" href="api.html#discord.Guild.create_voice_channel" title="discord.Guild.create_voice_channel"><code class="xref py py-meth docutils literal notranslate"><span class="pre">Guild.create_voice_channel()</span></code></a></p></td>
</tr>
<tr class="row-even"><td><p><code class="docutils literal notranslate"><span class="pre">Client.create_custom_emoji</span></code></p></td>
<td><p><a class="reference internal" href="api.html#discord.Guild.create_custom_emoji" title="discord.Guild.create_custom_emoji"><code class="xref py py-meth docutils literal notranslate"><span class="pre">Guild.create_custom_emoji()</span></code></a></p></td>
</tr>
<tr class="row-odd"><td><p><code class="docutils literal notranslate"><span class="pre">Client.create_invite</span></code></p></td>
<td><p><a class="reference internal" href="api.html#discord.abc.GuildChannel.create_invite" title="discord.abc.GuildChannel.create_invite"><code class="xref py py-meth docutils literal notranslate"><span class="pre">abc.GuildChannel.create_invite()</span></code></a></p></td>
</tr>
<tr class="row-even"><td><p><code class="docutils literal notranslate"><span class="pre">Client.create_role</span></code></p></td>
<td><p><a class="reference internal" href="api.html#discord.Guild.create_role" title="discord.Guild.create_role"><code class="xref py py-meth docutils literal notranslate"><span class="pre">Guild.create_role()</span></code></a></p></td>
</tr>
<tr class="row-odd"><td><p><code class="docutils literal notranslate"><span class="pre">Client.delete_channel</span></code></p></td>
<td><p><a class="reference internal" href="api.html#discord.abc.GuildChannel.delete" title="discord.abc.GuildChannel.delete"><code class="xref py py-meth docutils literal notranslate"><span class="pre">abc.GuildChannel.delete()</span></code></a></p></td>
</tr>
<tr class="row-even"><td><p><code class="docutils literal notranslate"><span class="pre">Client.delete_channel_permissions</span></code></p></td>
<td><p><code class="docutils literal notranslate"><span class="pre">overwrite</span></code> 된 <a class="reference internal" href="api.html#discord.abc.GuildChannel.set_permissions" title="discord.abc.GuildChannel.set_permissions"><code class="xref py py-meth docutils literal notranslate"><span class="pre">abc.GuildChannel.set_permissions()</span></code></a> 는 <code class="docutils literal notranslate"><span class="pre">None</span></code> 으로 설정되었습니다.</p></td>
</tr>
<tr class="row-odd"><td><p><code class="docutils literal notranslate"><span class="pre">Client.delete_custom_emoji</span></code></p></td>
<td><p><a class="reference internal" href="api.html#discord.Emoji.delete" title="discord.Emoji.delete"><code class="xref py py-meth docutils literal notranslate"><span class="pre">Emoji.delete()</span></code></a></p></td>
</tr>
<tr class="row-even"><td><p><code class="docutils literal notranslate"><span class="pre">Client.delete_invite</span></code></p></td>
<td><p><a class="reference internal" href="api.html#discord.Invite.delete" title="discord.Invite.delete"><code class="xref py py-meth docutils literal notranslate"><span class="pre">Invite.delete()</span></code></a> 또는 <a class="reference internal" href="api.html#discord.Client.delete_invite" title="discord.Client.delete_invite"><code class="xref py py-meth docutils literal notranslate"><span class="pre">Client.delete_invite()</span></code></a></p></td>
</tr>
<tr class="row-odd"><td><p><code class="docutils literal notranslate"><span class="pre">Client.delete_message</span></code></p></td>
<td><p><a class="reference internal" href="api.html#discord.Message.delete" title="discord.Message.delete"><code class="xref py py-meth docutils literal notranslate"><span class="pre">Message.delete()</span></code></a></p></td>
</tr>
<tr class="row-even"><td><p><code class="docutils literal notranslate"><span class="pre">Client.delete_messages</span></code></p></td>
<td><p><a class="reference internal" href="api.html#discord.TextChannel.delete_messages" title="discord.TextChannel.delete_messages"><code class="xref py py-meth docutils literal notranslate"><span class="pre">TextChannel.delete_messages()</span></code></a></p></td>
</tr>
<tr class="row-odd"><td><p><code class="docutils literal notranslate"><span class="pre">Client.delete_role</span></code></p></td>
<td><p><a class="reference internal" href="api.html#discord.Role.delete" title="discord.Role.delete"><code class="xref py py-meth docutils literal notranslate"><span class="pre">Role.delete()</span></code></a></p></td>
</tr>
<tr class="row-even"><td><p><code class="docutils literal notranslate"><span class="pre">Client.delete_server</span></code></p></td>
<td><p><a class="reference internal" href="api.html#discord.Guild.delete" title="discord.Guild.delete"><code class="xref py py-meth docutils literal notranslate"><span class="pre">Guild.delete()</span></code></a></p></td>
</tr>
<tr class="row-odd"><td><p><code class="docutils literal notranslate"><span class="pre">Client.edit_channel</span></code></p></td>
<td><p><a class="reference internal" href="api.html#discord.TextChannel.edit" title="discord.TextChannel.edit"><code class="xref py py-meth docutils literal notranslate"><span class="pre">TextChannel.edit()</span></code></a> 또는 <a class="reference internal" href="api.html#discord.VoiceChannel.edit" title="discord.VoiceChannel.edit"><code class="xref py py-meth docutils literal notranslate"><span class="pre">VoiceChannel.edit()</span></code></a></p></td>
</tr>
<tr class="row-even"><td><p><code class="docutils literal notranslate"><span class="pre">Client.edit_channel_permissions</span></code></p></td>
<td><p><a class="reference internal" href="api.html#discord.abc.GuildChannel.set_permissions" title="discord.abc.GuildChannel.set_permissions"><code class="xref py py-meth docutils literal notranslate"><span class="pre">abc.GuildChannel.set_permissions()</span></code></a></p></td>
</tr>
<tr class="row-odd"><td><p><code class="docutils literal notranslate"><span class="pre">Client.edit_custom_emoji</span></code></p></td>
<td><p><a class="reference internal" href="api.html#discord.Emoji.edit" title="discord.Emoji.edit"><code class="xref py py-meth docutils literal notranslate"><span class="pre">Emoji.edit()</span></code></a></p></td>
</tr>
<tr class="row-even"><td><p><code class="docutils literal notranslate"><span class="pre">Client.edit_message</span></code></p></td>
<td><p><a class="reference internal" href="api.html#discord.Message.edit" title="discord.Message.edit"><code class="xref py py-meth docutils literal notranslate"><span class="pre">Message.edit()</span></code></a></p></td>
</tr>
<tr class="row-odd"><td><p><code class="docutils literal notranslate"><span class="pre">Client.edit_profile</span></code></p></td>
<td><p><a class="reference internal" href="api.html#discord.ClientUser.edit" title="discord.ClientUser.edit"><code class="xref py py-meth docutils literal notranslate"><span class="pre">ClientUser.edit()</span></code></a> (<a class="reference internal" href="api.html#discord.Client.user" title="discord.Client.user"><code class="xref py py-attr docutils literal notranslate"><span class="pre">Client.user</span></code></a> 에서 얻을 수 있습니다.)</p></td>
</tr>
<tr class="row-even"><td><p><code class="docutils literal notranslate"><span class="pre">Client.edit_role</span></code></p></td>
<td><p><a class="reference internal" href="api.html#discord.Role.edit" title="discord.Role.edit"><code class="xref py py-meth docutils literal notranslate"><span class="pre">Role.edit()</span></code></a></p></td>
</tr>
<tr class="row-odd"><td><p><code class="docutils literal notranslate"><span class="pre">Client.edit_server</span></code></p></td>
<td><p><a class="reference internal" href="api.html#discord.Guild.edit" title="discord.Guild.edit"><code class="xref py py-meth docutils literal notranslate"><span class="pre">Guild.edit()</span></code></a></p></td>
</tr>
<tr class="row-even"><td><p><code class="docutils literal notranslate"><span class="pre">Client.estimate_pruned_members</span></code></p></td>
<td><p><a class="reference internal" href="api.html#discord.Guild.estimate_pruned_members" title="discord.Guild.estimate_pruned_members"><code class="xref py py-meth docutils literal notranslate"><span class="pre">Guild.estimate_pruned_members()</span></code></a></p></td>
</tr>
<tr class="row-odd"><td><p><code class="docutils literal notranslate"><span class="pre">Client.get_all_emojis</span></code></p></td>
<td><p><a class="reference internal" href="api.html#discord.Client.emojis" title="discord.Client.emojis"><code class="xref py py-attr docutils literal notranslate"><span class="pre">Client.emojis</span></code></a></p></td>
</tr>
<tr class="row-even"><td><p><code class="docutils literal notranslate"><span class="pre">Client.get_bans</span></code></p></td>
<td><p><a class="reference internal" href="api.html#discord.Guild.bans" title="discord.Guild.bans"><code class="xref py py-meth docutils literal notranslate"><span class="pre">Guild.bans()</span></code></a></p></td>
</tr>
<tr class="row-odd"><td><p><code class="docutils literal notranslate"><span class="pre">Client.get_invite</span></code></p></td>
<td><p><a class="reference internal" href="api.html#discord.Client.fetch_invite" title="discord.Client.fetch_invite"><code class="xref py py-meth docutils literal notranslate"><span class="pre">Client.fetch_invite()</span></code></a></p></td>
</tr>
<tr class="row-even"><td><p><code class="docutils literal notranslate"><span class="pre">Client.get_message</span></code></p></td>
<td><p><a class="reference internal" href="api.html#discord.abc.Messageable.fetch_message" title="discord.abc.Messageable.fetch_message"><code class="xref py py-meth docutils literal notranslate"><span class="pre">abc.Messageable.fetch_message()</span></code></a></p></td>
</tr>
<tr class="row-odd"><td><p><code class="docutils literal notranslate"><span class="pre">Client.get_reaction_users</span></code></p></td>
<td><p><a class="reference internal" href="api.html#discord.Reaction.users" title="discord.Reaction.users"><code class="xref py py-meth docutils literal notranslate"><span class="pre">Reaction.users()</span></code></a></p></td>
</tr>
<tr class="row-even"><td><p><code class="docutils literal notranslate"><span class="pre">Client.get_user_info</span></code></p></td>
<td><p><a class="reference internal" href="api.html#discord.Client.fetch_user" title="discord.Client.fetch_user"><code class="xref py py-meth docutils literal notranslate"><span class="pre">Client.fetch_user()</span></code></a></p></td>
</tr>
<tr class="row-odd"><td><p><code class="docutils literal notranslate"><span class="pre">Client.invites_from</span></code></p></td>
<td><p><a class="reference internal" href="api.html#discord.abc.GuildChannel.invites" title="discord.abc.GuildChannel.invites"><code class="xref py py-meth docutils literal notranslate"><span class="pre">abc.GuildChannel.invites()</span></code></a> 또는 <a class="reference internal" href="api.html#discord.Guild.invites" title="discord.Guild.invites"><code class="xref py py-meth docutils literal notranslate"><span class="pre">Guild.invites()</span></code></a></p></td>
</tr>
<tr class="row-even"><td><p><code class="docutils literal notranslate"><span class="pre">Client.join_voice_channel</span></code></p></td>
<td><p><a class="reference internal" href="api.html#discord.VoiceChannel.connect" title="discord.VoiceChannel.connect"><code class="xref py py-meth docutils literal notranslate"><span class="pre">VoiceChannel.connect()</span></code></a> (<a class="reference internal" href="#migrating-1-0-voice"><span class="std std-ref">Voice Changes</span></a> 를 참고해주세요)</p></td>
</tr>
<tr class="row-odd"><td><p><code class="docutils literal notranslate"><span class="pre">Client.kick</span></code></p></td>
<td><p><a class="reference internal" href="api.html#discord.Guild.kick" title="discord.Guild.kick"><code class="xref py py-meth docutils literal notranslate"><span class="pre">Guild.kick()</span></code></a> 또는 <a class="reference internal" href="api.html#discord.Member.kick" title="discord.Member.kick"><code class="xref py py-meth docutils literal notranslate"><span class="pre">Member.kick()</span></code></a></p></td>
</tr>
<tr class="row-even"><td><p><code class="docutils literal notranslate"><span class="pre">Client.leave_server</span></code></p></td>
<td><p><a class="reference internal" href="api.html#discord.Guild.leave" title="discord.Guild.leave"><code class="xref py py-meth docutils literal notranslate"><span class="pre">Guild.leave()</span></code></a></p></td>
</tr>
<tr class="row-odd"><td><p><code class="docutils literal notranslate"><span class="pre">Client.logs_from</span></code></p></td>
<td><p><a class="reference internal" href="api.html#discord.abc.Messageable.history" title="discord.abc.Messageable.history"><code class="xref py py-meth docutils literal notranslate"><span class="pre">abc.Messageable.history()</span></code></a> (<a class="reference internal" href="#migrating-1-0-async-iter"><span class="std std-ref">Asynchronous Iterators</span></a> 를 참고해주세요)</p></td>
</tr>
<tr class="row-even"><td><p><code class="docutils literal notranslate"><span class="pre">Client.move_channel</span></code></p></td>
<td><p><a class="reference internal" href="api.html#discord.TextChannel.edit" title="discord.TextChannel.edit"><code class="xref py py-meth docutils literal notranslate"><span class="pre">TextChannel.edit()</span></code></a> 또는 <a class="reference internal" href="api.html#discord.VoiceChannel.edit" title="discord.VoiceChannel.edit"><code class="xref py py-meth docutils literal notranslate"><span class="pre">VoiceChannel.edit()</span></code></a></p></td>
</tr>
<tr class="row-odd"><td><p><code class="docutils literal notranslate"><span class="pre">Client.move_member</span></code></p></td>
<td><p><a class="reference internal" href="api.html#discord.Member.edit" title="discord.Member.edit"><code class="xref py py-meth docutils literal notranslate"><span class="pre">Member.edit()</span></code></a></p></td>
</tr>
<tr class="row-even"><td><p><code class="docutils literal notranslate"><span class="pre">Client.move_role</span></code></p></td>
<td><p><a class="reference internal" href="api.html#discord.Role.edit" title="discord.Role.edit"><code class="xref py py-meth docutils literal notranslate"><span class="pre">Role.edit()</span></code></a></p></td>
</tr>
<tr class="row-odd"><td><p><code class="docutils literal notranslate"><span class="pre">Client.pin_message</span></code></p></td>
<td><p><a class="reference internal" href="api.html#discord.Message.pin" title="discord.Message.pin"><code class="xref py py-meth docutils literal notranslate"><span class="pre">Message.pin()</span></code></a></p></td>
</tr>
<tr class="row-even"><td><p><code class="docutils literal notranslate"><span class="pre">Client.pins_from</span></code></p></td>
<td><p><a class="reference internal" href="api.html#discord.abc.Messageable.pins" title="discord.abc.Messageable.pins"><code class="xref py py-meth docutils literal notranslate"><span class="pre">abc.Messageable.pins()</span></code></a></p></td>
</tr>
<tr class="row-odd"><td><p><code class="docutils literal notranslate"><span class="pre">Client.prune_members</span></code></p></td>
<td><p><a class="reference internal" href="api.html#discord.Guild.prune_members" title="discord.Guild.prune_members"><code class="xref py py-meth docutils literal notranslate"><span class="pre">Guild.prune_members()</span></code></a></p></td>
</tr>
<tr class="row-even"><td><p><code class="docutils literal notranslate"><span class="pre">Client.purge_from</span></code></p></td>
<td><p><a class="reference internal" href="api.html#discord.TextChannel.purge" title="discord.TextChannel.purge"><code class="xref py py-meth docutils literal notranslate"><span class="pre">TextChannel.purge()</span></code></a></p></td>
</tr>
<tr class="row-odd"><td><p><code class="docutils literal notranslate"><span class="pre">Client.remove_reaction</span></code></p></td>
<td><p><a class="reference internal" href="api.html#discord.Message.remove_reaction" title="discord.Message.remove_reaction"><code class="xref py py-meth docutils literal notranslate"><span class="pre">Message.remove_reaction()</span></code></a></p></td>
</tr>
<tr class="row-even"><td><p><code class="docutils literal notranslate"><span class="pre">Client.remove_roles</span></code></p></td>
<td><p><a class="reference internal" href="api.html#discord.Member.remove_roles" title="discord.Member.remove_roles"><code class="xref py py-meth docutils literal notranslate"><span class="pre">Member.remove_roles()</span></code></a></p></td>
</tr>
<tr class="row-odd"><td><p><code class="docutils literal notranslate"><span class="pre">Client.replace_roles</span></code></p></td>
<td><p><a class="reference internal" href="api.html#discord.Member.edit" title="discord.Member.edit"><code class="xref py py-meth docutils literal notranslate"><span class="pre">Member.edit()</span></code></a></p></td>
</tr>
<tr class="row-even"><td><p><code class="docutils literal notranslate"><span class="pre">Client.send_file</span></code></p></td>
<td><p><a class="reference internal" href="api.html#discord.abc.Messageable.send" title="discord.abc.Messageable.send"><code class="xref py py-meth docutils literal notranslate"><span class="pre">abc.Messageable.send()</span></code></a> (<a class="reference internal" href="#migrating-1-0-sending-messages"><span class="std std-ref">Sending Messages</span></a> 를 참고해주세요)</p></td>
</tr>
<tr class="row-odd"><td><p><code class="docutils literal notranslate"><span class="pre">Client.send_message</span></code></p></td>
<td><p><a class="reference internal" href="api.html#discord.abc.Messageable.send" title="discord.abc.Messageable.send"><code class="xref py py-meth docutils literal notranslate"><span class="pre">abc.Messageable.send()</span></code></a> (<a class="reference internal" href="#migrating-1-0-sending-messages"><span class="std std-ref">Sending Messages</span></a> 를 참고해주세요)</p></td>
</tr>
<tr class="row-even"><td><p><code class="docutils literal notranslate"><span class="pre">Client.send_typing</span></code></p></td>
<td><p><a class="reference internal" href="api.html#discord.abc.Messageable.trigger_typing" title="discord.abc.Messageable.trigger_typing"><code class="xref py py-meth docutils literal notranslate"><span class="pre">abc.Messageable.trigger_typing()</span></code></a> (<a class="reference internal" href="api.html#discord.abc.Messageable.typing" title="discord.abc.Messageable.typing"><code class="xref py py-meth docutils literal notranslate"><span class="pre">abc.Messageable.typing()</span></code></a> 를 사용합니다)</p></td>
</tr>
<tr class="row-odd"><td><p><code class="docutils literal notranslate"><span class="pre">Client.server_voice_state</span></code></p></td>
<td><p><a class="reference internal" href="api.html#discord.Member.edit" title="discord.Member.edit"><code class="xref py py-meth docutils literal notranslate"><span class="pre">Member.edit()</span></code></a></p></td>
</tr>
<tr class="row-even"><td><p><code class="docutils literal notranslate"><span class="pre">Client.start_private_message</span></code></p></td>
<td><p><a class="reference internal" href="api.html#discord.User.create_dm" title="discord.User.create_dm"><code class="xref py py-meth docutils literal notranslate"><span class="pre">User.create_dm()</span></code></a></p></td>
</tr>
<tr class="row-odd"><td><p><code class="docutils literal notranslate"><span class="pre">Client.unban</span></code></p></td>
<td><p><a class="reference internal" href="api.html#discord.Guild.unban" title="discord.Guild.unban"><code class="xref py py-meth docutils literal notranslate"><span class="pre">Guild.unban()</span></code></a> 또는 <a class="reference internal" href="api.html#discord.Member.unban" title="discord.Member.unban"><code class="xref py py-meth docutils literal notranslate"><span class="pre">Member.unban()</span></code></a></p></td>
</tr>
<tr class="row-even"><td><p><code class="docutils literal notranslate"><span class="pre">Client.unpin_message</span></code></p></td>
<td><p><a class="reference internal" href="api.html#discord.Message.unpin" title="discord.Message.unpin"><code class="xref py py-meth docutils literal notranslate"><span class="pre">Message.unpin()</span></code></a></p></td>
</tr>
<tr class="row-odd"><td><p><code class="docutils literal notranslate"><span class="pre">Client.wait_for_message</span></code></p></td>
<td><p><a class="reference internal" href="api.html#discord.Client.wait_for" title="discord.Client.wait_for"><code class="xref py py-meth docutils literal notranslate"><span class="pre">Client.wait_for()</span></code></a> (<a class="reference internal" href="#migrating-1-0-wait-for"><span class="std std-ref">Waiting For Events</span></a> 를 참고해주세요)</p></td>
</tr>
<tr class="row-even"><td><p><code class="docutils literal notranslate"><span class="pre">Client.wait_for_reaction</span></code></p></td>
<td><p><a class="reference internal" href="api.html#discord.Client.wait_for" title="discord.Client.wait_for"><code class="xref py py-meth docutils literal notranslate"><span class="pre">Client.wait_for()</span></code></a> (<a class="reference internal" href="#migrating-1-0-wait-for"><span class="std std-ref">Waiting For Events</span></a> 를 참고해주세요)</p></td>
</tr>
<tr class="row-odd"><td><p><code class="docutils literal notranslate"><span class="pre">Client.wait_until_login</span></code></p></td>
<td><p>제거됨</p></td>
</tr>
<tr class="row-even"><td><p><code class="docutils literal notranslate"><span class="pre">Client.wait_until_ready</span></code></p></td>
<td><p>변화 없음</p></td>
</tr>
</tbody>
</table>
</div></section>
<section id="property-changes">
<h3>속성 변화<a class="headerlink" href="#property-changes" title="제목 주소">¶</a></h3>
<p>좀 더 일관되게 하려고, 속성으로 제공되던 특정 요소들은 메소드로 교체되었습니다.</p>
<p>다음과 같은 것들은 이제 속성이 아닌 메소드로 제공됩니다.</p>
<ul class="simple">
<li><p><a class="reference internal" href="api.html#discord.Role.is_default" title="discord.Role.is_default"><code class="xref py py-meth docutils literal notranslate"><span class="pre">Role.is_default()</span></code></a></p></li>
<li><p><a class="reference internal" href="api.html#discord.Client.is_ready" title="discord.Client.is_ready"><code class="xref py py-meth docutils literal notranslate"><span class="pre">Client.is_ready()</span></code></a></p></li>
<li><p><a class="reference internal" href="api.html#discord.Client.is_closed" title="discord.Client.is_closed"><code class="xref py py-meth docutils literal notranslate"><span class="pre">Client.is_closed()</span></code></a></p></li>
</ul>
</section>
<section id="dict-value-change">
<h3>딕셔너리 값 변화<a class="headerlink" href="#dict-value-change" title="제목 주소">¶</a></h3>
<p>1.0 이전 버전에 모델들을 반환하던 총합 속성들은》딕셔너리 뷰》 객체를 반환하곤 했습니다.</p>
<p>그 결과, 딕셔너리가 당신이 그것을 반복하는 동안 크기를 바꾸면, 런타임에러가 발생해 작업을 충돌시킵니다. 이것을완화하기 위해, 《딕셔너리 뷰》 객체들은 리스트로 변경되었습니다.</p>
<p>The following views were changed to a list:</p>
<ul class="simple">
<li><p><a class="reference internal" href="api.html#discord.Client.guilds" title="discord.Client.guilds"><code class="xref py py-attr docutils literal notranslate"><span class="pre">Client.guilds</span></code></a></p></li>
<li><p><a class="reference internal" href="api.html#discord.Client.users" title="discord.Client.users"><code class="xref py py-attr docutils literal notranslate"><span class="pre">Client.users</span></code></a> (new in v1.0)</p></li>
<li><p><a class="reference internal" href="api.html#discord.Client.emojis" title="discord.Client.emojis"><code class="xref py py-attr docutils literal notranslate"><span class="pre">Client.emojis</span></code></a> (new in v1.0)</p></li>
<li><p><a class="reference internal" href="api.html#discord.Guild.channels" title="discord.Guild.channels"><code class="xref py py-attr docutils literal notranslate"><span class="pre">Guild.channels</span></code></a></p></li>
<li><p><a class="reference internal" href="api.html#discord.Guild.text_channels" title="discord.Guild.text_channels"><code class="xref py py-attr docutils literal notranslate"><span class="pre">Guild.text_channels</span></code></a> (1.0버전에 새로 추가됨)</p></li>
<li><p><a class="reference internal" href="api.html#discord.Guild.voice_channels" title="discord.Guild.voice_channels"><code class="xref py py-attr docutils literal notranslate"><span class="pre">Guild.voice_channels</span></code></a> (1.0버전에 새로 추가됨)</p></li>
<li><p><a class="reference internal" href="api.html#discord.Guild.emojis" title="discord.Guild.emojis"><code class="xref py py-attr docutils literal notranslate"><span class="pre">Guild.emojis</span></code></a></p></li>
<li><p><a class="reference internal" href="api.html#discord.Guild.members" title="discord.Guild.members"><code class="xref py py-attr docutils literal notranslate"><span class="pre">Guild.members</span></code></a></p></li>
</ul>
</section>
<section id="voice-state-changes">
<h3>Voice State Changes<a class="headerlink" href="#voice-state-changes" title="제목 주소">¶</a></h3>
<p>이전에, 0.11.0버전에서 <a class="reference internal" href="api.html#discord.VoiceState" title="discord.VoiceState"><code class="xref py py-class docutils literal notranslate"><span class="pre">VoiceState</span></code></a> 클래스는 <a class="reference internal" href="api.html#discord.Member.voice" title="discord.Member.voice"><code class="xref py py-attr docutils literal notranslate"><span class="pre">Member.voice</span></code></a> 속성과 함께 음성 상태들을 참조하기 위해 추가되었습니다.</p>
<p>그러나, 이것은 사용자에게 잘 드러나지 않았습니다. 라이브러리가 메모리를 절약하도록 하기 위해, 음성 상태의 변화는 이제 더 가시적입니다.</p>
<p>The only way to access voice attributes is via the <a class="reference internal" href="api.html#discord.Member.voice" title="discord.Member.voice"><code class="xref py py-attr docutils literal notranslate"><span class="pre">Member.voice</span></code></a> attribute. Note that if
the member does not have a voice state this attribute can be <code class="docutils literal notranslate"><span class="pre">None</span></code>.</p>
<p>간단한 예제입니다:</p>
<div class="highlight-default notranslate"><div class="highlight"><pre><span></span><span class="c1"># before</span>
<span class="n">member</span><span class="o">.</span><span class="n">deaf</span>
<span class="n">member</span><span class="o">.</span><span class="n">voice</span><span class="o">.</span><span class="n">voice_channel</span>
<span class="c1"># after</span>
<span class="k">if</span> <span class="n">member</span><span class="o">.</span><span class="n">voice</span><span class="p">:</span> <span class="c1"># can be None</span>
<span class="n">member</span><span class="o">.</span><span class="n">voice</span><span class="o">.</span><span class="n">deaf</span>
<span class="n">member</span><span class="o">.</span><span class="n">voice</span><span class="o">.</span><span class="n">channel</span>
</pre></div>
</div>
</section>
<section id="user-and-member-type-split">
<h3>User and Member Type Split<a class="headerlink" href="#user-and-member-type-split" title="제목 주소">¶</a></h3>
<p>In v1.0 to save memory, <a class="reference internal" href="api.html#discord.User" title="discord.User"><code class="xref py py-class docutils literal notranslate"><span class="pre">User</span></code></a> and <a class="reference internal" href="api.html#discord.Member" title="discord.Member"><code class="xref py py-class docutils literal notranslate"><span class="pre">Member</span></code></a> are no longer inherited. Instead, they are 《flattened》
by having equivalent properties that map out to the functional underlying <a class="reference internal" href="api.html#discord.User" title="discord.User"><code class="xref py py-class docutils literal notranslate"><span class="pre">User</span></code></a>. Thus, there is no functional
change in how they are used. However this breaks <a class="reference external" href="https://docs.python.org/ko/3/library/functions.html#isinstance" title="(in Python v3.9)"><code class="xref py py-func docutils literal notranslate"><span class="pre">isinstance()</span></code></a> checks and thus is something to keep in mind.</p>
<p>These memory savings were accomplished by having a global <a class="reference internal" href="api.html#discord.User" title="discord.User"><code class="xref py py-class docutils literal notranslate"><span class="pre">User</span></code></a> cache, and as a positive consequence you
can now easily fetch a <a class="reference internal" href="api.html#discord.User" title="discord.User"><code class="xref py py-class docutils literal notranslate"><span class="pre">User</span></code></a> by their ID by using the new <a class="reference internal" href="api.html#discord.Client.get_user" title="discord.Client.get_user"><code class="xref py py-meth docutils literal notranslate"><span class="pre">Client.get_user()</span></code></a>. You can also get a list
of all <a class="reference internal" href="api.html#discord.User" title="discord.User"><code class="xref py py-class docutils literal notranslate"><span class="pre">User</span></code></a> your client can see with <a class="reference internal" href="api.html#discord.Client.users" title="discord.Client.users"><code class="xref py py-attr docutils literal notranslate"><span class="pre">Client.users</span></code></a>.</p>
</section>
<section id="channel-type-split">
<span id="migrating-1-0-channel-split"></span><h3>Channel Type Split<a class="headerlink" href="#channel-type-split" title="제목 주소">¶</a></h3>
<p>Prior to v1.0, channels were two different types, <code class="docutils literal notranslate"><span class="pre">Channel</span></code> and <code class="docutils literal notranslate"><span class="pre">PrivateChannel</span></code> with a <code class="docutils literal notranslate"><span class="pre">is_private</span></code>
property to help differentiate between them.</p>
<p>In order to save memory the channels have been split into 4 different types:</p>
<ul class="simple">
<li><p><a class="reference internal" href="api.html#discord.TextChannel" title="discord.TextChannel"><code class="xref py py-class docutils literal notranslate"><span class="pre">TextChannel</span></code></a> for guild text channels.</p></li>
<li><p><a class="reference internal" href="api.html#discord.VoiceChannel" title="discord.VoiceChannel"><code class="xref py py-class docutils literal notranslate"><span class="pre">VoiceChannel</span></code></a> for guild voice channels.</p></li>
<li><p><a class="reference internal" href="api.html#discord.DMChannel" title="discord.DMChannel"><code class="xref py py-class docutils literal notranslate"><span class="pre">DMChannel</span></code></a> for DM channels with members.</p></li>
<li><p><a class="reference internal" href="api.html#discord.GroupChannel" title="discord.GroupChannel"><code class="xref py py-class docutils literal notranslate"><span class="pre">GroupChannel</span></code></a> for Group DM channels with members.</p></li>
</ul>
<p>With this split came the removal of the <code class="docutils literal notranslate"><span class="pre">is_private</span></code> attribute. You should now use <a class="reference external" href="https://docs.python.org/ko/3/library/functions.html#isinstance" title="(in Python v3.9)"><code class="xref py py-func docutils literal notranslate"><span class="pre">isinstance()</span></code></a>.</p>
<p>The types are split into two different <a class="reference internal" href="api.html#discord-api-abcs"><span class="std std-ref">Abstract Base Classes</span></a>:</p>
<ul class="simple">
<li><p><a class="reference internal" href="api.html#discord.abc.GuildChannel" title="discord.abc.GuildChannel"><code class="xref py py-class docutils literal notranslate"><span class="pre">abc.GuildChannel</span></code></a> for guild channels.</p></li>
<li><p><a class="reference internal" href="api.html#discord.abc.PrivateChannel" title="discord.abc.PrivateChannel"><code class="xref py py-class docutils literal notranslate"><span class="pre">abc.PrivateChannel</span></code></a> for private channels (DMs and group DMs).</p></li>
</ul>
<p>So to check if something is a guild channel you would do:</p>
<div class="highlight-default notranslate"><div class="highlight"><pre><span></span><span class="nb">isinstance</span><span class="p">(</span><span class="n">channel</span><span class="p">,</span> <span class="n">discord</span><span class="o">.</span><span class="n">abc</span><span class="o">.</span><span class="n">GuildChannel</span><span class="p">)</span>
</pre></div>
</div>
<p>And to check if it’s a private channel you would do:</p>
<div class="highlight-default notranslate"><div class="highlight"><pre><span></span><span class="nb">isinstance</span><span class="p">(</span><span class="n">channel</span><span class="p">,</span> <span class="n">discord</span><span class="o">.</span><span class="n">abc</span><span class="o">.</span><span class="n">PrivateChannel</span><span class="p">)</span>
</pre></div>
</div>
<p>Of course, if you’re looking for only a specific type you can pass that too, e.g.</p>
<div class="highlight-default notranslate"><div class="highlight"><pre><span></span><span class="nb">isinstance</span><span class="p">(</span><span class="n">channel</span><span class="p">,</span> <span class="n">discord</span><span class="o">.</span><span class="n">TextChannel</span><span class="p">)</span>
</pre></div>
</div>
<p>With this type split also came event changes, which are enumerated in <a class="reference internal" href="#migrating-1-0-event-changes"><span class="std std-ref">Event Changes</span></a>.</p>
</section>
<section id="miscellaneous-model-changes">
<h3>Miscellaneous Model Changes<a class="headerlink" href="#miscellaneous-model-changes" title="제목 주소">¶</a></h3>
<p>There were lots of other things added or removed in the models in general.</p>
<p>They will be enumerated here.</p>
<p><strong>Removed</strong></p>
<ul>
<li><p><a class="reference internal" href="api.html#discord.Client.login" title="discord.Client.login"><code class="xref py py-meth docutils literal notranslate"><span class="pre">Client.login()</span></code></a> no longer accepts email and password logins.</p>
<blockquote>
<div><ul class="simple">
<li><p>Use a token and <code class="docutils literal notranslate"><span class="pre">bot=False</span></code>.</p></li>
</ul>
</div></blockquote>
</li>
<li><p><code class="docutils literal notranslate"><span class="pre">Client.get_all_emojis</span></code></p>
<blockquote>
<div><ul class="simple">
<li><p>Use <a class="reference internal" href="api.html#discord.Client.emojis" title="discord.Client.emojis"><code class="xref py py-attr docutils literal notranslate"><span class="pre">Client.emojis</span></code></a> instead.</p></li>
</ul>
</div></blockquote>
</li>
<li><p><code class="docutils literal notranslate"><span class="pre">Client.messages</span></code></p>
<blockquote>
<div><ul class="simple">
<li><p>Use read-only <a class="reference internal" href="api.html#discord.Client.cached_messages" title="discord.Client.cached_messages"><code class="xref py py-attr docutils literal notranslate"><span class="pre">Client.cached_messages</span></code></a> instead.</p></li>
</ul>
</div></blockquote>
</li>
<li><p><code class="docutils literal notranslate"><span class="pre">Client.wait_for_message</span></code> and <code class="docutils literal notranslate"><span class="pre">Client.wait_for_reaction</span></code> are gone.</p>
<blockquote>
<div><ul class="simple">
<li><p>Use <a class="reference internal" href="api.html#discord.Client.wait_for" title="discord.Client.wait_for"><code class="xref py py-meth docutils literal notranslate"><span class="pre">Client.wait_for()</span></code></a> instead.</p></li>
</ul>
</div></blockquote>
</li>
<li><p><code class="docutils literal notranslate"><span class="pre">Channel.voice_members</span></code></p>
<blockquote>
<div><ul class="simple">
<li><p>Use <a class="reference internal" href="api.html#discord.VoiceChannel.members" title="discord.VoiceChannel.members"><code class="xref py py-attr docutils literal notranslate"><span class="pre">VoiceChannel.members</span></code></a> instead.</p></li>
</ul>
</div></blockquote>
</li>
<li><p><code class="docutils literal notranslate"><span class="pre">Channel.is_private</span></code></p>
<blockquote>
<div><ul class="simple">
<li><p>Use <code class="docutils literal notranslate"><span class="pre">isinstance</span></code> instead with one of the <a class="reference internal" href="api.html#discord-api-abcs"><span class="std std-ref">Abstract Base Classes</span></a> instead.</p></li>
<li><p>e.g. <code class="docutils literal notranslate"><span class="pre">isinstance(channel,</span> <span class="pre">discord.abc.GuildChannel)</span></code> will check if it isn’t a private channel.</p></li>
</ul>
</div></blockquote>
</li>
<li><p><code class="docutils literal notranslate"><span class="pre">Client.accept_invite</span></code></p>
<blockquote>
<div><ul class="simple">
<li><p>There is no replacement for this one. This functionality is deprecated API wise.</p></li>
</ul>
</div></blockquote>
</li>
<li><p><code class="docutils literal notranslate"><span class="pre">Guild.default_channel</span></code> / <code class="docutils literal notranslate"><span class="pre">Server.default_channel</span></code> and <code class="docutils literal notranslate"><span class="pre">Channel.is_default</span></code></p>
<blockquote>
<div><ul class="simple">
<li><p>The concept of a default channel was removed from Discord.
See <a class="reference external" href="https://github.com/hammerandchisel/discord-api-docs/pull/329">#329</a>.</p></li>
</ul>
</div></blockquote>
</li>
<li><p><code class="docutils literal notranslate"><span class="pre">Message.edited_timestamp</span></code></p>
<blockquote>
<div><ul class="simple">
<li><p>Use <a class="reference internal" href="api.html#discord.Message.edited_at" title="discord.Message.edited_at"><code class="xref py py-attr docutils literal notranslate"><span class="pre">Message.edited_at</span></code></a> instead.</p></li>
</ul>
</div></blockquote>
</li>
<li><p><code class="docutils literal notranslate"><span class="pre">Message.timestamp</span></code></p>
<blockquote>
<div><ul class="simple">
<li><p>Use <a class="reference internal" href="api.html#discord.Message.created_at" title="discord.Message.created_at"><code class="xref py py-attr docutils literal notranslate"><span class="pre">Message.created_at</span></code></a> instead.</p></li>
</ul>
</div></blockquote>
</li>
<li><p><code class="docutils literal notranslate"><span class="pre">Colour.to_tuple()</span></code></p>
<blockquote>
<div><ul class="simple">
<li><p>Use <a class="reference internal" href="api.html#discord.Colour.to_rgb" title="discord.Colour.to_rgb"><code class="xref py py-meth docutils literal notranslate"><span class="pre">Colour.to_rgb()</span></code></a> instead.</p></li>
</ul>
</div></blockquote>
</li>
<li><p><code class="docutils literal notranslate"><span class="pre">Permissions.view_audit_logs</span></code></p>
<blockquote>
<div><ul class="simple">
<li><p>Use <a class="reference internal" href="api.html#discord.Permissions.view_audit_log" title="discord.Permissions.view_audit_log"><code class="xref py py-attr docutils literal notranslate"><span class="pre">Permissions.view_audit_log</span></code></a> instead.</p></li>
</ul>
</div></blockquote>
</li>
<li><p><code class="docutils literal notranslate"><span class="pre">Member.game</span></code></p>
<blockquote>
<div><ul class="simple">
<li><p>Use <a class="reference internal" href="api.html#discord.Member.activities" title="discord.Member.activities"><code class="xref py py-attr docutils literal notranslate"><span class="pre">Member.activities</span></code></a> instead.</p></li>
</ul>
</div></blockquote>
</li>
<li><p><code class="docutils literal notranslate"><span class="pre">Guild.role_hierarchy</span></code> / <code class="docutils literal notranslate"><span class="pre">Server.role_hierarchy</span></code></p>
<blockquote>
<div><ul class="simple">
<li><p>Use <a class="reference internal" href="api.html#discord.Guild.roles" title="discord.Guild.roles"><code class="xref py py-attr docutils literal notranslate"><span class="pre">Guild.roles</span></code></a> instead. Note that while sorted, it is in the opposite order
of what the old <code class="docutils literal notranslate"><span class="pre">Guild.role_hierarchy</span></code> used to be.</p></li>
</ul>
</div></blockquote>
</li>
</ul>
<p><strong>Changed</strong></p>
<ul class="simple">
<li><p><a class="reference internal" href="api.html#discord.Member.avatar_url" title="discord.Member.avatar_url"><code class="xref py py-attr docutils literal notranslate"><span class="pre">Member.avatar_url</span></code></a> and <a class="reference internal" href="api.html#discord.User.avatar_url" title="discord.User.avatar_url"><code class="xref py py-attr docutils literal notranslate"><span class="pre">User.avatar_url</span></code></a> now return the default avatar if a custom one is not set.</p></li>
<li><p><a class="reference internal" href="api.html#discord.Message.embeds" title="discord.Message.embeds"><code class="xref py py-attr docutils literal notranslate"><span class="pre">Message.embeds</span></code></a> is now a list of <a class="reference internal" href="api.html#discord.Embed" title="discord.Embed"><code class="xref py py-class docutils literal notranslate"><span class="pre">Embed</span></code></a> instead of <a class="reference external" href="https://docs.python.org/ko/3/library/stdtypes.html#dict" title="(in Python v3.9)"><code class="xref py py-class docutils literal notranslate"><span class="pre">dict</span></code></a> objects.</p></li>
<li><p><a class="reference internal" href="api.html#discord.Message.attachments" title="discord.Message.attachments"><code class="xref py py-attr docutils literal notranslate"><span class="pre">Message.attachments</span></code></a> is now a list of <a class="reference internal" href="api.html#discord.Attachment" title="discord.Attachment"><code class="xref py py-class docutils literal notranslate"><span class="pre">Attachment</span></code></a> instead of <a class="reference external" href="https://docs.python.org/ko/3/library/stdtypes.html#dict" title="(in Python v3.9)"><code class="xref py py-class docutils literal notranslate"><span class="pre">dict</span></code></a> object.</p></li>
<li><p><a class="reference internal" href="api.html#discord.Guild.roles" title="discord.Guild.roles"><code class="xref py py-attr docutils literal notranslate"><span class="pre">Guild.roles</span></code></a> is now sorted through hierarchy. The first element is always the <code class="docutils literal notranslate"><span class="pre">@everyone</span></code> role.</p></li>
</ul>
<p><strong>Added</strong></p>
<ul class="simple">
<li><p><a class="reference internal" href="api.html#discord.Attachment" title="discord.Attachment"><code class="xref py py-class docutils literal notranslate"><span class="pre">Attachment</span></code></a> to represent a discord attachment.</p></li>
<li><p><a class="reference internal" href="api.html#discord.CategoryChannel" title="discord.CategoryChannel"><code class="xref py py-class docutils literal notranslate"><span class="pre">CategoryChannel</span></code></a> to represent a channel category.</p></li>
<li><p><a class="reference internal" href="api.html#discord.VoiceChannel.members" title="discord.VoiceChannel.members"><code class="xref py py-attr docutils literal notranslate"><span class="pre">VoiceChannel.members</span></code></a> for fetching members connected to a voice channel.</p></li>
<li><p><a class="reference internal" href="api.html#discord.TextChannel.members" title="discord.TextChannel.members"><code class="xref py py-attr docutils literal notranslate"><span class="pre">TextChannel.members</span></code></a> for fetching members that can see the channel.</p></li>
<li><p><a class="reference internal" href="api.html#discord.Role.members" title="discord.Role.members"><code class="xref py py-attr docutils literal notranslate"><span class="pre">Role.members</span></code></a> for fetching members that have the role.</p></li>
<li><p><a class="reference internal" href="api.html#discord.Guild.text_channels" title="discord.Guild.text_channels"><code class="xref py py-attr docutils literal notranslate"><span class="pre">Guild.text_channels</span></code></a> for fetching text channels only.</p></li>
<li><p><a class="reference internal" href="api.html#discord.Guild.voice_channels" title="discord.Guild.voice_channels"><code class="xref py py-attr docutils literal notranslate"><span class="pre">Guild.voice_channels</span></code></a> for fetching voice channels only.</p></li>
<li><p><a class="reference internal" href="api.html#discord.Guild.categories" title="discord.Guild.categories"><code class="xref py py-attr docutils literal notranslate"><span class="pre">Guild.categories</span></code></a> for fetching channel categories only.</p></li>
<li><p><a class="reference internal" href="api.html#discord.TextChannel.category" title="discord.TextChannel.category"><code class="xref py py-attr docutils literal notranslate"><span class="pre">TextChannel.category</span></code></a> and <a class="reference internal" href="api.html#discord.VoiceChannel.category" title="discord.VoiceChannel.category"><code class="xref py py-attr docutils literal notranslate"><span class="pre">VoiceChannel.category</span></code></a> to get the category a channel belongs to.</p></li>
<li><p><a class="reference internal" href="api.html#discord.Guild.by_category" title="discord.Guild.by_category"><code class="xref py py-meth docutils literal notranslate"><span class="pre">Guild.by_category()</span></code></a> to get channels grouped by their category.</p></li>
<li><p><a class="reference internal" href="api.html#discord.Guild.chunked" title="discord.Guild.chunked"><code class="xref py py-attr docutils literal notranslate"><span class="pre">Guild.chunked</span></code></a> to check member chunking status.</p></li>
<li><p><a class="reference internal" href="api.html#discord.Guild.explicit_content_filter" title="discord.Guild.explicit_content_filter"><code class="xref py py-attr docutils literal notranslate"><span class="pre">Guild.explicit_content_filter</span></code></a> to fetch the content filter.</p></li>
<li><p><a class="reference internal" href="api.html#discord.Guild.shard_id" title="discord.Guild.shard_id"><code class="xref py py-attr docutils literal notranslate"><span class="pre">Guild.shard_id</span></code></a> to get a guild’s Shard ID if you’re sharding.</p></li>
<li><p><a class="reference internal" href="api.html#discord.Client.users" title="discord.Client.users"><code class="xref py py-attr docutils literal notranslate"><span class="pre">Client.users</span></code></a> to get all visible <a class="reference internal" href="api.html#discord.User" title="discord.User"><code class="xref py py-class docutils literal notranslate"><span class="pre">User</span></code></a> instances.</p></li>
<li><p><a class="reference internal" href="api.html#discord.Client.get_user" title="discord.Client.get_user"><code class="xref py py-meth docutils literal notranslate"><span class="pre">Client.get_user()</span></code></a> to get a <a class="reference internal" href="api.html#discord.User" title="discord.User"><code class="xref py py-class docutils literal notranslate"><span class="pre">User</span></code></a> by ID.</p></li>
<li><p><a class="reference internal" href="api.html#discord.User.avatar_url_as" title="discord.User.avatar_url_as"><code class="xref py py-meth docutils literal notranslate"><span class="pre">User.avatar_url_as()</span></code></a> to get an avatar in a specific size or format.</p></li>
<li><p><a class="reference internal" href="api.html#discord.Guild.vanity_invite" title="discord.Guild.vanity_invite"><code class="xref py py-meth docutils literal notranslate"><span class="pre">Guild.vanity_invite()</span></code></a> to fetch the guild’s vanity invite.</p></li>
<li><p><a class="reference internal" href="api.html#discord.Guild.audit_logs" title="discord.Guild.audit_logs"><code class="xref py py-meth docutils literal notranslate"><span class="pre">Guild.audit_logs()</span></code></a> to fetch the guild’s audit logs.</p></li>
<li><p><a class="reference internal" href="api.html#discord.Message.webhook_id" title="discord.Message.webhook_id"><code class="xref py py-attr docutils literal notranslate"><span class="pre">Message.webhook_id</span></code></a> to fetch the message’s webhook ID.</p></li>
<li><p><a class="reference internal" href="api.html#discord.Message.activity" title="discord.Message.activity"><code class="xref py py-attr docutils literal notranslate"><span class="pre">Message.activity</span></code></a> and <a class="reference internal" href="api.html#discord.Message.application" title="discord.Message.application"><code class="xref py py-attr docutils literal notranslate"><span class="pre">Message.application</span></code></a> for Rich Presence related information.</p></li>
<li><p><a class="reference internal" href="api.html#discord.TextChannel.is_nsfw" title="discord.TextChannel.is_nsfw"><code class="xref py py-meth docutils literal notranslate"><span class="pre">TextChannel.is_nsfw()</span></code></a> to check if a text channel is NSFW.</p></li>
<li><p><a class="reference internal" href="api.html#discord.Colour.from_rgb" title="discord.Colour.from_rgb"><code class="xref py py-meth docutils literal notranslate"><span class="pre">Colour.from_rgb()</span></code></a> to construct a <a class="reference internal" href="api.html#discord.Colour" title="discord.Colour"><code class="xref py py-class docutils literal notranslate"><span class="pre">Colour</span></code></a> from RGB tuple.</p></li>
<li><p><a class="reference internal" href="api.html#discord.Guild.get_role" title="discord.Guild.get_role"><code class="xref py py-meth docutils literal notranslate"><span class="pre">Guild.get_role()</span></code></a> to get a role by its ID.</p></li>
</ul>
</section>
</section>
<section id="sending-messages">
<span id="migrating-1-0-sending-messages"></span><h2>Sending Messages<a class="headerlink" href="#sending-messages" title="제목 주소">¶</a></h2>
<p>One of the changes that were done was the merger of the previous <code class="docutils literal notranslate"><span class="pre">Client.send_message</span></code> and <code class="docutils literal notranslate"><span class="pre">Client.send_file</span></code>
functionality into a single method, <a class="reference internal" href="api.html#discord.abc.Messageable.send" title="discord.abc.Messageable.send"><code class="xref py py-meth docutils literal notranslate"><span class="pre">send()</span></code></a>.</p>
<p>Basically:</p>
<div class="highlight-default notranslate"><div class="highlight"><pre><span></span><span class="c1"># before</span>
<span class="k">await</span> <span class="n">client</span><span class="o">.</span><span class="n">send_message</span><span class="p">(</span><span class="n">channel</span><span class="p">,</span> <span class="s1">'Hello'</span><span class="p">)</span>
<span class="c1"># after</span>
<span class="k">await</span> <span class="n">channel</span><span class="o">.</span><span class="n">send</span><span class="p">(</span><span class="s1">'Hello'</span><span class="p">)</span>
</pre></div>
</div>
<p>This supports everything that the old <code class="docutils literal notranslate"><span class="pre">send_message</span></code> supported such as embeds:</p>
<div class="highlight-default notranslate"><div class="highlight"><pre><span></span><span class="n">e</span> <span class="o">=</span> <span class="n">discord</span><span class="o">.</span><span class="n">Embed</span><span class="p">(</span><span class="n">title</span><span class="o">=</span><span class="s1">'foo'</span><span class="p">)</span>
<span class="k">await</span> <span class="n">channel</span><span class="o">.</span><span class="n">send</span><span class="p">(</span><span class="s1">'Hello'</span><span class="p">,</span> <span class="n">embed</span><span class="o">=</span><span class="n">e</span><span class="p">)</span>
</pre></div>
</div>
<p>There is a caveat with sending files however, as this functionality was expanded to support multiple
file attachments, you must now use a <a class="reference internal" href="api.html#discord.File" title="discord.File"><code class="xref py py-class docutils literal notranslate"><span class="pre">File</span></code></a> pseudo-namedtuple to upload a single file.</p>
<div class="highlight-default notranslate"><div class="highlight"><pre><span></span><span class="c1"># before</span>
<span class="k">await</span> <span class="n">client</span><span class="o">.</span><span class="n">send_file</span><span class="p">(</span><span class="n">channel</span><span class="p">,</span> <span class="s1">'cool.png'</span><span class="p">,</span> <span class="n">filename</span><span class="o">=</span><span class="s1">'testing.png'</span><span class="p">,</span> <span class="n">content</span><span class="o">=</span><span class="s1">'Hello'</span><span class="p">)</span>
<span class="c1"># after</span>
<span class="k">await</span> <span class="n">channel</span><span class="o">.</span><span class="n">send</span><span class="p">(</span><span class="s1">'Hello'</span><span class="p">,</span> <span class="n">file</span><span class="o">=</span><span class="n">discord</span><span class="o">.</span><span class="n">File</span><span class="p">(</span><span class="s1">'cool.png'</span><span class="p">,</span> <span class="s1">'testing.png'</span><span class="p">))</span>
</pre></div>
</div>
<p>This change was to facilitate multiple file uploads:</p>
<div class="highlight-default notranslate"><div class="highlight"><pre><span></span><span class="n">my_files</span> <span class="o">=</span> <span class="p">[</span>
<span class="n">discord</span><span class="o">.</span><span class="n">File</span><span class="p">(</span><span class="s1">'cool.png'</span><span class="p">,</span> <span class="s1">'testing.png'</span><span class="p">),</span>
<span class="n">discord</span><span class="o">.</span><span class="n">File</span><span class="p">(</span><span class="n">some_fp</span><span class="p">,</span> <span class="s1">'cool_filename.png'</span><span class="p">),</span>
<span class="p">]</span>
<span class="k">await</span> <span class="n">channel</span><span class="o">.</span><span class="n">send</span><span class="p">(</span><span class="s1">'Your images:'</span><span class="p">,</span> <span class="n">files</span><span class="o">=</span><span class="n">my_files</span><span class="p">)</span>
</pre></div>
</div>
</section>
<section id="asynchronous-iterators">
<span id="migrating-1-0-async-iter"></span><h2>Asynchronous Iterators<a class="headerlink" href="#asynchronous-iterators" title="제목 주소">¶</a></h2>
<p>Prior to v1.0, certain functions like <code class="docutils literal notranslate"><span class="pre">Client.logs_from</span></code> would return a different type if done in Python 3.4 or 3.5+.</p>
<p>In v1.0, this change has been reverted and will now return a singular type meeting an abstract concept called
<a class="reference internal" href="api.html#discord.AsyncIterator" title="discord.AsyncIterator"><code class="xref py py-class docutils literal notranslate"><span class="pre">AsyncIterator</span></code></a>.</p>
<p>This allows you to iterate over it like normal:</p>
<div class="highlight-default notranslate"><div class="highlight"><pre><span></span><span class="k">async</span> <span class="k">for</span> <span class="n">message</span> <span class="ow">in</span> <span class="n">channel</span><span class="o">.</span><span class="n">history</span><span class="p">():</span>
<span class="nb">print</span><span class="p">(</span><span class="n">message</span><span class="p">)</span>
</pre></div>
</div>
<p>Or turn it into a list:</p>
<div class="highlight-default notranslate"><div class="highlight"><pre><span></span><span class="n">messages</span> <span class="o">=</span> <span class="k">await</span> <span class="n">channel</span><span class="o">.</span><span class="n">history</span><span class="p">()</span><span class="o">.</span><span class="n">flatten</span><span class="p">()</span>
<span class="k">for</span> <span class="n">message</span> <span class="ow">in</span> <span class="n">messages</span><span class="p">:</span>
<span class="nb">print</span><span class="p">(</span><span class="n">message</span><span class="p">)</span>
</pre></div>
</div>
<p>A handy aspect of returning <a class="reference internal" href="api.html#discord.AsyncIterator" title="discord.AsyncIterator"><code class="xref py py-class docutils literal notranslate"><span class="pre">AsyncIterator</span></code></a> is that it allows you to chain functions together such as
<a class="reference internal" href="api.html#discord.AsyncIterator.map" title="discord.AsyncIterator.map"><code class="xref py py-meth docutils literal notranslate"><span class="pre">AsyncIterator.map()</span></code></a> or <a class="reference internal" href="api.html#discord.AsyncIterator.filter" title="discord.AsyncIterator.filter"><code class="xref py py-meth docutils literal notranslate"><span class="pre">AsyncIterator.filter()</span></code></a>:</p>
<div class="highlight-default notranslate"><div class="highlight"><pre><span></span><span class="k">async</span> <span class="k">for</span> <span class="n">m_id</span> <span class="ow">in</span> <span class="n">channel</span><span class="o">.</span><span class="n">history</span><span class="p">()</span><span class="o">.</span><span class="n">filter</span><span class="p">(</span><span class="k">lambda</span> <span class="n">m</span><span class="p">:</span> <span class="n">m</span><span class="o">.</span><span class="n">author</span> <span class="o">==</span> <span class="n">client</span><span class="o">.</span><span class="n">user</span><span class="p">)</span><span class="o">.</span><span class="n">map</span><span class="p">(</span><span class="k">lambda</span> <span class="n">m</span><span class="p">:</span> <span class="n">m</span><span class="o">.</span><span class="n">id</span><span class="p">):</span>
<span class="nb">print</span><span class="p">(</span><span class="n">m_id</span><span class="p">)</span>
</pre></div>
</div>
<p>The functions passed to <a class="reference internal" href="api.html#discord.AsyncIterator.map" title="discord.AsyncIterator.map"><code class="xref py py-meth docutils literal notranslate"><span class="pre">AsyncIterator.map()</span></code></a> or <a class="reference internal" href="api.html#discord.AsyncIterator.filter" title="discord.AsyncIterator.filter"><code class="xref py py-meth docutils literal notranslate"><span class="pre">AsyncIterator.filter()</span></code></a> can be either coroutines or regular
functions.</p>
<p>You can also get single elements a la <a class="reference internal" href="api.html#discord.utils.find" title="discord.utils.find"><code class="xref py py-func docutils literal notranslate"><span class="pre">discord.utils.find()</span></code></a> or <a class="reference internal" href="api.html#discord.utils.get" title="discord.utils.get"><code class="xref py py-func docutils literal notranslate"><span class="pre">discord.utils.get()</span></code></a> via
<a class="reference internal" href="api.html#discord.AsyncIterator.get" title="discord.AsyncIterator.get"><code class="xref py py-meth docutils literal notranslate"><span class="pre">AsyncIterator.get()</span></code></a> or <a class="reference internal" href="api.html#discord.AsyncIterator.find" title="discord.AsyncIterator.find"><code class="xref py py-meth docutils literal notranslate"><span class="pre">AsyncIterator.find()</span></code></a>:</p>
<div class="highlight-default notranslate"><div class="highlight"><pre><span></span><span class="n">my_last_message</span> <span class="o">=</span> <span class="k">await</span> <span class="n">channel</span><span class="o">.</span><span class="n">history</span><span class="p">()</span><span class="o">.</span><span class="n">get</span><span class="p">(</span><span class="n">author</span><span class="o">=</span><span class="n">client</span><span class="o">.</span><span class="n">user</span><span class="p">)</span>
</pre></div>
</div>
<p>The following return <a class="reference internal" href="api.html#discord.AsyncIterator" title="discord.AsyncIterator"><code class="xref py py-class docutils literal notranslate"><span class="pre">AsyncIterator</span></code></a>:</p>
<ul class="simple">
<li><p><a class="reference internal" href="api.html#discord.abc.Messageable.history" title="discord.abc.Messageable.history"><code class="xref py py-meth docutils literal notranslate"><span class="pre">abc.Messageable.history()</span></code></a></p></li>
<li><p><a class="reference internal" href="api.html#discord.Guild.audit_logs" title="discord.Guild.audit_logs"><code class="xref py py-meth docutils literal notranslate"><span class="pre">Guild.audit_logs()</span></code></a></p></li>
<li><p><a class="reference internal" href="api.html#discord.Reaction.users" title="discord.Reaction.users"><code class="xref py py-meth docutils literal notranslate"><span class="pre">Reaction.users()</span></code></a></p></li>
</ul>
</section>
<section id="event-changes">
<span id="migrating-1-0-event-changes"></span><h2>Event Changes<a class="headerlink" href="#event-changes" title="제목 주소">¶</a></h2>
<p>A lot of events have gone through some changes.</p>
<p>Many events with <code class="docutils literal notranslate"><span class="pre">server</span></code> in the name were changed to use <code class="docutils literal notranslate"><span class="pre">guild</span></code> instead.</p>
<p>Before:</p>
<ul class="simple">
<li><p><code class="docutils literal notranslate"><span class="pre">on_server_join</span></code></p></li>
<li><p><code class="docutils literal notranslate"><span class="pre">on_server_remove</span></code></p></li>
<li><p><code class="docutils literal notranslate"><span class="pre">on_server_update</span></code></p></li>
<li><p><code class="docutils literal notranslate"><span class="pre">on_server_role_create</span></code></p></li>
<li><p><code class="docutils literal notranslate"><span class="pre">on_server_role_delete</span></code></p></li>
<li><p><code class="docutils literal notranslate"><span class="pre">on_server_role_update</span></code></p></li>
<li><p><code class="docutils literal notranslate"><span class="pre">on_server_emojis_update</span></code></p></li>
<li><p><code class="docutils literal notranslate"><span class="pre">on_server_available</span></code></p></li>
<li><p><code class="docutils literal notranslate"><span class="pre">on_server_unavailable</span></code></p></li>
</ul>
<p>After:</p>
<ul class="simple">
<li><p><a class="reference internal" href="api.html#discord.on_guild_join" title="discord.on_guild_join"><code class="xref py py-func docutils literal notranslate"><span class="pre">on_guild_join()</span></code></a></p></li>
<li><p><a class="reference internal" href="api.html#discord.on_guild_remove" title="discord.on_guild_remove"><code class="xref py py-func docutils literal notranslate"><span class="pre">on_guild_remove()</span></code></a></p></li>
<li><p><a class="reference internal" href="api.html#discord.on_guild_update" title="discord.on_guild_update"><code class="xref py py-func docutils literal notranslate"><span class="pre">on_guild_update()</span></code></a></p></li>
<li><p><a class="reference internal" href="api.html#discord.on_guild_role_create" title="discord.on_guild_role_create"><code class="xref py py-func docutils literal notranslate"><span class="pre">on_guild_role_create()</span></code></a></p></li>
<li><p><a class="reference internal" href="api.html#discord.on_guild_role_delete" title="discord.on_guild_role_delete"><code class="xref py py-func docutils literal notranslate"><span class="pre">on_guild_role_delete()</span></code></a></p></li>
<li><p><a class="reference internal" href="api.html#discord.on_guild_role_update" title="discord.on_guild_role_update"><code class="xref py py-func docutils literal notranslate"><span class="pre">on_guild_role_update()</span></code></a></p></li>
<li><p><a class="reference internal" href="api.html#discord.on_guild_emojis_update" title="discord.on_guild_emojis_update"><code class="xref py py-func docutils literal notranslate"><span class="pre">on_guild_emojis_update()</span></code></a></p></li>
<li><p><a class="reference internal" href="api.html#discord.on_guild_available" title="discord.on_guild_available"><code class="xref py py-func docutils literal notranslate"><span class="pre">on_guild_available()</span></code></a></p></li>
<li><p><a class="reference internal" href="api.html#discord.on_guild_unavailable" title="discord.on_guild_unavailable"><code class="xref py py-func docutils literal notranslate"><span class="pre">on_guild_unavailable()</span></code></a></p></li>
</ul>
<p>The <a class="reference internal" href="api.html#discord.on_voice_state_update" title="discord.on_voice_state_update"><code class="xref py py-func docutils literal notranslate"><span class="pre">on_voice_state_update()</span></code></a> event has received an argument change.</p>
<p>Before:</p>
<div class="highlight-default notranslate"><div class="highlight"><pre><span></span><span class="k">async</span> <span class="k">def</span> <span class="nf">on_voice_state_update</span><span class="p">(</span><span class="n">before</span><span class="p">,</span> <span class="n">after</span><span class="p">)</span>
</pre></div>
</div>
<p>After:</p>
<div class="highlight-default notranslate"><div class="highlight"><pre><span></span><span class="k">async</span> <span class="k">def</span> <span class="nf">on_voice_state_update</span><span class="p">(</span><span class="n">member</span><span class="p">,</span> <span class="n">before</span><span class="p">,</span> <span class="n">after</span><span class="p">)</span>
</pre></div>
</div>
<p>Instead of two <a class="reference internal" href="api.html#discord.Member" title="discord.Member"><code class="xref py py-class docutils literal notranslate"><span class="pre">Member</span></code></a> objects, the new event takes one <a class="reference internal" href="api.html#discord.Member" title="discord.Member"><code class="xref py py-class docutils literal notranslate"><span class="pre">Member</span></code></a> object and two <a class="reference internal" href="api.html#discord.VoiceState" title="discord.VoiceState"><code class="xref py py-class docutils literal notranslate"><span class="pre">VoiceState</span></code></a> objects.</p>
<p>The <a class="reference internal" href="api.html#discord.on_guild_emojis_update" title="discord.on_guild_emojis_update"><code class="xref py py-func docutils literal notranslate"><span class="pre">on_guild_emojis_update()</span></code></a> event has received an argument change.</p>
<p>Before:</p>
<div class="highlight-default notranslate"><div class="highlight"><pre><span></span><span class="k">async</span> <span class="k">def</span> <span class="nf">on_guild_emojis_update</span><span class="p">(</span><span class="n">before</span><span class="p">,</span> <span class="n">after</span><span class="p">)</span>
</pre></div>
</div>
<p>After:</p>
<div class="highlight-default notranslate"><div class="highlight"><pre><span></span><span class="k">async</span> <span class="k">def</span> <span class="nf">on_guild_emojis_update</span><span class="p">(</span><span class="n">guild</span><span class="p">,</span> <span class="n">before</span><span class="p">,</span> <span class="n">after</span><span class="p">)</span>
</pre></div>
</div>
<p>The first argument is now the <a class="reference internal" href="api.html#discord.Guild" title="discord.Guild"><code class="xref py py-class docutils literal notranslate"><span class="pre">Guild</span></code></a> that the emojis were updated from.</p>
<p>The <a class="reference internal" href="api.html#discord.on_member_ban" title="discord.on_member_ban"><code class="xref py py-func docutils literal notranslate"><span class="pre">on_member_ban()</span></code></a> event has received an argument change as well:</p>
<p>Before:</p>
<div class="highlight-default notranslate"><div class="highlight"><pre><span></span><span class="k">async</span> <span class="k">def</span> <span class="nf">on_member_ban</span><span class="p">(</span><span class="n">member</span><span class="p">)</span>
</pre></div>
</div>
<p>After:</p>
<div class="highlight-default notranslate"><div class="highlight"><pre><span></span><span class="k">async</span> <span class="k">def</span> <span class="nf">on_member_ban</span><span class="p">(</span><span class="n">guild</span><span class="p">,</span> <span class="n">user</span><span class="p">)</span>
</pre></div>
</div>
<p>As part of the change, the event can either receive a <a class="reference internal" href="api.html#discord.User" title="discord.User"><code class="xref py py-class docutils literal notranslate"><span class="pre">User</span></code></a> or <a class="reference internal" href="api.html#discord.Member" title="discord.Member"><code class="xref py py-class docutils literal notranslate"><span class="pre">Member</span></code></a>. To help in the cases that have
<a class="reference internal" href="api.html#discord.User" title="discord.User"><code class="xref py py-class docutils literal notranslate"><span class="pre">User</span></code></a>, the <a class="reference internal" href="api.html#discord.Guild" title="discord.Guild"><code class="xref py py-class docutils literal notranslate"><span class="pre">Guild</span></code></a> is provided as the first parameter.</p>
<p>The <code class="docutils literal notranslate"><span class="pre">on_channel_</span></code> events have received a type level split (see <a class="reference internal" href="#migrating-1-0-channel-split"><span class="std std-ref">Channel Type Split</span></a>).</p>
<p>Before:</p>
<ul class="simple">
<li><p><code class="docutils literal notranslate"><span class="pre">on_channel_delete</span></code></p></li>
<li><p><code class="docutils literal notranslate"><span class="pre">on_channel_create</span></code></p></li>
<li><p><code class="docutils literal notranslate"><span class="pre">on_channel_update</span></code></p></li>
</ul>
<p>After:</p>
<ul class="simple">
<li><p><a class="reference internal" href="api.html#discord.on_guild_channel_delete" title="discord.on_guild_channel_delete"><code class="xref py py-func docutils literal notranslate"><span class="pre">on_guild_channel_delete()</span></code></a></p></li>
<li><p><a class="reference internal" href="api.html#discord.on_guild_channel_create" title="discord.on_guild_channel_create"><code class="xref py py-func docutils literal notranslate"><span class="pre">on_guild_channel_create()</span></code></a></p></li>
<li><p><a class="reference internal" href="api.html#discord.on_guild_channel_update" title="discord.on_guild_channel_update"><code class="xref py py-func docutils literal notranslate"><span class="pre">on_guild_channel_update()</span></code></a></p></li>
<li><p><a class="reference internal" href="api.html#discord.on_private_channel_delete" title="discord.on_private_channel_delete"><code class="xref py py-func docutils literal notranslate"><span class="pre">on_private_channel_delete()</span></code></a></p></li>
<li><p><a class="reference internal" href="api.html#discord.on_private_channel_create" title="discord.on_private_channel_create"><code class="xref py py-func docutils literal notranslate"><span class="pre">on_private_channel_create()</span></code></a></p></li>
<li><p><a class="reference internal" href="api.html#discord.on_private_channel_update" title="discord.on_private_channel_update"><code class="xref py py-func docutils literal notranslate"><span class="pre">on_private_channel_update()</span></code></a></p></li>
</ul>
<p>The <code class="docutils literal notranslate"><span class="pre">on_guild_channel_</span></code> events correspond to <a class="reference internal" href="api.html#discord.abc.GuildChannel" title="discord.abc.GuildChannel"><code class="xref py py-class docutils literal notranslate"><span class="pre">abc.GuildChannel</span></code></a> being updated (i.e. <a class="reference internal" href="api.html#discord.TextChannel" title="discord.TextChannel"><code class="xref py py-class docutils literal notranslate"><span class="pre">TextChannel</span></code></a>
and <a class="reference internal" href="api.html#discord.VoiceChannel" title="discord.VoiceChannel"><code class="xref py py-class docutils literal notranslate"><span class="pre">VoiceChannel</span></code></a>) and the <code class="docutils literal notranslate"><span class="pre">on_private_channel_</span></code> events correspond to <a class="reference internal" href="api.html#discord.abc.PrivateChannel" title="discord.abc.PrivateChannel"><code class="xref py py-class docutils literal notranslate"><span class="pre">abc.PrivateChannel</span></code></a> being
updated (i.e. <a class="reference internal" href="api.html#discord.DMChannel" title="discord.DMChannel"><code class="xref py py-class docutils literal notranslate"><span class="pre">DMChannel</span></code></a> and <a class="reference internal" href="api.html#discord.GroupChannel" title="discord.GroupChannel"><code class="xref py py-class docutils literal notranslate"><span class="pre">GroupChannel</span></code></a>).</p>
</section>
<section id="voice-changes">
<span id="migrating-1-0-voice"></span><h2>Voice Changes<a class="headerlink" href="#voice-changes" title="제목 주소">¶</a></h2>
<p>Voice sending has gone through a complete redesign.</p>
<p>In particular:</p>
<ul class="simple">
<li><p>Connection is done through <a class="reference internal" href="api.html#discord.VoiceChannel.connect" title="discord.VoiceChannel.connect"><code class="xref py py-meth docutils literal notranslate"><span class="pre">VoiceChannel.connect()</span></code></a> instead of <code class="docutils literal notranslate"><span class="pre">Client.join_voice_channel</span></code>.</p></li>
<li><p>You no longer create players and operate on them (you no longer store them).</p></li>
<li><p>You instead request <a class="reference internal" href="api.html#discord.VoiceClient" title="discord.VoiceClient"><code class="xref py py-class docutils literal notranslate"><span class="pre">VoiceClient</span></code></a> to play an <a class="reference internal" href="api.html#discord.AudioSource" title="discord.AudioSource"><code class="xref py py-class docutils literal notranslate"><span class="pre">AudioSource</span></code></a> via <a class="reference internal" href="api.html#discord.VoiceClient.play" title="discord.VoiceClient.play"><code class="xref py py-meth docutils literal notranslate"><span class="pre">VoiceClient.play()</span></code></a>.</p></li>
<li><p>There are different built-in <a class="reference internal" href="api.html#discord.AudioSource" title="discord.AudioSource"><code class="xref py py-class docutils literal notranslate"><span class="pre">AudioSource</span></code></a>s.</p>
<ul>
<li><p><a class="reference internal" href="api.html#discord.FFmpegPCMAudio" title="discord.FFmpegPCMAudio"><code class="xref py py-class docutils literal notranslate"><span class="pre">FFmpegPCMAudio</span></code></a> is the equivalent of <code class="docutils literal notranslate"><span class="pre">create_ffmpeg_player</span></code></p></li>
</ul>
</li>
<li><p>create_ffmpeg_player/create_stream_player/create_ytdl_player have all been removed.</p>
<ul>
<li><p>The goal is to create <a class="reference internal" href="api.html#discord.AudioSource" title="discord.AudioSource"><code class="xref py py-class docutils literal notranslate"><span class="pre">AudioSource</span></code></a> instead.</p></li>
</ul>
</li>
<li><p>Using <a class="reference internal" href="api.html#discord.VoiceClient.play" title="discord.VoiceClient.play"><code class="xref py py-meth docutils literal notranslate"><span class="pre">VoiceClient.play()</span></code></a> will not return an <code class="docutils literal notranslate"><span class="pre">AudioPlayer</span></code>.</p>
<ul>
<li><p>Instead, it’s 《flattened》 like <a class="reference internal" href="api.html#discord.User" title="discord.User"><code class="xref py py-class docutils literal notranslate"><span class="pre">User</span></code></a> -> <a class="reference internal" href="api.html#discord.Member" title="discord.Member"><code class="xref py py-class docutils literal notranslate"><span class="pre">Member</span></code></a> is.</p></li>
</ul>
</li>
<li><p>The <code class="docutils literal notranslate"><span class="pre">after</span></code> parameter now takes a single parameter (the error).</p></li>
</ul>
<p>Basically:</p>
<p>Before:</p>
<div class="highlight-default notranslate"><div class="highlight"><pre><span></span><span class="n">vc</span> <span class="o">=</span> <span class="k">await</span> <span class="n">client</span><span class="o">.</span><span class="n">join_voice_channel</span><span class="p">(</span><span class="n">channel</span><span class="p">)</span>
<span class="n">player</span> <span class="o">=</span> <span class="n">vc</span><span class="o">.</span><span class="n">create_ffmpeg_player</span><span class="p">(</span><span class="s1">'testing.mp3'</span><span class="p">,</span> <span class="n">after</span><span class="o">=</span><span class="k">lambda</span><span class="p">:</span> <span class="nb">print</span><span class="p">(</span><span class="s1">'done'</span><span class="p">))</span>
<span class="n">player</span><span class="o">.</span><span class="n">start</span><span class="p">()</span>
<span class="n">player</span><span class="o">.</span><span class="n">is_playing</span><span class="p">()</span>
<span class="n">player</span><span class="o">.</span><span class="n">pause</span><span class="p">()</span>
<span class="n">player</span><span class="o">.</span><span class="n">resume</span><span class="p">()</span>
<span class="n">player</span><span class="o">.</span><span class="n">stop</span><span class="p">()</span>
<span class="c1"># ...</span>
</pre></div>
</div>
<p>After:</p>
<div class="highlight-default notranslate"><div class="highlight"><pre><span></span><span class="n">vc</span> <span class="o">=</span> <span class="k">await</span> <span class="n">channel</span><span class="o">.</span><span class="n">connect</span><span class="p">()</span>
<span class="n">vc</span><span class="o">.</span><span class="n">play</span><span class="p">(</span><span class="n">discord</span><span class="o">.</span><span class="n">FFmpegPCMAudio</span><span class="p">(</span><span class="s1">'testing.mp3'</span><span class="p">),</span> <span class="n">after</span><span class="o">=</span><span class="k">lambda</span> <span class="n">e</span><span class="p">:</span> <span class="nb">print</span><span class="p">(</span><span class="s1">'done'</span><span class="p">,</span> <span class="n">e</span><span class="p">))</span>
<span class="n">vc</span><span class="o">.</span><span class="n">is_playing</span><span class="p">()</span>
<span class="n">vc</span><span class="o">.</span><span class="n">pause</span><span class="p">()</span>
<span class="n">vc</span><span class="o">.</span><span class="n">resume</span><span class="p">()</span>
<span class="n">vc</span><span class="o">.</span><span class="n">stop</span><span class="p">()</span>
<span class="c1"># ...</span>
</pre></div>
</div>
<p>With the changed <a class="reference internal" href="api.html#discord.AudioSource" title="discord.AudioSource"><code class="xref py py-class docutils literal notranslate"><span class="pre">AudioSource</span></code></a> design, you can now change the source that the <a class="reference internal" href="api.html#discord.VoiceClient" title="discord.VoiceClient"><code class="xref py py-class docutils literal notranslate"><span class="pre">VoiceClient</span></code></a> is
playing at runtime via <a class="reference internal" href="api.html#discord.VoiceClient.source" title="discord.VoiceClient.source"><code class="xref py py-attr docutils literal notranslate"><span class="pre">VoiceClient.source</span></code></a>.</p>
<p>For example, you can add a <a class="reference internal" href="api.html#discord.PCMVolumeTransformer" title="discord.PCMVolumeTransformer"><code class="xref py py-class docutils literal notranslate"><span class="pre">PCMVolumeTransformer</span></code></a> to allow changing the volume:</p>
<div class="highlight-default notranslate"><div class="highlight"><pre><span></span><span class="n">vc</span><span class="o">.</span><span class="n">source</span> <span class="o">=</span> <span class="n">discord</span><span class="o">.</span><span class="n">PCMVolumeTransformer</span><span class="p">(</span><span class="n">vc</span><span class="o">.</span><span class="n">source</span><span class="p">)</span>
<span class="n">vc</span><span class="o">.</span><span class="n">source</span><span class="o">.</span><span class="n">volume</span> <span class="o">=</span> <span class="mf">0.6</span>
</pre></div>
</div>
<p>An added benefit of the redesign is that it will be much more resilient towards reconnections:</p>
<ul class="simple">
<li><p>The voice websocket will now automatically re-connect and re-do the handshake when disconnected.</p></li>
<li><p>The initial connect handshake will now retry up to 5 times so you no longer get as many <code class="docutils literal notranslate"><span class="pre">asyncio.TimeoutError</span></code>.</p></li>
<li><p>Audio will now stop and resume when a disconnect is found.</p>
<ul>
<li><p>This includes changing voice regions etc.</p></li>
</ul>
</li>
</ul>
</section>
<section id="waiting-for-events">
<span id="migrating-1-0-wait-for"></span><h2>Waiting For Events<a class="headerlink" href="#waiting-for-events" title="제목 주소">¶</a></h2>
<p>Prior to v1.0, the machinery for waiting for an event outside of the event itself was done through two different
functions, <code class="docutils literal notranslate"><span class="pre">Client.wait_for_message</span></code> and <code class="docutils literal notranslate"><span class="pre">Client.wait_for_reaction</span></code>. One problem with one such approach is that it did
not allow you to wait for events outside of the ones provided by the library.</p>
<p>In v1.0 the concept of waiting for another event has been generalised to work with any event as <a class="reference internal" href="api.html#discord.Client.wait_for" title="discord.Client.wait_for"><code class="xref py py-meth docutils literal notranslate"><span class="pre">Client.wait_for()</span></code></a>.</p>
<p>For example, to wait for a message:</p>
<div class="highlight-default notranslate"><div class="highlight"><pre><span></span><span class="c1"># before</span>
<span class="n">msg</span> <span class="o">=</span> <span class="k">await</span> <span class="n">client</span><span class="o">.</span><span class="n">wait_for_message</span><span class="p">(</span><span class="n">author</span><span class="o">=</span><span class="n">message</span><span class="o">.</span><span class="n">author</span><span class="p">,</span> <span class="n">channel</span><span class="o">=</span><span class="n">message</span><span class="o">.</span><span class="n">channel</span><span class="p">)</span>
<span class="c1"># after</span>
<span class="k">def</span> <span class="nf">pred</span><span class="p">(</span><span class="n">m</span><span class="p">):</span>
<span class="k">return</span> <span class="n">m</span><span class="o">.</span><span class="n">author</span> <span class="o">==</span> <span class="n">message</span><span class="o">.</span><span class="n">author</span> <span class="ow">and</span> <span class="n">m</span><span class="o">.</span><span class="n">channel</span> <span class="o">==</span> <span class="n">message</span><span class="o">.</span><span class="n">channel</span>
<span class="n">msg</span> <span class="o">=</span> <span class="k">await</span> <span class="n">client</span><span class="o">.</span><span class="n">wait_for</span><span class="p">(</span><span class="s1">'message'</span><span class="p">,</span> <span class="n">check</span><span class="o">=</span><span class="n">pred</span><span class="p">)</span>
</pre></div>
</div>
<p>To facilitate multiple returns, <a class="reference internal" href="api.html#discord.Client.wait_for" title="discord.Client.wait_for"><code class="xref py py-meth docutils literal notranslate"><span class="pre">Client.wait_for()</span></code></a> returns either a single argument, no arguments, or a tuple of
arguments.</p>
<p>For example, to wait for a reaction:</p>
<div class="highlight-default notranslate"><div class="highlight"><pre><span></span><span class="n">reaction</span><span class="p">,</span> <span class="n">user</span> <span class="o">=</span> <span class="k">await</span> <span class="n">client</span><span class="o">.</span><span class="n">wait_for</span><span class="p">(</span><span class="s1">'reaction_add'</span><span class="p">,</span> <span class="n">check</span><span class="o">=</span><span class="k">lambda</span> <span class="n">r</span><span class="p">,</span> <span class="n">u</span><span class="p">:</span> <span class="n">u</span><span class="o">.</span><span class="n">id</span> <span class="o">==</span> <span class="mi">176995180300206080</span><span class="p">)</span>
<span class="c1"># use user and reaction</span>
</pre></div>
</div>
<p>Since this function now can return multiple arguments, the <code class="docutils literal notranslate"><span class="pre">timeout</span></code> parameter will now raise a <a class="reference external" href="https://docs.python.org/ko/3/library/asyncio-exceptions.html#asyncio.TimeoutError" title="(in Python v3.9)"><code class="xref py py-exc docutils literal notranslate"><span class="pre">asyncio.TimeoutError</span></code></a>
when reached instead of setting the return to <code class="docutils literal notranslate"><span class="pre">None</span></code>. For example:</p>
<div class="highlight-python3 notranslate"><div class="highlight"><pre><span></span><span class="k">def</span> <span class="nf">pred</span><span class="p">(</span><span class="n">m</span><span class="p">):</span>
<span class="k">return</span> <span class="n">m</span><span class="o">.</span><span class="n">author</span> <span class="o">==</span> <span class="n">message</span><span class="o">.</span><span class="n">author</span> <span class="ow">and</span> <span class="n">m</span><span class="o">.</span><span class="n">channel</span> <span class="o">==</span> <span class="n">message</span><span class="o">.</span><span class="n">channel</span>
<span class="k">try</span><span class="p">:</span>
<span class="n">msg</span> <span class="o">=</span> <span class="k">await</span> <span class="n">client</span><span class="o">.</span><span class="n">wait_for</span><span class="p">(</span><span class="s1">'message'</span><span class="p">,</span> <span class="n">check</span><span class="o">=</span><span class="n">pred</span><span class="p">,</span> <span class="n">timeout</span><span class="o">=</span><span class="mf">60.0</span><span class="p">)</span>
<span class="k">except</span> <span class="n">asyncio</span><span class="o">.</span><span class="n">TimeoutError</span><span class="p">:</span>
<span class="k">await</span> <span class="n">channel</span><span class="o">.</span><span class="n">send</span><span class="p">(</span><span class="s1">'You took too long...'</span><span class="p">)</span>
<span class="k">else</span><span class="p">:</span>
<span class="k">await</span> <span class="n">channel</span><span class="o">.</span><span class="n">send</span><span class="p">(</span><span class="s1">'You said </span><span class="si">{0.content}</span><span class="s1">, </span><span class="si">{0.author}</span><span class="s1">.'</span><span class="o">.</span><span class="n">format</span><span class="p">(</span><span class="n">msg</span><span class="p">))</span>
</pre></div>
</div>
</section>
<section id="upgraded-dependencies">
<h2>Upgraded Dependencies<a class="headerlink" href="#upgraded-dependencies" title="제목 주소">¶</a></h2>
<p>Following v1.0 of the library, we’ve updated our requirements to <a class="reference external" href="https://docs.aiohttp.org/en/stable/index.html" title="(in aiohttp v3.7)"><span class="xref std std-doc">aiohttp</span></a> v2.0 or higher.</p>
<p>Since this is a backwards incompatible change, it is recommended that you see the
<a class="reference external" href="http://aiohttp.readthedocs.io/en/stable/changes.html#rc1-2017-03-15">changes</a>
and the <a class="reference external" href="https://docs.aiohttp.org/en/stable/migration_to_2xx.html" title="(in aiohttp v3.7)"><span>Migration to 2.x</span></a> pages for details on the breaking changes in
<a class="reference external" href="https://docs.aiohttp.org/en/stable/index.html" title="(in aiohttp v3.7)"><span class="xref std std-doc">aiohttp</span></a>.</p>
<p>Of the most significant for common users is the removal of helper functions such as:</p>
<ul class="simple">
<li><p><code class="docutils literal notranslate"><span class="pre">aiohttp.get</span></code></p></li>
<li><p><code class="docutils literal notranslate"><span class="pre">aiohttp.post</span></code></p></li>
<li><p><code class="docutils literal notranslate"><span class="pre">aiohttp.delete</span></code></p></li>
<li><p><code class="docutils literal notranslate"><span class="pre">aiohttp.patch</span></code></p></li>
<li><p><code class="docutils literal notranslate"><span class="pre">aiohttp.head</span></code></p></li>
<li><p><code class="docutils literal notranslate"><span class="pre">aiohttp.put</span></code></p></li>
<li><p><code class="docutils literal notranslate"><span class="pre">aiohttp.request</span></code></p></li>
</ul>
<p>It is recommended that you create a session instead:</p>
<div class="highlight-default notranslate"><div class="highlight"><pre><span></span><span class="k">async</span> <span class="k">with</span> <span class="n">aiohttp</span><span class="o">.</span><span class="n">ClientSession</span><span class="p">()</span> <span class="k">as</span> <span class="n">sess</span><span class="p">:</span>
<span class="k">async</span> <span class="k">with</span> <span class="n">sess</span><span class="o">.</span><span class="n">get</span><span class="p">(</span><span class="s1">'url'</span><span class="p">)</span> <span class="k">as</span> <span class="n">resp</span><span class="p">:</span>
<span class="c1"># work with resp</span>
</pre></div>
</div>
<p>Since it is better to not create a session for every request, you should store it in a variable and then call
<code class="docutils literal notranslate"><span class="pre">session.close</span></code> on it when it needs to be disposed.</p>
</section>
<section id="sharding">
<h2>Sharding<a class="headerlink" href="#sharding" title="제목 주소">¶</a></h2>
<p>The library has received significant changes on how it handles sharding and now has sharding as a first-class citizen.</p>
<p>If using a Bot account and you want to shard your bot in a single process then you can use the <a class="reference internal" href="api.html#discord.AutoShardedClient" title="discord.AutoShardedClient"><code class="xref py py-class docutils literal notranslate"><span class="pre">AutoShardedClient</span></code></a>.</p>
<p>This class allows you to use sharding without having to launch multiple processes or deal with complicated IPC.</p>
<p>It should be noted that <strong>the sharded client does not support user accounts</strong>. This is due to the changes in connection
logic and state handling.</p>
<p>Usage is as simple as doing:</p>
<div class="highlight-default notranslate"><div class="highlight"><pre><span></span><span class="n">client</span> <span class="o">=</span> <span class="n">discord</span><span class="o">.</span><span class="n">AutoShardedClient</span><span class="p">()</span>
</pre></div>
</div>
<p>instead of using <a class="reference internal" href="api.html#discord.Client" title="discord.Client"><code class="xref py py-class docutils literal notranslate"><span class="pre">Client</span></code></a>.</p>
<p>This will launch as many shards as your bot needs using the <code class="docutils literal notranslate"><span class="pre">/gateway/bot</span></code> endpoint, which allocates about 1000 guilds
per shard.</p>
<p>If you want more control over the sharding you can specify <code class="docutils literal notranslate"><span class="pre">shard_count</span></code> and <code class="docutils literal notranslate"><span class="pre">shard_ids</span></code>.</p>
<div class="highlight-default notranslate"><div class="highlight"><pre><span></span><span class="c1"># launch 10 shards regardless</span>
<span class="n">client</span> <span class="o">=</span> <span class="n">discord</span><span class="o">.</span><span class="n">AutoShardedClient</span><span class="p">(</span><span class="n">shard_count</span><span class="o">=</span><span class="mi">10</span><span class="p">)</span>
<span class="c1"># launch specific shard IDs in this process</span>
<span class="n">client</span> <span class="o">=</span> <span class="n">discord</span><span class="o">.</span><span class="n">AutoShardedClient</span><span class="p">(</span><span class="n">shard_count</span><span class="o">=</span><span class="mi">10</span><span class="p">,</span> <span class="n">shard_ids</span><span class="o">=</span><span class="p">(</span><span class="mi">1</span><span class="p">,</span> <span class="mi">2</span><span class="p">,</span> <span class="mi">5</span><span class="p">,</span> <span class="mi">6</span><span class="p">))</span>
</pre></div>
</div>
<p>For users of the command extension, there is also <a class="reference internal" href="ext/commands/api.html#discord.ext.commands.AutoShardedBot" title="discord.ext.commands.AutoShardedBot"><code class="xref py py-class docutils literal notranslate"><span class="pre">AutoShardedBot</span></code></a> which behaves similarly.</p>
</section>
<section id="connection-improvements">
<h2>Connection Improvements<a class="headerlink" href="#connection-improvements" title="제목 주소">¶</a></h2>
<p>In v1.0, the auto reconnection logic has been powered up significantly.</p>
<p><a class="reference internal" href="api.html#discord.Client.connect" title="discord.Client.connect"><code class="xref py py-meth docutils literal notranslate"><span class="pre">Client.connect()</span></code></a> has gained a new keyword argument, <code class="docutils literal notranslate"><span class="pre">reconnect</span></code> that defaults to <code class="docutils literal notranslate"><span class="pre">True</span></code> which controls
the reconnect logic. When enabled, the client will automatically reconnect in all instances of your internet going
offline or Discord going offline with exponential back-off.</p>
<p><a class="reference internal" href="api.html#discord.Client.run" title="discord.Client.run"><code class="xref py py-meth docutils literal notranslate"><span class="pre">Client.run()</span></code></a> and <a class="reference internal" href="api.html#discord.Client.start" title="discord.Client.start"><code class="xref py py-meth docutils literal notranslate"><span class="pre">Client.start()</span></code></a> gains this keyword argument as well, but for most cases you will not
need to specify it unless turning it off.</p>
</section>
<section id="command-extension-changes">
<span id="migrating-1-0-commands"></span><h2>Command Extension Changes<a class="headerlink" href="#command-extension-changes" title="제목 주소">¶</a></h2>
<p>Due to the <a class="reference internal" href="#migrating-1-0-model-state"><span class="std std-ref">모델들은</span></a> changes, some of the design of the extension module had to
undergo some design changes as well.</p>
<section id="context-changes">
<h3>Context Changes<a class="headerlink" href="#context-changes" title="제목 주소">¶</a></h3>
<p>In v1.0, the <a class="reference internal" href="ext/commands/api.html#discord.ext.commands.Context" title="discord.ext.commands.Context"><code class="xref py py-class docutils literal notranslate"><span class="pre">Context</span></code></a> has received a lot of changes with how it’s retrieved and used.</p>
<p>The biggest change is that <code class="docutils literal notranslate"><span class="pre">pass_context=True</span></code> no longer exists, <a class="reference internal" href="ext/commands/api.html#discord.ext.commands.Context" title="discord.ext.commands.Context"><code class="xref py py-class docutils literal notranslate"><span class="pre">Context</span></code></a> is always passed. Ergo:</p>
<div class="highlight-python3 notranslate"><div class="highlight"><pre><span></span><span class="c1"># before</span>
<span class="nd">@bot</span><span class="o">.</span><span class="n">command</span><span class="p">()</span>
<span class="k">async</span> <span class="k">def</span> <span class="nf">foo</span><span class="p">():</span>
<span class="k">await</span> <span class="n">bot</span><span class="o">.</span><span class="n">say</span><span class="p">(</span><span class="s1">'Hello'</span><span class="p">)</span>
<span class="c1"># after</span>
<span class="nd">@bot</span><span class="o">.</span><span class="n">command</span><span class="p">()</span>
<span class="k">async</span> <span class="k">def</span> <span class="nf">foo</span><span class="p">(</span><span class="n">ctx</span><span class="p">):</span>
<span class="k">await</span> <span class="n">ctx</span><span class="o">.</span><span class="n">send</span><span class="p">(</span><span class="s1">'Hello'</span><span class="p">)</span>
</pre></div>
</div>
<p>The reason for this is because <a class="reference internal" href="ext/commands/api.html#discord.ext.commands.Context" title="discord.ext.commands.Context"><code class="xref py py-class docutils literal notranslate"><span class="pre">Context</span></code></a> now meets the requirements of <a class="reference internal" href="api.html#discord.abc.Messageable" title="discord.abc.Messageable"><code class="xref py py-class docutils literal notranslate"><span class="pre">abc.Messageable</span></code></a>. This
makes it have similar functionality to <a class="reference internal" href="api.html#discord.TextChannel" title="discord.TextChannel"><code class="xref py py-class docutils literal notranslate"><span class="pre">TextChannel</span></code></a> or <a class="reference internal" href="api.html#discord.DMChannel" title="discord.DMChannel"><code class="xref py py-class docutils literal notranslate"><span class="pre">DMChannel</span></code></a>. Using <a class="reference internal" href="ext/commands/api.html#discord.ext.commands.Context.send" title="discord.ext.commands.Context.send"><code class="xref py py-meth docutils literal notranslate"><span class="pre">send()</span></code></a>
will either DM the user in a DM context or send a message in the channel it was in, similar to the old <code class="docutils literal notranslate"><span class="pre">bot.say</span></code>
functionality. The old helpers have been removed in favour of the new <a class="reference internal" href="api.html#discord.abc.Messageable" title="discord.abc.Messageable"><code class="xref py py-class docutils literal notranslate"><span class="pre">abc.Messageable</span></code></a> interface. See
<a class="reference internal" href="#migrating-1-0-removed-helpers"><span class="std std-ref">Removed Helpers</span></a> for more information.</p>
<p>Since the <a class="reference internal" href="ext/commands/api.html#discord.ext.commands.Context" title="discord.ext.commands.Context"><code class="xref py py-class docutils literal notranslate"><span class="pre">Context</span></code></a> is now passed by default, several shortcuts have been added:</p>
<p><strong>New Shortcuts</strong></p>
<ul class="simple">
<li><p><a class="reference internal" href="ext/commands/api.html#discord.ext.commands.Context.author" title="discord.ext.commands.Context.author"><code class="xref py py-attr docutils literal notranslate"><span class="pre">ctx.author</span></code></a> is a shortcut for <code class="docutils literal notranslate"><span class="pre">ctx.message.author</span></code>.</p></li>
<li><p><a class="reference internal" href="ext/commands/api.html#discord.ext.commands.Context.guild" title="discord.ext.commands.Context.guild"><code class="xref py py-attr docutils literal notranslate"><span class="pre">ctx.guild</span></code></a> is a shortcut for <code class="docutils literal notranslate"><span class="pre">ctx.message.guild</span></code>.</p></li>
<li><p><a class="reference internal" href="ext/commands/api.html#discord.ext.commands.Context.channel" title="discord.ext.commands.Context.channel"><code class="xref py py-attr docutils literal notranslate"><span class="pre">ctx.channel</span></code></a> is a shortcut for <code class="docutils literal notranslate"><span class="pre">ctx.message.channel</span></code>.</p></li>
<li><p><a class="reference internal" href="ext/commands/api.html#discord.ext.commands.Context.me" title="discord.ext.commands.Context.me"><code class="xref py py-attr docutils literal notranslate"><span class="pre">ctx.me</span></code></a> is a shortcut for <code class="docutils literal notranslate"><span class="pre">ctx.message.guild.me</span></code> or <code class="docutils literal notranslate"><span class="pre">ctx.bot.user</span></code>.</p></li>
<li><p><a class="reference internal" href="ext/commands/api.html#discord.ext.commands.Context.voice_client" title="discord.ext.commands.Context.voice_client"><code class="xref py py-attr docutils literal notranslate"><span class="pre">ctx.voice_client</span></code></a> is a shortcut for <code class="docutils literal notranslate"><span class="pre">ctx.message.guild.voice_client</span></code>.</p></li>
</ul>
<p><strong>New Functionality</strong></p>
<ul>
<li><p><a class="reference internal" href="ext/commands/api.html#discord.ext.commands.Context.reinvoke" title="discord.ext.commands.Context.reinvoke"><code class="xref py py-meth docutils literal notranslate"><span class="pre">Context.reinvoke()</span></code></a> to invoke a command again.</p>
<blockquote>
<div><ul class="simple">
<li><p>This is useful for bypassing cooldowns.</p></li>
</ul>
</div></blockquote>
</li>
<li><p><a class="reference internal" href="ext/commands/api.html#discord.ext.commands.Context.valid" title="discord.ext.commands.Context.valid"><code class="xref py py-attr docutils literal notranslate"><span class="pre">Context.valid</span></code></a> to check if a context can be invoked with <a class="reference internal" href="ext/commands/api.html#discord.ext.commands.Bot.invoke" title="discord.ext.commands.Bot.invoke"><code class="xref py py-meth docutils literal notranslate"><span class="pre">Bot.invoke()</span></code></a>.</p></li>
<li><p><a class="reference internal" href="ext/commands/api.html#discord.ext.commands.Context.send_help" title="discord.ext.commands.Context.send_help"><code class="xref py py-meth docutils literal notranslate"><span class="pre">Context.send_help()</span></code></a> to show the help command for an entity using the new <a class="reference internal" href="ext/commands/api.html#discord.ext.commands.HelpCommand" title="discord.ext.commands.HelpCommand"><code class="xref py py-class docutils literal notranslate"><span class="pre">HelpCommand</span></code></a> system.</p>
<blockquote>
<div><ul class="simple">
<li><p>This is useful if you want to show the user help if they misused a command.</p></li>
</ul>
</div></blockquote>
</li>
</ul>
<section id="subclassing-context">
<h4>Subclassing Context<a class="headerlink" href="#subclassing-context" title="제목 주소">¶</a></h4>
<p>In v1.0, there is now the ability to subclass <a class="reference internal" href="ext/commands/api.html#discord.ext.commands.Context" title="discord.ext.commands.Context"><code class="xref py py-class docutils literal notranslate"><span class="pre">Context</span></code></a> and use it instead of the default
provided one.</p>
<p>For example, if you want to add some functionality to the context:</p>
<div class="highlight-python3 notranslate"><div class="highlight"><pre><span></span><span class="k">class</span> <span class="nc">MyContext</span><span class="p">(</span><span class="n">commands</span><span class="o">.</span><span class="n">Context</span><span class="p">):</span>
<span class="nd">@property</span>
<span class="k">def</span> <span class="nf">secret</span><span class="p">(</span><span class="bp">self</span><span class="p">):</span>
<span class="k">return</span> <span class="s1">'my secret here'</span>
</pre></div>
</div>
<p>Then you can use <a class="reference internal" href="ext/commands/api.html#discord.ext.commands.Bot.get_context" title="discord.ext.commands.Bot.get_context"><code class="xref py py-meth docutils literal notranslate"><span class="pre">get_context()</span></code></a> inside <a class="reference internal" href="api.html#discord.on_message" title="discord.on_message"><code class="xref py py-func docutils literal notranslate"><span class="pre">on_message()</span></code></a> with combination with
<a class="reference internal" href="ext/commands/api.html#discord.ext.commands.Bot.invoke" title="discord.ext.commands.Bot.invoke"><code class="xref py py-meth docutils literal notranslate"><span class="pre">invoke()</span></code></a> to use your custom context:</p>
<div class="highlight-python3 notranslate"><div class="highlight"><pre><span></span><span class="k">class</span> <span class="nc">MyBot</span><span class="p">(</span><span class="n">commands</span><span class="o">.</span><span class="n">Bot</span><span class="p">):</span>
<span class="k">async</span> <span class="k">def</span> <span class="nf">on_message</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">message</span><span class="p">):</span>
<span class="n">ctx</span> <span class="o">=</span> <span class="k">await</span> <span class="bp">self</span><span class="o">.</span><span class="n">get_context</span><span class="p">(</span><span class="n">message</span><span class="p">,</span> <span class="bp">cls</span><span class="o">=</span><span class="n">MyContext</span><span class="p">)</span>
<span class="k">await</span> <span class="bp">self</span><span class="o">.</span><span class="n">invoke</span><span class="p">(</span><span class="n">ctx</span><span class="p">)</span>
</pre></div>
</div>
<p>Now inside your commands you will have access to your custom context:</p>
<div class="highlight-python3 notranslate"><div class="highlight"><pre><span></span><span class="nd">@bot</span><span class="o">.</span><span class="n">command</span><span class="p">()</span>