@@ -280,31 +280,31 @@ struct DPP_EXPORT select_option : public json_interface<select_option> {
280
280
* @param value Value of option
281
281
* @param description Description of option
282
282
*/
283
- select_option (const std::string & label, const std::string & value, const std::string & description = " " );
283
+ select_option (std::string_view label, std::string_view value, std::string_view description = " " );
284
284
285
285
/* *
286
286
* @brief Set the label
287
287
*
288
288
* @param l the user-facing name of the option. It will be truncated to the maximum length of 100 UTF-8 characters.
289
289
* @return select_option& reference to self for chaining
290
290
*/
291
- select_option& set_label (const std::string & l);
291
+ select_option& set_label (std::string_view l);
292
292
293
293
/* *
294
294
* @brief Set the value
295
295
*
296
296
* @param v value to set. It will be truncated to the maximum length of 100 UTF-8 characters.
297
297
* @return select_option& reference to self for chaining
298
298
*/
299
- select_option& set_value (const std::string & v);
299
+ select_option& set_value (std::string_view v);
300
300
301
301
/* *
302
302
* @brief Set the description
303
303
*
304
304
* @param d description to set. It will be truncated to the maximum length of 100 UTF-8 characters.
305
305
* @return select_option& reference to self for chaining
306
306
*/
307
- select_option& set_description (const std::string & d);
307
+ select_option& set_description (std::string_view d);
308
308
309
309
/* *
310
310
* @brief Set the emoji
@@ -314,7 +314,7 @@ struct DPP_EXPORT select_option : public json_interface<select_option> {
314
314
* @param animated true if animated emoji
315
315
* @return select_option& reference to self for chaining
316
316
*/
317
- select_option& set_emoji (const std::string & n, dpp::snowflake id = 0 , bool animated = false );
317
+ select_option& set_emoji (std::string_view n, dpp::snowflake id = 0 , bool animated = false );
318
318
319
319
/* *
320
320
* @brief Set the option as default
@@ -529,7 +529,7 @@ class DPP_EXPORT component : public json_interface<component> {
529
529
* @param label Label text to set. It will be truncated to the maximum length of 80 UTF-8 characters.
530
530
* @return component& Reference to self
531
531
*/
532
- component& set_label (const std::string & label);
532
+ component& set_label (std::string_view label);
533
533
534
534
/* *
535
535
* @brief Set the default value of the text input component.
@@ -539,7 +539,7 @@ class DPP_EXPORT component : public json_interface<component> {
539
539
* @param val Value text to set. It will be truncated to the maximum length of 4000 UTF-8 characters.
540
540
* @return component& Reference to self
541
541
*/
542
- component& set_default_value (const std::string & val);
542
+ component& set_default_value (std::string_view val);
543
543
544
544
/* *
545
545
* @brief Set the url for dpp::cos_link types.
@@ -549,7 +549,7 @@ class DPP_EXPORT component : public json_interface<component> {
549
549
* @param url URL to set. It will be truncated to the maximum length of 512 UTF-8 characters.
550
550
* @return component& reference to self.
551
551
*/
552
- component& set_url (const std::string & url);
552
+ component& set_url (std::string_view url);
553
553
554
554
/* *
555
555
* @brief Set the style of the component, e.g. button colour.
@@ -572,7 +572,7 @@ class DPP_EXPORT component : public json_interface<component> {
572
572
* If your Custom ID is longer than this, it will be truncated.
573
573
* @return component& Reference to self
574
574
*/
575
- component& set_id (const std::string & id);
575
+ component& set_id (std::string_view id);
576
576
577
577
/* *
578
578
* @brief Set the component to disabled.
@@ -600,7 +600,7 @@ class DPP_EXPORT component : public json_interface<component> {
600
600
* characters for modals.
601
601
* @return component& Reference to self
602
602
*/
603
- component& set_placeholder (const std::string & placeholder);
603
+ component& set_placeholder (std::string_view placeholder);
604
604
605
605
/* *
606
606
* @brief Set the minimum number of items that must be chosen for a select menu
@@ -677,7 +677,7 @@ class DPP_EXPORT component : public json_interface<component> {
677
677
* @param animated True if the custom emoji is animated.
678
678
* @return component& Reference to self
679
679
*/
680
- component& set_emoji (const std::string& name, dpp::snowflake id = 0 , bool animated = false );
680
+ component& set_emoji (std::string_view name, dpp::snowflake id = 0 , bool animated = false );
681
681
};
682
682
683
683
/* *
@@ -706,21 +706,21 @@ struct DPP_EXPORT embed_footer {
706
706
* @param t string to set as footer text. It will be truncated to the maximum length of 2048 UTF-8 characters.
707
707
* @return A reference to self so this method may be "chained".
708
708
*/
709
- embed_footer& set_text (const std::string& t);
709
+ embed_footer& set_text (std::string_view t);
710
710
711
711
/* *
712
712
* @brief Set footer's icon url.
713
713
* @param i url to set as footer icon url
714
714
* @return A reference to self so this method may be "chained".
715
715
*/
716
- embed_footer& set_icon (const std::string& i);
716
+ embed_footer& set_icon (std::string_view i);
717
717
718
718
/* *
719
719
* @brief Set footer's proxied icon url.
720
720
* @param p url to set as footer proxied icon url
721
721
* @return A reference to self so this method may be "chained".
722
722
*/
723
- embed_footer& set_proxy (const std::string& p);
723
+ embed_footer& set_proxy (std::string_view p);
724
724
};
725
725
726
726
/* *
@@ -908,14 +908,14 @@ struct DPP_EXPORT embed {
908
908
* @param text The text of the title. It will be truncated to the maximum length of 256 UTF-8 characters.
909
909
* @return A reference to self so this method may be "chained".
910
910
*/
911
- embed& set_title (const std::string & text);
911
+ embed& set_title (std::string_view text);
912
912
913
913
/* *
914
914
* @brief Set embed description.
915
915
* @param text The text of the title. It will be truncated to the maximum length of 4096 UTF-8 characters.
916
916
* @return A reference to self so this method may be "chained".
917
917
*/
918
- embed& set_description (const std::string & text);
918
+ embed& set_description (std::string_view text);
919
919
920
920
/* *
921
921
* @brief Set the footer of the embed.
@@ -930,7 +930,7 @@ struct DPP_EXPORT embed {
930
930
* @param icon_url an url to set as footer icon url (only supports http(s) and attachments)
931
931
* @return A reference to self so this method may be "chained".
932
932
*/
933
- embed& set_footer (const std::string& text, const std::string& icon_url);
933
+ embed& set_footer (std::string_view text, std::string_view icon_url);
934
934
935
935
/* *
936
936
* @brief Set embed colour.
@@ -958,7 +958,7 @@ struct DPP_EXPORT embed {
958
958
* @param url the url of the embed
959
959
* @return A reference to self so this method may be "chained".
960
960
*/
961
- embed& set_url (const std::string & url);
961
+ embed& set_url (std::string_view url);
962
962
963
963
/* *
964
964
* @brief Add an embed field.
@@ -967,7 +967,7 @@ struct DPP_EXPORT embed {
967
967
* @param is_inline Whether or not to display the field 'inline' or on its own line
968
968
* @return A reference to self so this method may be "chained".
969
969
*/
970
- embed& add_field (const std::string& name, const std::string & value, bool is_inline = false );
970
+ embed& add_field (std::string_view name, std::string_view value, bool is_inline = false );
971
971
972
972
/* *
973
973
* @brief Set embed author.
@@ -983,36 +983,36 @@ struct DPP_EXPORT embed {
983
983
* @param icon_url The icon URL of the author (only supports http(s) and attachments)
984
984
* @return A reference to self so this method may be "chained".
985
985
*/
986
- embed& set_author (const std::string& name, const std::string& url, const std::string& icon_url);
986
+ embed& set_author (std::string_view name, std::string_view url, std::string_view icon_url);
987
987
988
988
/* *
989
989
* @brief Set embed provider.
990
990
* @param name The provider name. It will be truncated to the maximum length of 256 UTF-8 characters.
991
991
* @param url The provider url
992
992
* @return A reference to self so this method may be "chained".
993
993
*/
994
- embed& set_provider (const std::string& name, const std::string& url);
994
+ embed& set_provider (std::string_view name, std::string_view url);
995
995
996
996
/* *
997
997
* @brief Set embed image.
998
998
* @param url The embed image URL (only supports http(s) and attachments)
999
999
* @return A reference to self so this method may be "chained".
1000
1000
*/
1001
- embed& set_image (const std::string& url);
1001
+ embed& set_image (std::string_view url);
1002
1002
1003
1003
/* *
1004
1004
* @brief Set embed video.
1005
1005
* @param url The embed video url
1006
1006
* @return A reference to self so this method may be "chained".
1007
1007
*/
1008
- embed& set_video (const std::string& url);
1008
+ embed& set_video (std::string_view url);
1009
1009
1010
1010
/* *
1011
1011
* @brief Set embed thumbnail.
1012
1012
* @param url The embed thumbnail url (only supports http(s) and attachments)
1013
1013
* @return A reference to self so this method may be "chained".
1014
1014
*/
1015
- embed& set_thumbnail (const std::string& url);
1015
+ embed& set_thumbnail (std::string_view url);
1016
1016
};
1017
1017
1018
1018
/* *
@@ -1360,15 +1360,15 @@ struct DPP_EXPORT sticker : public managed, public json_interface<sticker> {
1360
1360
* @param fn filename
1361
1361
* @return message& reference to self
1362
1362
*/
1363
- sticker& set_filename (const std::string & fn);
1363
+ sticker& set_filename (std::string_view fn);
1364
1364
1365
1365
/* *
1366
1366
* @brief Set the file content
1367
- *
1368
- * @param fc raw file content contained in std::string
1367
+ *
1368
+ * @param fc raw file content
1369
1369
* @return message& reference to self
1370
1370
*/
1371
- sticker& set_file_content (const std::string & fc);
1371
+ sticker& set_file_content (std::string_view fc);
1372
1372
1373
1373
};
1374
1374
@@ -1575,7 +1575,7 @@ struct DPP_EXPORT poll {
1575
1575
* @param text Text for the question
1576
1576
* @return self for method chaining
1577
1577
*/
1578
- poll& set_question (const std::string& text);
1578
+ poll& set_question (std::string_view text);
1579
1579
1580
1580
/* *
1581
1581
* @brief Set the duration of the poll in hours
@@ -1611,7 +1611,7 @@ struct DPP_EXPORT poll {
1611
1611
* @param is_animated Whether the emoji is animated
1612
1612
* @return self for method chaining
1613
1613
*/
1614
- poll& add_answer (const std::string& text, snowflake emoji_id = 0 , bool is_animated = false );
1614
+ poll& add_answer (std::string_view text, snowflake emoji_id = 0 , bool is_animated = false );
1615
1615
1616
1616
/* *
1617
1617
* @brief Add an answer to this poll
@@ -1621,7 +1621,7 @@ struct DPP_EXPORT poll {
1621
1621
* @param emoji Optional emoji
1622
1622
* @return self for method chaining
1623
1623
*/
1624
- poll& add_answer (const std::string& text, const std::string& emoji);
1624
+ poll& add_answer (std::string_view text, std::string_view emoji);
1625
1625
1626
1626
/* *
1627
1627
* @brief Add an answer to this poll
@@ -1631,7 +1631,7 @@ struct DPP_EXPORT poll {
1631
1631
* @param e Optional emoji
1632
1632
* @return self for method chaining
1633
1633
*/
1634
- poll& add_answer (const std::string& text, const emoji& e);
1634
+ poll& add_answer (std::string_view text, const emoji& e);
1635
1635
1636
1636
/* *
1637
1637
* @brief Helper to get the question text
@@ -2286,7 +2286,7 @@ struct DPP_EXPORT message : public managed, json_interface<message> {
2286
2286
* @param content The content of the message. It will be truncated to the maximum length of 4000 UTF-8 characters.
2287
2287
* @param type The message type to create
2288
2288
*/
2289
- message (snowflake channel_id, const std::string & content, message_type type = mt_default);
2289
+ message (snowflake channel_id, std::string_view content, message_type type = mt_default);
2290
2290
2291
2291
/* *
2292
2292
* @brief Construct a new message object with content
@@ -2309,7 +2309,7 @@ struct DPP_EXPORT message : public managed, json_interface<message> {
2309
2309
* @param content The content of the message. It will be truncated to the maximum length of 4000 UTF-8 characters.
2310
2310
* @param type The message type to create
2311
2311
*/
2312
- message (const std::string & content, message_type type = mt_default);
2312
+ message (std::string_view content, message_type type = mt_default);
2313
2313
2314
2314
/* *
2315
2315
* @brief Destroy the message object
@@ -2516,34 +2516,34 @@ struct DPP_EXPORT message : public managed, json_interface<message> {
2516
2516
* @return message& reference to self
2517
2517
* @deprecated Use message::add_file instead
2518
2518
*/
2519
- message& set_filename (const std::string & fn);
2519
+ message& set_filename (std::string_view fn);
2520
2520
2521
2521
/* *
2522
2522
* @brief Set the file content of the last file in list
2523
2523
*
2524
- * @param fc raw file content contained in std::string
2524
+ * @param fc raw file content
2525
2525
* @return message& reference to self
2526
2526
* @deprecated Use message::add_file instead
2527
2527
*/
2528
- message& set_file_content (const std::string & fc);
2528
+ message& set_file_content (std::string_view fc);
2529
2529
2530
2530
/* *
2531
2531
* @brief Add a file to the message
2532
2532
*
2533
2533
* @param filename filename
2534
- * @param filecontent raw file content contained in std::string
2534
+ * @param filecontent raw file content
2535
2535
* @param filemimetype optional mime type of the file
2536
2536
* @return message& reference to self
2537
2537
*/
2538
- message& add_file (const std::string & filename, const std::string & filecontent, const std::string & filemimetype = " " );
2538
+ message& add_file (std::string_view filename, std::string_view filecontent, std::string_view filemimetype = " " );
2539
2539
2540
2540
/* *
2541
2541
* @brief Set the message content
2542
2542
*
2543
2543
* @param c message content. It will be truncated to the maximum length of 4000 UTF-8 characters.
2544
2544
* @return message& reference to self
2545
2545
*/
2546
- message& set_content (const std::string & c);
2546
+ message& set_content (std::string_view c);
2547
2547
2548
2548
/* *
2549
2549
* @brief Set the channel id
0 commit comments