DiscordCoreAPI
A Discord bot library written in C++, with custom asynchronous coroutines.
Loading...
Searching...
No Matches
StickerEntities.hpp
Go to the documentation of this file.
1/*
2 MIT License
3
4 DiscordCoreAPI, A bot library for Discord, written in C++, and featuring explicit multithreading through the usage of custom, asynchronous C++ CoRoutines.
5
6 Copyright 2022, 2023 Chris M. (RealTimeChris)
7
8 Permission is hereby granted, free of charge, to any person obtaining a copy
9 of this software and associated documentation files (the "Software"), to deal
10 in the Software without restriction, including without limitation the rights
11 to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
12 copies of the Software, and to permit persons to whom the Software is
13 furnished to do so, subject to the following conditions:
14
15 The above copyright notice and this permission notice shall be included in all
16 copies or substantial portions of the Software.
17
18 THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
19 IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
20 FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
21 AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
22 LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
23 OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
24 SOFTWARE.
25*/
26/// StickerEntities.hpp - Header for the sticker related classes and structs.
27/// May 13, 2021
28/// https://discordcoreapi.com
29/// \file StickerEntities.hpp
30
31#pragma once
32
35
36namespace DiscordCoreAPI {
37
38 /**
39 * \addtogroup foundation_entities
40 * @{
41 */
42
43 /// @brief For getting a StickerData object for the given sticker ID.
45 Snowflake stickerId{};///< The chosen StickerData's Snowflake.
46 };
47
48 /// @brief For collecting a list of Stickers from a chosen Guild.
50 Snowflake guildId{};///< The chosen Guild from which you would like to collect the Stickers from.
51 };
52
53 /// @brief For creating a single StickerData.
55 std::string description{};///< Description of the StickerData.
56 std::string reason{};///< The reason for creating the StickerData.
57 Snowflake guildId{};///< The Guild within which to create the StickerData.
58 std::string file{};///< The sticker file to upload, must be a Png, Apng, or Lottie JSON file, max 500 KB.
59 std::string name{};///< Name of the StickerData.
60 std::string tags{};///< Autocomplete / suggestion tags for the sticker(max 200 characters).
61 };
62
63 /// @brief For modifying a single StickerData.
65 std::string description{};///< Description of the StickerData.
66 Snowflake stickerId{};///< The StickerData you wish to modify.
67 std::string reason{};///< The reason for modifying the StickerData.
68 Snowflake guildId{};///< The Guild within which to modify the StickerData.
69 std::string name{};///< Name of the StickerData.
70 std::string tags{};///< Autocomplete / suggestion tags for the sticker(max 200 characters).
71 };
72
73 /// @brief For deleting a single StickerData.
75 Snowflake stickerId{};///< The StickerData you wish to delete.
76 std::string reason{};///< The reason for deleting the StickerData.
77 Snowflake guildId{};///< The Guild within which to delete the StickerData.
78 };
79
80 /**@}*/
81
82 /**
83 * \addtogroup main_endpoints
84 * @{
85 */
86
87 /// @brief An interface class for the StickerData related Discord endpoints.
88 class DiscordCoreAPI_Dll Stickers {
89 public:
90 static void initialize(DiscordCoreInternal::HttpsClient*);
91
92 /// @brief Gets a single StickerData item.
93 /// @param dataPackage A GetStickerData structure.
94 /// @return A CoRoutine containing a StickerData.
95 static CoRoutine<StickerData> getStickerAsync(GetStickerData dataPackage);
96
97 /// @brief Gets a list of nitro-available StickerData packs
98 /// @return A CoRoutine containing a StickerPackData
99 static CoRoutine<jsonifier::vector<StickerPackData>> getNitroStickerPacksAsync();
100
101 /// @brief Gets a list of Stickers from a Guild.
102 /// @param dataPackage A GetGuildStickersData structure.
103 /// @return A CoRoutine containing a jsonifier::vector<StickerData>.
104 static CoRoutine<jsonifier::vector<StickerData>> getGuildStickersAsync(GetGuildStickersData dataPackage);
105
106 /// @brief Creates a new StickerData within a chosen Guild.
107 /// @param dataPackage A CreateGuildStickerData structure.
108 /// @return A CoRoutine containing a StickerData.
109 static CoRoutine<StickerData> createGuildStickerAsync(CreateGuildStickerData dataPackage);
110
111 /// @brief Modifies a StickerData within a chosen Guild.
112 /// @param dataPackage A ModifyGuildStickerData structure.
113 /// @return A CoRoutine containing a StickerData.
114 static CoRoutine<StickerData> modifyGuildStickerAsync(ModifyGuildStickerData dataPackage);
115
116 /// @brief Deletes a StickerData within a chosen Guild.
117 /// @param dataPackage A DeleteGuildStickerData structure.
118 /// @return A CoRoutine containing void.
119 static CoRoutine<void> deleteGuildStickerAsync(DeleteGuildStickerData dataPackage);
120
121 protected:
122 static DiscordCoreInternal::HttpsClient* httpsClient;
123 };
124 /**@}*/
125};
A CoRoutine - representing a potentially asynchronous operation/function.
Definition: CoRoutine.hpp:88
For getting a StickerData object for the given sticker ID.
Snowflake stickerId
The chosen StickerData's Snowflake.
For collecting a list of Stickers from a chosen Guild.
Snowflake guildId
The chosen Guild from which you would like to collect the Stickers from.
For creating a single StickerData.
std::string file
The sticker file to upload, must be a Png, Apng, or Lottie JSON file, max 500 KB.
Snowflake guildId
The Guild within which to create the StickerData.
std::string reason
The reason for creating the StickerData.
std::string tags
Autocomplete / suggestion tags for the sticker(max 200 characters).
std::string name
Name of the StickerData.
std::string description
Description of the StickerData.
For modifying a single StickerData.
Snowflake stickerId
The StickerData you wish to modify.
std::string description
Description of the StickerData.
std::string tags
Autocomplete / suggestion tags for the sticker(max 200 characters).
Snowflake guildId
The Guild within which to modify the StickerData.
std::string name
Name of the StickerData.
std::string reason
The reason for modifying the StickerData.
For deleting a single StickerData.
Snowflake guildId
The Guild within which to delete the StickerData.
std::string reason
The reason for deleting the StickerData.
Snowflake stickerId
The StickerData you wish to delete.
An interface class for the StickerData related Discord endpoints.
A class representing a Snowflake identifier with various operations.
Definition: Base.hpp:771