├── .clang-format ├── .github ├── FUNDING.yml ├── ISSUE_TEMPLATE │ └── feature_request.md └── workflows │ ├── Build-Documentation.yml │ ├── CLANG-Ubuntu.yml │ ├── Construct-Vcpkg-Info.yml │ ├── DeleteRuns.yml │ ├── GCC-MacOS.yml │ ├── MSVC-Windows-Binaries.yml │ └── MSVC-Windows.yml ├── .gitignore ├── BuildTools ├── Classes │ └── Packager │ │ └── Vcpkg.php ├── Vendor │ ├── Composer │ │ ├── ClassLoader.php │ │ ├── LICENSE │ │ ├── autoload_classmap.php │ │ ├── autoload_namespaces.php │ │ ├── autoload_psr4.php │ │ ├── autoload_real.php │ │ └── autoload_static.php │ └── autoload.php └── make_vcpkg.php ├── CMake ├── CollectVersion.cmake ├── DiscordCoreAPIConfig.cmake.in ├── GenerateProductVersion.cmake ├── Raw-Files │ ├── Bottom-Of-Portfile.cmake │ ├── Middle-Of-Portfile.cmake │ └── Top-Of-Portfile.cmake ├── VersionInfo.in └── VersionResource.rc ├── CMakeLists.txt ├── CMakePresets.json ├── Documentation ├── Doxygen │ ├── Custom │ │ ├── custom.css │ │ ├── doxygen-awesome-darkmode-toggle.js │ │ ├── doxygen-awesome.css │ │ └── header.html │ ├── Docs │ │ ├── 01_login_setup.md │ │ ├── 03_general_usage.md │ │ ├── 04_auto_completes.md │ │ ├── 05_buttons.md │ │ ├── 06_select_menus.md │ │ ├── 07_modals.md │ │ ├── 08_voice_connections.md │ │ ├── 09_application_commands.md │ │ ├── 10_auto_moderation_rules.md │ │ ├── 11_channels.md │ │ ├── 12_guilds.md │ │ ├── 13_guild_members.md │ │ ├── 14_guild_scheduled_events.md │ │ ├── 15_input_events.md │ │ ├── 16_interactions.md │ │ ├── 17_messages.md │ │ ├── 18_reactions.md │ │ ├── 19_roles.md │ │ ├── 20_stage_instances.md │ │ ├── 21_stickers.md │ │ ├── 22_threads.md │ │ ├── 23_users.md │ │ ├── 24_webhooks.md │ │ ├── Index.md │ │ ├── documentation_examples.md │ │ ├── documentation_examples │ │ │ ├── application_commands │ │ │ │ ├── Batch Edit Guild Application Command Permissions.md │ │ │ │ ├── Bulk Overwrite Global Application Commands.md │ │ │ │ ├── Bulk Overwrite Guild Application Commands.md │ │ │ │ ├── Creating a Global Application Command.md │ │ │ │ ├── Creating a Guild Application Command.md │ │ │ │ ├── Deleting a Global Application Command.md │ │ │ │ ├── Deleting a Guild Application Command.md │ │ │ │ ├── Editing Guild Application Command Permissions.md │ │ │ │ ├── Editing a Global Application Command.md │ │ │ │ ├── Editing a Guild Application Command.md │ │ │ │ ├── Get Global Application Commands.md │ │ │ │ ├── Get Guild Application Command.md │ │ │ │ ├── Get Guild Application Commands.md │ │ │ │ ├── Getting Guild Application Command Permissions.md │ │ │ │ ├── Getting a Global Application Command.md │ │ │ │ └── Getting a Single Application Command Permissions.md │ │ │ ├── auto_moderation_rules │ │ │ │ ├── Create Auto-Moderation-Rule.md │ │ │ │ ├── Delete Auto-Moderation-Rule.md │ │ │ │ ├── Get Audo-Moderation-Rule.md │ │ │ │ ├── List Auto-Moderation-Rules.md │ │ │ │ └── Modify Auto-Moderation-Rule.md │ │ │ ├── autocompletes │ │ │ │ ├── Collecting Autocomplete Input.md │ │ │ │ └── Instantiating-Creating Autocomplete.md │ │ │ ├── buttons │ │ │ │ ├── Collecting Button Input.md │ │ │ │ └── Instantiating-Creating a Button.md │ │ │ ├── channels │ │ │ │ ├── Creating a Channel Invite.md │ │ │ │ ├── Creating a Direct-Message.md │ │ │ │ ├── Creating a Guild Channel.md │ │ │ │ ├── Deleting Permission Overwrites.md │ │ │ │ ├── Deleting a Channel.md │ │ │ │ ├── Editing Channel Permission Overwrites.md │ │ │ │ ├── Following a News Channel.md │ │ │ │ ├── Getting Channel Invites.md │ │ │ │ ├── Getting Guild Channels.md │ │ │ │ ├── Getting Voice Regions.md │ │ │ │ ├── Getting a Channel.md │ │ │ │ ├── Getting a Direct-Message Channel.md │ │ │ │ ├── Modifying Guild Channel Positions.md │ │ │ │ ├── Modifying a Channel.md │ │ │ │ └── Triggering the Typing Indicator.md │ │ │ ├── general_usage │ │ │ │ ├── Listening for a Discord Event.md │ │ │ │ ├── Running a Command.md │ │ │ │ ├── Running a Function on a Timer.md │ │ │ │ └── Using a Message Collector.md │ │ │ ├── guild_members │ │ │ │ ├── Adding a Guild Member.md │ │ │ │ ├── Getting a Guild Member.md │ │ │ │ ├── Listing Guild Members.md │ │ │ │ ├── Modifying a Guild Member.md │ │ │ │ ├── Modifying the Current Guild Member.md │ │ │ │ ├── Removing a Guild Member.md │ │ │ │ └── Searching Guild Members.md │ │ │ ├── guild_scheduled_events │ │ │ │ ├── Creating a Guild Scheduled Event.md │ │ │ │ ├── Deleting a Guild Scheduled Event.md │ │ │ │ ├── Getting Guild Scheduled Event Users.md │ │ │ │ ├── Getting a Guild Scheduled Event.md │ │ │ │ ├── Getting a List of Guild Scheduled Events.md │ │ │ │ └── Modifying a Guild Scheduled Event.md │ │ │ ├── guilds │ │ │ │ ├── Beginning a Guild Prune.md │ │ │ │ ├── Creating a Guild Ban.md │ │ │ │ ├── Creating a Guild Template.md │ │ │ │ ├── Creating a Guild from a Template.md │ │ │ │ ├── Creating a Guild.md │ │ │ │ ├── Deleting a Guild Integration.md │ │ │ │ ├── Deleting a Guild Template.md │ │ │ │ ├── Deleting a Guild.md │ │ │ │ ├── Getting All Guilds.md │ │ │ │ ├── Getting Audit Logs.md │ │ │ │ ├── Getting Current User's Guilds.md │ │ │ │ ├── Getting Guild Bans.md │ │ │ │ ├── Getting Guild Integrations.md │ │ │ │ ├── Getting Guild Invites.md │ │ │ │ ├── Getting Guild Templates.md │ │ │ │ ├── Getting Guild Voice Regions.md │ │ │ │ ├── Getting Guild Widget Settings.md │ │ │ │ ├── Getting a Guild Ban.md │ │ │ │ ├── Getting a Guild Preview.md │ │ │ │ ├── Getting a Guild Prune Count.md │ │ │ │ ├── Getting a Guild Template.md │ │ │ │ ├── Getting a Guild Vanity Invite.md │ │ │ │ ├── Getting a Guild Welcome Screen.md │ │ │ │ ├── Getting a Guild Widget Image.md │ │ │ │ ├── Getting a Guild Widget.md │ │ │ │ ├── Getting a Guild.md │ │ │ │ ├── Getting an Invite.md │ │ │ │ ├── Leaving a Guild.md │ │ │ │ ├── Modifying a Guild Tempalte.md │ │ │ │ ├── Modifying a Guild Welcome Screen.md │ │ │ │ ├── Modifying a Guild Widget.md │ │ │ │ ├── Modifying a Guild.md │ │ │ │ ├── Removing a Guild Ban.md │ │ │ │ └── Syncing a Guild Template.md │ │ │ ├── input_events │ │ │ │ ├── Creating an Interaction Response.md │ │ │ │ ├── Deleting an Interaction Response.md │ │ │ │ └── Editing an Interaction Response.md │ │ │ ├── interactions │ │ │ │ ├── Creating a Follow-Up Message.md │ │ │ │ ├── Creating an Interaction Response.md │ │ │ │ ├── Deleting a Follow-Up Message.md │ │ │ │ ├── Deleting an Interaction Response.md │ │ │ │ ├── Editing a Follow-Up Message.md │ │ │ │ ├── Editing an Interaction Response.md │ │ │ │ ├── Getting a Follow-Up Message.md │ │ │ │ └── Getting an Interaction Response.md │ │ │ ├── login_setup │ │ │ │ ├── Adding a Command.md │ │ │ │ ├── Login-Instantiation.md │ │ │ │ └── beginnernotes.md │ │ │ ├── messages │ │ │ │ ├── Bulk Deleting Messages.md │ │ │ │ ├── Creating a Message.md │ │ │ │ ├── Crossposting a Message.md │ │ │ │ ├── Deleting a Message.md │ │ │ │ ├── Editing a Message.md │ │ │ │ ├── Getting Channel Messages.md │ │ │ │ ├── Getting Pinned Messages.md │ │ │ │ ├── Getting a Message.md │ │ │ │ ├── Pinning a Message.md │ │ │ │ └── UnPinning a Message.md │ │ │ ├── modals │ │ │ │ ├── Collecting Modal Input.md │ │ │ │ └── Instantiating-Creating a Modal.md │ │ │ ├── music_bot │ │ │ │ ├── Clear.md │ │ │ │ ├── Disconnect.md │ │ │ │ ├── Help.md │ │ │ │ ├── HelperFunctions.md │ │ │ │ ├── LoopAll.md │ │ │ │ ├── LoopSong.md │ │ │ │ ├── MBot Introduction.md │ │ │ │ ├── Music-Bot Guide.md │ │ │ │ ├── Np.md │ │ │ │ ├── Pause.md │ │ │ │ ├── Play.md │ │ │ │ ├── PlayQ.md │ │ │ │ ├── PlayRN.md │ │ │ │ ├── Queue.md │ │ │ │ ├── SetMusicChannel.md │ │ │ │ ├── Skip.md │ │ │ │ └── Stop.md │ │ │ ├── reactions │ │ │ │ ├── Creating a Guild Emoji.md │ │ │ │ ├── Creating a Reaction.md │ │ │ │ ├── Deleting All Reactions For Emoji.md │ │ │ │ ├── Deleting All Reactions.md │ │ │ │ ├── Deleting Own Reaction.md │ │ │ │ ├── Deleting User Reaction.md │ │ │ │ ├── Deleting a Guild Emoji.md │ │ │ │ ├── Getting Reactions.md │ │ │ │ ├── Getting a Guild Emoji.md │ │ │ │ ├── Getting a List of Guild Emoji.md │ │ │ │ └── Modifying a Guild Emoji.md │ │ │ ├── roles │ │ │ │ ├── Adding a Role to a Guild Member.md │ │ │ │ ├── Creating a Guild Role.md │ │ │ │ ├── Getting Guild Roles.md │ │ │ │ ├── Getting a Role.md │ │ │ │ ├── Modifying Guild Role Positions.md │ │ │ │ ├── Modifying a Guild Role.md │ │ │ │ ├── Removing a Guild Role.md │ │ │ │ └── Removing a Role From a Guild Member.md │ │ │ ├── select_menus │ │ │ │ ├── Collecting Select-Menu Input.md │ │ │ │ └── Instantiating-Creating a Select-Menu.md │ │ │ ├── stage_instances │ │ │ │ ├── Creating a Stage Instance.md │ │ │ │ ├── Deleting a Stage Instance.md │ │ │ │ ├── Getting a Stage Instance.md │ │ │ │ └── Modifying a Stage Instance.md │ │ │ ├── stickers │ │ │ │ ├── Creating a Guild Sticker.md │ │ │ │ ├── Deleting a Guild Sticker.md │ │ │ │ ├── Getting Nitro Sticker Packs.md │ │ │ │ ├── Getting a List of Guild Stickers.md │ │ │ │ ├── Getting a Sticker.md │ │ │ │ └── Modifying a Guild Sticker.md │ │ │ ├── threads │ │ │ │ ├── Adding a User to a Thread.md │ │ │ │ ├── Getting Joined Private Archived Threads.md │ │ │ │ ├── Getting Private Archived Threads.md │ │ │ │ ├── Getting Public Archived Threads.md │ │ │ │ ├── Getting a List of Active Threads.md │ │ │ │ ├── Getting a List of Thread Members.md │ │ │ │ ├── Getting a Thread Member.md │ │ │ │ ├── Joining a Thread.md │ │ │ │ ├── Listing Active Threads.md │ │ │ │ ├── Removing a User from a Thread.md │ │ │ │ ├── Starting a Thread With a Message.md │ │ │ │ ├── Starting a Thread Without a Message.md │ │ │ │ └── Starting a Thread in a Forum Channel.md │ │ │ ├── users │ │ │ │ ├── Adding a Recipient to a Group DM.md │ │ │ │ ├── Getting Current User Application Info.md │ │ │ │ ├── Getting Current User Authorization Info.md │ │ │ │ ├── Getting User Connections.md │ │ │ │ ├── Getting a User.md │ │ │ │ ├── Getting the Current User.md │ │ │ │ ├── Modifying Current User's Voice State.md │ │ │ │ ├── Modifying a User's Voice State.md │ │ │ │ ├── Modifying the Current User.md │ │ │ │ └── Removing a Recipient from a Group DM.md │ │ │ ├── voice_connections │ │ │ │ └── Connecting-To-Disconnecting from a Channel.md │ │ │ └── webhooks │ │ │ │ ├── Creating a WebHook.md │ │ │ │ ├── Deleting a WebHook Message.md │ │ │ │ ├── Deleting a WebHook with Token.md │ │ │ │ ├── Deleting a WebHook.md │ │ │ │ ├── Editing a WebHook Message.md │ │ │ │ ├── Executing a WebHook.md │ │ │ │ ├── Getting Channel WebHooks.md │ │ │ │ ├── Getting Guild WebHooks.md │ │ │ │ ├── Getting a WebHook Message.md │ │ │ │ ├── Getting a WebHook with Token.md │ │ │ │ ├── Getting a WebHook.md │ │ │ │ ├── Modifying a WebHook with Token.md │ │ │ │ └── Modifying a WebHook.md │ │ └── guides.md │ ├── Doxyfile │ ├── Doxyfile.bak │ ├── DoxygenLayout.xml │ └── Images │ │ └── TheLogo.png └── Images │ ├── Message-Command.png │ ├── Modal-01.png │ ├── Modal-02.png │ ├── Rate-Limit.png │ ├── Select-Menu-01.png │ ├── Select-Menu-02.png │ ├── Slash-Commands and Buttons.png │ ├── TheLogo.ico │ ├── TheLogo.png │ ├── TheLogo01.png │ └── User-Command.png ├── Include └── discordcoreapi │ ├── ApplicationCommandEntities.hpp │ ├── AutoModerationEntities.hpp │ ├── ChannelEntities.hpp │ ├── CoRoutine.hpp │ ├── CommandController.hpp │ ├── DiscordCoreClient.hpp │ ├── EventManager.hpp │ ├── FoundationEntities.hpp │ ├── GuildEntities.hpp │ ├── GuildMemberEntities.hpp │ ├── GuildScheduledEventEntities.hpp │ ├── Index.hpp │ ├── InputEvents.hpp │ ├── InteractionEntities.hpp │ ├── JsonSpecializations.hpp │ ├── MessageEntities.hpp │ ├── ReactionEntities.hpp │ ├── RoleEntities.hpp │ ├── SongAPI.hpp │ ├── SoundCloudAPI.hpp │ ├── StageInstanceEntities.hpp │ ├── StickerEntities.hpp │ ├── ThreadEntities.hpp │ ├── ToEntity.hpp │ ├── UserEntities.hpp │ ├── Utilities.hpp │ ├── Utilities │ ├── AudioDecoder.hpp │ ├── AudioEncoder.hpp │ ├── Base.hpp │ ├── CoRoutineThreadPool.hpp │ ├── Config.hpp │ ├── Demuxers.hpp │ ├── Etf.hpp │ ├── EventEntities.hpp │ ├── Hash.hpp │ ├── HttpsClient.hpp │ ├── ISA │ │ ├── AVX.hpp │ │ ├── AVX2.hpp │ │ ├── AVX512.hpp │ │ ├── Fallback.hpp │ │ ├── ISADetectionBase.hpp │ │ └── Neon.hpp │ ├── ISADetection.hpp │ ├── ObjectCache.hpp │ ├── RateLimitQueue.hpp │ ├── RingBuffer.hpp │ ├── TCPConnection.hpp │ ├── UDPConnection.hpp │ ├── UnboundedMessageBlock.hpp │ ├── UnicodeEmoji.hpp │ ├── UniquePtr.hpp │ ├── UnorderedMap.hpp │ ├── UnorderedSet.hpp │ └── WebSocketClient.hpp │ ├── VoiceConnection.hpp │ ├── WebHookEntities.hpp │ └── YouTubeAPI.hpp ├── Library └── CMakeLists.txt ├── License.md ├── ReadMe.md ├── Source ├── ApplicationCommandEntities.cpp ├── AutoModerationEntities.cpp ├── ChannelEntities.cpp ├── CommandController.cpp ├── DiscordCoreClient.cpp ├── DllMain.cpp ├── EventManager.cpp ├── FoundationEntities.cpp ├── GuildEntities.cpp ├── GuildMemberEntities.cpp ├── GuildScheduledEventEntities.cpp ├── HttpsClient.cpp ├── InputEvents.cpp ├── InteractionEntities.cpp ├── MessageEntities.cpp ├── ReactionEntities.cpp ├── RoleEntities.cpp ├── SongAPI.cpp ├── SoundCloudAPI.cpp ├── StageInstanceEntities.cpp ├── StickerEntities.cpp ├── ThreadEntities.cpp ├── UserEntities.cpp ├── Utilities.cpp ├── VoiceConnection.cpp ├── WebHookEntities.cpp ├── WebSocketClient.cpp └── YouTubeAPI.cpp ├── Tests ├── CMakeLists.txt ├── Commands │ └── BotInfo.hpp └── main.cpp └── Vcpkg ├── ports └── discordcoreapi │ ├── portfile.cmake │ └── vcpkg.json └── versions └── d- └── discordcoreapi.json /.github/FUNDING.yml: -------------------------------------------------------------------------------- 1 | custom: ['https://www.paypal.com/donate/?hosted_button_id=Z6RURQ8UCLQHY'] 2 | -------------------------------------------------------------------------------- /.github/ISSUE_TEMPLATE/feature_request.md: -------------------------------------------------------------------------------- 1 | --- 2 | name: Feature request 3 | about: Suggest an idea for this project 4 | title: '' 5 | labels: '' 6 | assignees: '' 7 | 8 | --- 9 | 10 | **Is your feature request related to a problem? Please describe.** 11 | A clear and concise description of what the problem is. Ex. I'm always frustrated when [...] 12 | 13 | **Describe the solution you'd like** 14 | A clear and concise description of what you want to happen. 15 | 16 | **Describe alternatives you've considered** 17 | A clear and concise description of any alternative solutions or features you've considered. 18 | 19 | **Additional context** 20 | Add any other context or screenshots about the feature request here. 21 | -------------------------------------------------------------------------------- /.github/workflows/Build-Documentation.yml: -------------------------------------------------------------------------------- 1 | name: Build/Upload Documentation. 2 | on: 3 | push: 4 | branches: 5 | - main 6 | 7 | jobs: 8 | Build-Documentation: 9 | name: Build Documentation 10 | runs-on: ubuntu-22.04 11 | 12 | steps: 13 | - name: Download and install Doxygen, along with its dependencies. 14 | run: | 15 | sudo apt-get update 16 | sudo git clone https://github.com/doxygen/doxygen 17 | cd doxygen 18 | sudo mkdir build 19 | sudo cmake -G "Unix Makefiles" 20 | sudo make 21 | sudo make install 22 | sudo apt-get install bison 23 | sudo apt-get install flex 24 | sudo apt-get install graphviz 25 | 26 | - name: Collect the original Repo for the docs. 27 | run: | 28 | sudo git config --global user.email "40668522+RealTimeChris@users.noreply.github.com" 29 | sudo git config --global user.name "realtimechris" 30 | sudo git clone https://realtimechris:${{ secrets.PERSONAL_ACCESS_TOKEN }}@github.com/realtimechris/DiscordCoreAPI-Docs --depth=1 31 | 32 | - name: Collect the documentation and generate it. 33 | run: | 34 | sudo git clone https://github.com/RealTimeChris/DiscordCoreAPI --depth=1 35 | cd DiscordCoreAPI/Documentation/Doxygen 36 | sudo doxygen || true 37 | 38 | - name: Commit and push the docs to the repo. 39 | run: | 40 | cd DiscordCoreAPI-Docs 41 | sudo git add . 42 | sudo git commit -m "Updates!" || true 43 | sudo git push origin main || true -------------------------------------------------------------------------------- /.github/workflows/Construct-Vcpkg-Info.yml: -------------------------------------------------------------------------------- 1 | name: Prepare release for VCPKG 2 | 3 | on: 4 | release: 5 | types: [published,edited] 6 | workflow_dispatch: 7 | 8 | jobs: 9 | Collect-Vcpkg-Info: 10 | runs-on: ubuntu-latest 11 | steps: 12 | - name: Setup PHP 13 | uses: shivammathur/setup-php@v2 14 | with: 15 | php-version: '8.1' 16 | 17 | - name: Checkout DiscordCoreAPI 18 | uses: actions/checkout@v2 19 | with: 20 | submodules: recursive 21 | 22 | - name: Update vcpkg and install other dependencies 23 | run: sudo apt-get update && 24 | sudo apt-get install nasm linux-headers-$(uname -r) && 25 | cd /usr/local/share/vcpkg && 26 | sudo ./bootstrap-vcpkg.sh && 27 | sudo git stash && 28 | sudo git pull && 29 | sudo vcpkg update 30 | 31 | - name: Run vcpkg release builder 32 | run: git fetch -avt && 33 | cd BuildTools && 34 | php make_vcpkg.php "${{ github.repository_owner }}" "${{ secrets.GITHUB_TOKEN }}" 35 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | .vs/ 2 | Build/ 3 | Documentation/Doxygen/Breathe 4 | out/ 5 | Output Files/ 6 | Install/ -------------------------------------------------------------------------------- /BuildTools/Vendor/Composer/LICENSE: -------------------------------------------------------------------------------- 1 | 2 | Copyright (c) Nils Adermann, Jordi Boggiano 3 | 4 | Permission is hereby granted, free of charge, to any person obtaining a copy 5 | of this software and associated documentation files (the "Software"), to deal 6 | in the Software without restriction, including without limitation the rights 7 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 8 | copies of the Software, and to permit persons to whom the Software is furnished 9 | to do so, subject to the following conditions: 10 | 11 | The above copyright notice and this permission notice shall be included in all 12 | copies or substantial portions of the Software. 13 | 14 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 15 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 16 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 17 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 18 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 19 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 20 | THE SOFTWARE. 21 | 22 | -------------------------------------------------------------------------------- /BuildTools/Vendor/Composer/autoload_classmap.php: -------------------------------------------------------------------------------- 1 | $vendorDir . '/Composer/InstalledVersions.php', 10 | ); 11 | -------------------------------------------------------------------------------- /BuildTools/Vendor/Composer/autoload_namespaces.php: -------------------------------------------------------------------------------- 1 | array($baseDir . '/Classes'), 10 | ); 11 | -------------------------------------------------------------------------------- /BuildTools/Vendor/Composer/autoload_real.php: -------------------------------------------------------------------------------- 1 | register(true); 33 | 34 | return $loader; 35 | } 36 | } 37 | -------------------------------------------------------------------------------- /BuildTools/Vendor/Composer/autoload_static.php: -------------------------------------------------------------------------------- 1 | 11 | array ( 12 | 'DiscordCoreAPI\\' => 4, 13 | ), 14 | ); 15 | 16 | public static $prefixDirsPsr4 = array ( 17 | 'DiscordCoreAPI\\' => 18 | array ( 19 | 0 => __DIR__ . '/../..' . '/Classes', 20 | ), 21 | ); 22 | 23 | public static $classMap = array ( 24 | 'Composer\\InstalledVersions' => __DIR__ . '/..' . '/Composer/InstalledVersions.php', 25 | ); 26 | 27 | public static function getInitializer(ClassLoader $loader) 28 | { 29 | return \Closure::bind(function () use ($loader) { 30 | $loader->prefixLengthsPsr4 = ComposerStaticInit0e8415491642f27914717986db49b1db::$prefixLengthsPsr4; 31 | $loader->prefixDirsPsr4 = ComposerStaticInit0e8415491642f27914717986db49b1db::$prefixDirsPsr4; 32 | $loader->classMap = ComposerStaticInit0e8415491642f27914717986db49b1db::$classMap; 33 | 34 | }, null, ClassLoader::class); 35 | } 36 | } 37 | -------------------------------------------------------------------------------- /BuildTools/Vendor/autoload.php: -------------------------------------------------------------------------------- 1 | ) 6 | #include 7 | #else 8 | #include 9 | #include 10 | #endif 11 | #else 12 | // MSVC, Windows SDK 13 | #include 14 | #endif 15 | 16 | LANGUAGE LANG_RUSSIAN, SUBLANG_DEFAULT 17 | 18 | VS_VERSION_INFO VERSIONINFO 19 | FILEVERSION FILE_VERSION_RESOURCE 20 | PRODUCTVERSION PRODUCT_VERSION_RESOURCE 21 | FILEFLAGSMASK 0x3fL 22 | #if defined _DEBUG 23 | FILEFLAGS 0x1L 24 | #else 25 | FILEFLAGS 0x0L 26 | #endif 27 | FILEOS 0x4L 28 | FILETYPE 0x1L 29 | FILESUBTYPE 0x0L 30 | BEGIN 31 | BLOCK "StringFileInfo" 32 | BEGIN 33 | BLOCK "000904b0" 34 | BEGIN 35 | VALUE "Comments", PRODUCT_COMMENTS 36 | VALUE "CompanyName", PRODUCT_COMPANY_NAME 37 | VALUE "FileDescription", PRODUCT_FILE_DESCRIPTION 38 | VALUE "FileVersion", FILE_VERSION_RESOURCE_STR 39 | VALUE "InternalName", PRODUCT_INTERNAL_NAME 40 | VALUE "LegalCopyright", PRODUCT_COMPANY_COPYRIGHT 41 | VALUE "OriginalFilename", PRODUCT_ORIGINAL_FILENAME 42 | VALUE "ProductName", PRODUCT_BUNDLE 43 | VALUE "ProductVersion", PRODUCT_VERSION_RESOURCE_STR 44 | END 45 | END 46 | BLOCK "VarFileInfo" 47 | BEGIN 48 | VALUE "Translation", 0x9, 1200 49 | END 50 | END 51 | -------------------------------------------------------------------------------- /CMakePresets.json: -------------------------------------------------------------------------------- 1 | { 2 | "version": 3, 3 | "configurePresets": [ 4 | { 5 | "name": "windows-base", 6 | "hidden": true, 7 | "generator": "Visual Studio 17 2022", 8 | "binaryDir": "${sourceDir}/out/build/${presetName}", 9 | "installDir": "${sourceDir}/out/install/${presetName}", 10 | "cacheVariables": { 11 | "CMAKE_C_COMPILER": "cl.exe", 12 | "CMAKE_CXX_COMPILER": "cl.exe" 13 | }, 14 | "condition": { 15 | "type": "equals", 16 | "lhs": "${hostSystemName}", 17 | "rhs": "Windows" 18 | } 19 | }, 20 | { 21 | "name": "x64-debug", 22 | "displayName": "x64 Debug", 23 | "inherits": "windows-base", 24 | "architecture": { 25 | "value": "x64", 26 | "strategy": "external" 27 | }, 28 | "cacheVariables": { 29 | "CMAKE_BUILD_TYPE": "Debug" 30 | } 31 | }, 32 | { 33 | "name": "x64-release", 34 | "displayName": "x64 Release", 35 | "inherits": "x64-debug", 36 | "cacheVariables": { 37 | "CMAKE_BUILD_TYPE": "Release" 38 | } 39 | }, 40 | { 41 | "name": "x64-debug-dev", 42 | "displayName": "x64 Debug Dev", 43 | "inherits": "windows-base", 44 | "architecture": { 45 | "value": "x64", 46 | "strategy": "external" 47 | }, 48 | "cacheVariables": { 49 | "CMAKE_BUILD_TYPE": "Debug", 50 | "DEV": true 51 | } 52 | }, 53 | { 54 | "name": "x64-release-dev", 55 | "displayName": "x64 Release Dev", 56 | "inherits": "x64-debug-dev", 57 | "cacheVariables": { 58 | "CMAKE_BUILD_TYPE": "Release", 59 | "DEV": true 60 | } 61 | } 62 | ] 63 | } 64 | -------------------------------------------------------------------------------- /Documentation/Doxygen/Docs/01_login_setup.md: -------------------------------------------------------------------------------- 1 | Login/Setup {#login_setup} 2 | ============ 3 | 4 | * \subpage beginner_notes 5 | 6 | * \subpage login_and_instantiation 7 | 8 | * \subpage adding_a_command -------------------------------------------------------------------------------- /Documentation/Doxygen/Docs/03_general_usage.md: -------------------------------------------------------------------------------- 1 | General Usage {#general_usage} 2 | ============ 3 | 4 | * \subpage running_a_command 5 | 6 | * \subpage running_a_function_on_a_timer 7 | 8 | * \subpage listening_for_an_event 9 | 10 | * \subpage using_a_message_collector 11 | -------------------------------------------------------------------------------- /Documentation/Doxygen/Docs/04_auto_completes.md: -------------------------------------------------------------------------------- 1 | Autocompletes {#auto_completes} 2 | ============ 3 | * \subpage creating_an_auto_complete 4 | 5 | * \subpage collecting_auto_complete_input 6 | -------------------------------------------------------------------------------- /Documentation/Doxygen/Docs/05_buttons.md: -------------------------------------------------------------------------------- 1 | Buttons {#buttons} 2 | ============ 3 | * \subpage creating_a_button 4 | 5 | * \subpage collecting_button_input 6 | -------------------------------------------------------------------------------- /Documentation/Doxygen/Docs/06_select_menus.md: -------------------------------------------------------------------------------- 1 | Select Menus {#select_menus} 2 | ============ 3 | * \subpage creating_a_select_menu 4 | 5 | * \subpage collecting_select_menu_input 6 | -------------------------------------------------------------------------------- /Documentation/Doxygen/Docs/07_modals.md: -------------------------------------------------------------------------------- 1 | Modals {#modals} 2 | ============ 3 | * \subpage creating_a_modal 4 | 5 | * \subpage collecting_modal_input -------------------------------------------------------------------------------- /Documentation/Doxygen/Docs/08_voice_connections.md: -------------------------------------------------------------------------------- 1 | Voice Connections {#voice_connections} 2 | ============ 3 | * \subpage connecting_and_disconnecting 4 | -------------------------------------------------------------------------------- /Documentation/Doxygen/Docs/09_application_commands.md: -------------------------------------------------------------------------------- 1 | Application-Commands {#application_commands} 2 | ============ 3 | * \subpage get_global_commands 4 | 5 | * \subpage create_global_command 6 | 7 | * \subpage get_global_command 8 | 9 | * \subpage edit_global_command 10 | 11 | * \subpage delete_global_command 12 | 13 | * \subpage bulk_overwrite_global_commands 14 | 15 | * \subpage get_guild_commands 16 | 17 | * \subpage create_guild_command 18 | 19 | * \subpage get_guild_command 20 | 21 | * \subpage edit_guild_command 22 | 23 | * \subpage delete_guild_command 24 | 25 | * \subpage bulk_overwrite_guild_commands 26 | 27 | * \subpage get_guild_command_permissions 28 | 29 | * \subpage get_single_command_permissions 30 | 31 | * \subpage edit_guild_command_permissions 32 | 33 | * \subpage batch_edit_guild_command_permissions 34 | -------------------------------------------------------------------------------- /Documentation/Doxygen/Docs/10_auto_moderation_rules.md: -------------------------------------------------------------------------------- 1 | Auto-Moderation-Rules {#auto_moderation_rules} 2 | ============ 3 | * \subpage list_auto_moderation_rules 4 | 5 | * \subpage get_auto_moderation_rule 6 | 7 | * \subpage create_auto_moderation_rule 8 | 9 | * \subpage modify_auto_moderation_rule 10 | 11 | * \subpage delete_auto_moderation_rule 12 | -------------------------------------------------------------------------------- /Documentation/Doxygen/Docs/11_channels.md: -------------------------------------------------------------------------------- 1 | Channels {#channels} 2 | ============ 3 | * \subpage getting_channel 4 | 5 | * \subpage modifying_channel 6 | 7 | * \subpage deleting_channel 8 | 9 | * \subpage getting_dm_channel 10 | 11 | * \subpage editing_permission_overwrites 12 | 13 | * \subpage getting_channel_invites 14 | 15 | * \subpage creating_channel_invites 16 | 17 | * \subpage deleting_permission_overwrites 18 | 19 | * \subpage following_news_channel 20 | 21 | * \subpage triggering_the_typing_indicator 22 | 23 | * \subpage getting_guild_channels 24 | 25 | * \subpage creating_guild_channel 26 | 27 | * \subpage modifying_guild_channel_positions 28 | 29 | * \subpage creating_a_dm 30 | 31 | * \subpage getting_voice_regions 32 | -------------------------------------------------------------------------------- /Documentation/Doxygen/Docs/12_guilds.md: -------------------------------------------------------------------------------- 1 | Guilds {#guilds} 2 | ============ 3 | * \subpage getting_audit_logs 4 | 5 | * \subpage creating_a_guild 6 | 7 | * \subpage getting_all_guilds 8 | 9 | * \subpage getting_a_guild 10 | 11 | * \subpage getting_a_guild_preview 12 | 13 | * \subpage modifying_a_guild 14 | 15 | * \subpage deleting_a_guild 16 | 17 | * \subpage getting_guild_bans 18 | 19 | * \subpage getting_a_guild_ban 20 | 21 | * \subpage creating_a_guild_ban 22 | 23 | * \subpage removing_a_guild_ban 24 | 25 | * \subpage getting_a_guild_prune_count 26 | 27 | * \subpage beginning_a_guild_prune 28 | 29 | * \subpage getting_guild_voice_regions 30 | 31 | * \subpage getting_guild_invites 32 | 33 | * \subpage getting_guild_integrations 34 | 35 | * \subpage deleting_a_guild_integration 36 | 37 | * \subpage getting_guild_widget_settings 38 | 39 | * \subpage modifying_a_guild_widget 40 | 41 | * \subpage getting_a_guild_widget 42 | 43 | * \subpage getting_a_guild_vanity_invite 44 | 45 | * \subpage getting_a_guild_widget_image 46 | 47 | * \subpage getting_a_guild_welcome_screen 48 | 49 | * \subpage modifying_a_guild_welcome_screen 50 | 51 | * \subpage getting_a_guild_template 52 | 53 | * \subpage creating_a_guild_from_a_guild_template 54 | 55 | * \subpage getting_guild_templates 56 | 57 | * \subpage creating_a_guild_template 58 | 59 | * \subpage syncing_a_guild_template 60 | 61 | * \subpage modifying_a_guild_template 62 | 63 | * \subpage deleting_a_guild_template 64 | 65 | * \subpage getting_an_invite 66 | 67 | * \subpage getting_current_users_guilds 68 | 69 | * \subpage leaving_a_guild 70 | -------------------------------------------------------------------------------- /Documentation/Doxygen/Docs/13_guild_members.md: -------------------------------------------------------------------------------- 1 | Guild-Members {#guild_members} 2 | ============ 3 | * \subpage getting_a_guild_member 4 | 5 | * \subpage listing_guild_members 6 | 7 | * \subpage searching_guild_members 8 | 9 | * \subpage adding_a_guild_member 10 | 11 | * \subpage modifying_a_guild_member 12 | 13 | * \subpage modifying_the_current_guild_member 14 | 15 | * \subpage removing_a_guild_member -------------------------------------------------------------------------------- /Documentation/Doxygen/Docs/14_guild_scheduled_events.md: -------------------------------------------------------------------------------- 1 | Guild Scheduled Events {#guild_scheduled_events} 2 | ============ 3 | * \subpage getting_a_list_of_guild_scheduled_events 4 | 5 | * \subpage creating_a_guild_scheduled_event 6 | 7 | * \subpage getting_a_guild_scheduled_event 8 | 9 | * \subpage modifying_a_guild_scheduled_event 10 | 11 | * \subpage deleting_a_guild_scheduled_event 12 | 13 | * \subpage getting_guild_scheduled_event_users 14 | -------------------------------------------------------------------------------- /Documentation/Doxygen/Docs/15_input_events.md: -------------------------------------------------------------------------------- 1 | Input Events {#input_events} 2 | ============ 3 | * \subpage creating_an_input_event_response 4 | 5 | * \subpage editing_an_input_event_response 6 | 7 | * \subpage deleting_an_input_event_response -------------------------------------------------------------------------------- /Documentation/Doxygen/Docs/16_interactions.md: -------------------------------------------------------------------------------- 1 | Interactions {#interactions} 2 | ============ 3 | * \subpage creating_an_interaction_response 4 | 5 | * \subpage getting_an_interaction_response 6 | 7 | * \subpage editing_an_interaction_response 8 | 9 | * \subpage deleting_an_interaction_response 10 | 11 | * \subpage creating_a_follow_up_message 12 | 13 | * \subpage getting_a_follow_up_message 14 | 15 | * \subpage editing_a_follow_up_message 16 | 17 | * \subpage deleting_a_follow_up_message -------------------------------------------------------------------------------- /Documentation/Doxygen/Docs/17_messages.md: -------------------------------------------------------------------------------- 1 | Messages {#messages} 2 | ============ 3 | * \subpage getting_channel_messages 4 | 5 | * \subpage getting_a_message 6 | 7 | * \subpage creating_a_message 8 | 9 | * \subpage crossposting_a_message 10 | 11 | * \subpage editing_a_message 12 | 13 | * \subpage deleting_a_message 14 | 15 | * \subpage bulk_deleting_messages 16 | 17 | * \subpage getting_pinned_messages 18 | 19 | * \subpage pinning_a_message 20 | 21 | * \subpage unpinning_a_message 22 | -------------------------------------------------------------------------------- /Documentation/Doxygen/Docs/18_reactions.md: -------------------------------------------------------------------------------- 1 | Reactions {#reactions} 2 | ============ 3 | * \subpage creating_a_reaction 4 | 5 | * \subpage deleting_own_reaction 6 | 7 | * \subpage deleting_user_reaction 8 | 9 | * \subpage getting_reactions 10 | 11 | * \subpage deleting_all_reactions 12 | 13 | * \subpage deleting_all_reactions_for_emoji 14 | 15 | * \subpage getting_a_list_of_guild_emoji 16 | 17 | * \subpage getting_a_guild_emoji 18 | 19 | * \subpage creating_a_guild_emoji 20 | 21 | * \subpage modifying_a_guild_emoji 22 | 23 | * \subpage deleting_a_guild_emoji 24 | -------------------------------------------------------------------------------- /Documentation/Doxygen/Docs/19_roles.md: -------------------------------------------------------------------------------- 1 | Roles {#roles} 2 | ============ 3 | * \subpage adding_a_role_to_a_guild_member 4 | 5 | * \subpage removing_a_role_from_a_guild_member 6 | 7 | * \subpage getting_guild_roles 8 | 9 | * \subpage getting_a_role 10 | 11 | * \subpage creating_a_guild_role 12 | 13 | * \subpage modifying_guild_role_positions 14 | 15 | * \subpage modifying_a_guild_role 16 | 17 | * \subpage removing_a_guild_role 18 | -------------------------------------------------------------------------------- /Documentation/Doxygen/Docs/20_stage_instances.md: -------------------------------------------------------------------------------- 1 | Stage-Instances {#stage_instances} 2 | ============ 3 | * \subpage creating_a_stage_instance 4 | 5 | * \subpage getting_a_stage_instance 6 | 7 | * \subpage modifying_a_stage_instance 8 | 9 | * \subpage deleting_a_stage_instance -------------------------------------------------------------------------------- /Documentation/Doxygen/Docs/21_stickers.md: -------------------------------------------------------------------------------- 1 | Stickers {#stickers} 2 | ============ 3 | * \subpage getting_a_sticker 4 | 5 | * \subpage getting_nitro_sticker_packs 6 | 7 | * \subpage getting_a_list_of_guild_stickers 8 | 9 | * \subpage creating_a_guild_sticker 10 | 11 | * \subpage modifying_a_guild_sticker 12 | 13 | * \subpage deleting_a_guild_sticker -------------------------------------------------------------------------------- /Documentation/Doxygen/Docs/22_threads.md: -------------------------------------------------------------------------------- 1 | Threads {#threads} 2 | ============ 3 | * \subpage starting_a_thread_with_a_message 4 | 5 | * \subpage starting_a_thread_without_a_message 6 | 7 | * \subpage starting_a_thread_in_a_forum_channel 8 | 9 | * \subpage joining_a_thread 10 | 11 | * \subpage adding_a_user_to_a_thread 12 | 13 | * \subpage removing_a_user_from_a_thread 14 | 15 | * \subpage getting_a_thread_member 16 | 17 | * \subpage getting_a_list_of_thread_members 18 | 19 | * \subpage getting_a_list_of_active_threads 20 | 21 | * \subpage getting_public_archived_threads 22 | 23 | * \subpage getting_private_archived_threads 24 | 25 | * \subpage getting_joined_private_archived_threads 26 | 27 | * \subpage listing_active_threads -------------------------------------------------------------------------------- /Documentation/Doxygen/Docs/23_users.md: -------------------------------------------------------------------------------- 1 | Users {#users} 2 | ============ 3 | * \subpage adding_a_recipient_to_a_group_dm 4 | 5 | * \subpage removing_a_recipient_from_a_group_dm 6 | 7 | * \subpage modifying_current_user_voice_state 8 | 9 | * \subpage modifying_a_user_voice_state 10 | 11 | * \subpage getting_the_current_user 12 | 13 | * \subpage getting_a_user 14 | 15 | * \subpage modifying_the_current_user 16 | 17 | * \subpage getting_user_connections 18 | 19 | * \subpage getting_current_user_application_info 20 | 21 | * \subpage getting_current_user_authorization_info -------------------------------------------------------------------------------- /Documentation/Doxygen/Docs/24_webhooks.md: -------------------------------------------------------------------------------- 1 | Webhooks {#webhooks} 2 | ============ 3 | * \subpage creating_a_web_hook 4 | 5 | * \subpage getting_channel_web_hooks 6 | 7 | * \subpage getting_guild_web_hooks 8 | 9 | * \subpage getting_a_web_hook 10 | 11 | * \subpage getting_a_web_hook_with_a_token 12 | 13 | * \subpage modifying_a_web_hook 14 | 15 | * \subpage modifying_a_web_hook_with_a_token 16 | 17 | * \subpage deleting_a_web_hook 18 | 19 | * \subpage deleting_a_web_hook_with_a_token 20 | 21 | * \subpage executing_a_web_hook 22 | 23 | * \subpage getting_a_web_hook_message 24 | 25 | * \subpage editing_a_web_hook_message 26 | 27 | * \subpage deleting_a_web_hook_message -------------------------------------------------------------------------------- /Documentation/Doxygen/Docs/documentation_examples.md: -------------------------------------------------------------------------------- 1 | C++ Discord Bot Documentation/Examples {#documentation_examples} 2 | ============ 3 | - \subpage login_setup 4 | - \subpage general_usage 5 | - \subpage auto_completes 6 | - \subpage buttons 7 | - \subpage select_menus 8 | - \subpage modals 9 | - \subpage voice_connections 10 | - \subpage application_commands 11 | - \subpage auto_moderation_rules 12 | - \subpage channels 13 | - \subpage guilds 14 | - \subpage guild_members 15 | - \subpage guild_scheduled_events 16 | - \subpage input_events 17 | - \subpage interactions 18 | - \subpage messages 19 | - \subpage reactions 20 | - \subpage roles 21 | - \subpage stage_instances 22 | - \subpage stickers 23 | - \subpage threads 24 | - \subpage users 25 | - \subpage webhooks -------------------------------------------------------------------------------- /Documentation/Doxygen/Docs/documentation_examples/application_commands/Deleting a Global Application Command.md: -------------------------------------------------------------------------------- 1 | Deleting a Global Application Command {#delete_global_command} 2 | ============ 3 | - Execute the `discord_core_api::application_commands::deleteGlobalApplicationCommandAsync()` function, while passing in a data structure of type `discord_core_api::delete_global_application_command_data`, with no return value. 4 | - call the function with `discord_core_api::co_routine::get()` added to the end in order to wait for the results now. 5 | 6 | ```cpp 7 | /// Test.hpp -header for the "test" command. 8 | /// https://github.com/RealTimeChris/DiscordCoreAPI 9 | 10 | #pragma once 11 | 12 | #include "index.hpp" 13 | 14 | namespace discord_core_api { 15 | 16 | class test : public base_function { 17 | public: 18 | test() { 19 | commandName = "test"; 20 | helpDescription = "testing purposes!"; 21 | embed_data msgEmbed; 22 | msgEmbed.setDescription("------\nSimply enter !test or /test!\n------"); 23 | msgEmbed.setTitle("__**test usage:**__"); 24 | msgEmbed.setTimeStamp(getTimeAndDate()); 25 | msgEmbed.setColor("fe_fe_fe"); 26 | helpEmbed = msgEmbed; 27 | } 28 | 29 | unique_ptr create() { 30 | return makeUnique(); 31 | } 32 | 33 | virtual void execute(base_function_arguments& args) { 34 | delete_global_application_command_data& dataPackage; 35 | dataPackage.name = "testcommandname"; 36 | application_commands::deleteGlobalApplicationCommandAsync(dataPackage).get(); 37 | } 38 | }; 39 | } 40 | ``` -------------------------------------------------------------------------------- /Documentation/Doxygen/Docs/documentation_examples/application_commands/Deleting a Guild Application Command.md: -------------------------------------------------------------------------------- 1 | Deleting a Guild Application Command {#delete_guild_command} 2 | ============= 3 | - Execute the `discord_core_api::application_commands::deleteGuildApplicationCommandAsync()` function, while passing in a data structure of type `discord_core_api::delete_guild_application_command_data`, with no return value. 4 | - call the function with `discord_core_api::co_routine::get()` added to the end in order to wait for the results now. 5 | 6 | ```cpp 7 | /// Test.hpp -header for the "test" command. 8 | /// https://github.com/RealTimeChris/DiscordCoreAPI 9 | 10 | #pragma once 11 | 12 | #include "index.hpp" 13 | 14 | namespace discord_core_api { 15 | 16 | class test : public base_function { 17 | public: 18 | test() { 19 | commandName = "test"; 20 | helpDescription = "testing purposes!"; 21 | embed_data msgEmbed; 22 | msgEmbed.setDescription("------\nSimply enter !test or /test!\n------"); 23 | msgEmbed.setTitle("__**test usage:**__"); 24 | msgEmbed.setTimeStamp(getTimeAndDate()); 25 | msgEmbed.setColor("fe_fe_fe"); 26 | helpEmbed = msgEmbed; 27 | } 28 | 29 | unique_ptr create() { 30 | return makeUnique(); 31 | } 32 | 33 | virtual void execute(base_function_arguments& args) { 34 | input_events::deleteInputEventResponseAsync(args.eventData); 35 | 36 | delete_guild_application_command_data& dataPackage01; 37 | dataPackage01.name = "botinfo"; 38 | dataPackage01.guildId = args.eventData.getGuildId(); 39 | 40 | application_commands::deleteGuildApplicationCommandAsync(dataPackage01).get(); 41 | } 42 | }; 43 | } 44 | ``` -------------------------------------------------------------------------------- /Documentation/Doxygen/Docs/documentation_examples/application_commands/Editing a Global Application Command.md: -------------------------------------------------------------------------------- 1 | Editing a Global Application Command {#edit_global_command} 2 | ============ 3 | - Execute the `discord_core_api::application_commands::editGlobalApplicationCommandAsync()` function, while passing in a data structure of type `discord_core_api::edit_global_application_command_data`, with a return value of type `auto` or `discord_core_api::application_command_data`. 4 | - call the function with `discord_core_api::co_routine::get()` added to the end in order to wait for the results now. 5 | 6 | ```cpp 7 | /// Test.hpp -header for the "test" command. 8 | /// https://github.com/RealTimeChris/DiscordCoreAPI 9 | 10 | #pragma once 11 | 12 | #include "index.hpp" 13 | 14 | namespace discord_core_api { 15 | 16 | class test : public base_function { 17 | public: 18 | test() { 19 | commandName = "test"; 20 | helpDescription = "testing purposes!"; 21 | embed_data msgEmbed; 22 | msgEmbed.setDescription("------\nSimply enter !test or /test!\n------"); 23 | msgEmbed.setTitle("__**test usage:**__"); 24 | msgEmbed.setTimeStamp(getTimeAndDate()); 25 | msgEmbed.setColor("fe_fe_fe"); 26 | helpEmbed = msgEmbed; 27 | } 28 | 29 | unique_ptr create() { 30 | return makeUnique(); 31 | } 32 | 33 | virtual void execute(base_function_arguments& args) { 34 | edit_global_application_command_data& dataPackage; 35 | dataPackage.description = "displays info about the current bot."; 36 | dataPackage.name = "botinfo"; 37 | 38 | auto globalApplicationCommand = application_commands::editGlobalApplicationCommandAsync(dataPackage).get(); 39 | 40 | std::cout << globalApplicationCommand.data.name << std::endl; 41 | } 42 | }; 43 | } 44 | 45 | ``` -------------------------------------------------------------------------------- /Documentation/Doxygen/Docs/documentation_examples/application_commands/Get Global Application Commands.md: -------------------------------------------------------------------------------- 1 | Getting Global Application Commands {#get_global_commands} 2 | ============= 3 | - Execute the `discord_core_api::application_commands::getGlobalApplicationCommandsAsync()` function, with a return value of type `auto` or `jsonifier::vector`. 4 | - call the function with `discord_core_api::co_routine::get()` added to the end in order to wait for the results now. 5 | 6 | ```cpp 7 | /// Test.hpp -header for the "test" command. 8 | /// https://github.com/RealTimeChris/DiscordCoreAPI 9 | 10 | #pragma once 11 | 12 | #include "index.hpp" 13 | 14 | namespace discord_core_api { 15 | 16 | class test : public base_function { 17 | public: 18 | test() { 19 | commandName = "test"; 20 | helpDescription = "testing purposes!"; 21 | embed_data msgEmbed; 22 | msgEmbed.setDescription("------\nSimply enter !test or /test!\n------"); 23 | msgEmbed.setTitle("__**test usage:**__"); 24 | msgEmbed.setTimeStamp(getTimeAndDate()); 25 | msgEmbed.setColor("fe_fe_fe"); 26 | helpEmbed = msgEmbed; 27 | } 28 | 29 | unique_ptr create() { 30 | return makeUnique(); 31 | } 32 | 33 | virtual void execute(base_function_arguments& args) { 34 | auto globalApplicationCommands = application_commands::getGlobalApplicationCommandsAsync().get(); 35 | 36 | for (const auto& value: globalApplicationCommands) { 37 | std::cout << value.data.name << std::endl; 38 | } 39 | } 40 | }; 41 | } 42 | ``` -------------------------------------------------------------------------------- /Documentation/Doxygen/Docs/documentation_examples/application_commands/Get Guild Application Commands.md: -------------------------------------------------------------------------------- 1 | Getting Guild Application Commands {#get_guild_commands} 2 | ============= 3 | - Execute the `discord_core_api::application_commands::getGuildApplicationCommandsAsync()` function, while passing in an argument of type `discord_core_api::get_guild_application_commands_data`, with a return value of type `auto` or `jsonifier::vector`. 4 | - call the function with `discord_core_api::co_routine::get()` added to the end in order to wait for the results now. 5 | 6 | ```cpp 7 | /// Test.hpp -header for the "test" command. 8 | /// https://github.com/RealTimeChris/DiscordCoreAPI 9 | 10 | #pragma once 11 | 12 | #include "index.hpp" 13 | 14 | namespace discord_core_api { 15 | 16 | class test : public base_function { 17 | public: 18 | test() { 19 | commandName = "test"; 20 | helpDescription = "testing purposes!"; 21 | embed_data msgEmbed; 22 | msgEmbed.setDescription("------\nSimply enter !test or /test!\n------"); 23 | msgEmbed.setTitle("__**test usage:**__"); 24 | msgEmbed.setTimeStamp(getTimeAndDate()); 25 | msgEmbed.setColor("fe_fe_fe"); 26 | helpEmbed = msgEmbed; 27 | } 28 | 29 | unique_ptr create() { 30 | return makeUnique(); 31 | } 32 | 33 | virtual void execute(base_function_arguments& args) { 34 | input_events::deleteInputEventResponseAsync(args.eventData).get(); 35 | 36 | get_guild_application_commands_data& dataPackage; 37 | dataPackage.guildId = args.eventData.getGuildId(); 38 | 39 | auto returnVector = application_commands::getGuildApplicationCommandsAsync(dataPackage).get(); 40 | 41 | for (const auto& value: returnVector) { 42 | std::cout << value.name << std::endl; 43 | } 44 | } 45 | }; 46 | } 47 | ``` -------------------------------------------------------------------------------- /Documentation/Doxygen/Docs/documentation_examples/application_commands/Getting a Global Application Command.md: -------------------------------------------------------------------------------- 1 | Getting a Global Application Command {#get_global_command} 2 | ============ 3 | - Execute the `discord_core_api::application_commands::getGlobalApplicationCommandAsync()` function, while passing in a data structure of type `discord_core_api::get_global_application_command_data`, with a return value of type `auto` or `discord_core_api::application_command_data`. 4 | - call the function with `discord_core_api::co_routine::get()` added to the end in order to wait for the results now. 5 | 6 | ```cpp 7 | /// Test.hpp -header for the "test" command. 8 | /// https://github.com/RealTimeChris/DiscordCoreAPI 9 | 10 | #pragma once 11 | 12 | #include "index.hpp" 13 | 14 | namespace discord_core_api { 15 | 16 | class test : public base_function { 17 | public: 18 | test() { 19 | commandName = "test"; 20 | helpDescription = "testing purposes!"; 21 | embed_data msgEmbed; 22 | msgEmbed.setDescription("------\nSimply enter !test or /test!\n------"); 23 | msgEmbed.setTitle("__**test usage:**__"); 24 | msgEmbed.setTimeStamp(getTimeAndDate()); 25 | msgEmbed.setColor("fe_fe_fe"); 26 | helpEmbed = msgEmbed; 27 | } 28 | 29 | unique_ptr create() { 30 | return makeUnique(); 31 | } 32 | 33 | virtual void execute(base_function_arguments& args) { 34 | auto globalApplicationCommands = application_commands::getGlobalApplicationCommandsAsync().get(); 35 | 36 | get_global_application_command_data& dataPackage; 37 | dataPackage.commandId = globalApplicationCommands.at(0).data.id; 38 | 39 | auto globalApplicationCommand = application_commands::getGlobalApplicationCommandAsync(dataPackage).get(); 40 | 41 | std::cout << globalApplicationCommand.data.name << std::endl; 42 | } 43 | }; 44 | } 45 | ``` -------------------------------------------------------------------------------- /Documentation/Doxygen/Docs/documentation_examples/auto_moderation_rules/Create Auto-Moderation-Rule.md: -------------------------------------------------------------------------------- 1 | Creating an Auto-Moderation-Rule {#create_auto_moderation_rule} 2 | ============ 3 | [For now it is here.](https://github.com/RealTimeChris/DiscordCoreAPI/blob/main/Source/AutoModerationEntities.cpp#L75) -------------------------------------------------------------------------------- /Documentation/Doxygen/Docs/documentation_examples/auto_moderation_rules/Delete Auto-Moderation-Rule.md: -------------------------------------------------------------------------------- 1 | Deleting an Auto-Moderation-Rule {#delete_auto_moderation_rule} 2 | ============ 3 | [For now it is here.](https://github.com/RealTimeChris/DiscordCoreAPI/blob/main/Source/AutoModerationEntities.cpp#L99) -------------------------------------------------------------------------------- /Documentation/Doxygen/Docs/documentation_examples/auto_moderation_rules/Get Audo-Moderation-Rule.md: -------------------------------------------------------------------------------- 1 | Getting an Auto-Moderation-Rule {#get_auto_moderation_rule} 2 | ============ 3 | [For now it is here.](https://github.com/RealTimeChris/DiscordCoreAPI/blob/main/Source/AutoModerationEntities.cpp#L64) -------------------------------------------------------------------------------- /Documentation/Doxygen/Docs/documentation_examples/auto_moderation_rules/List Auto-Moderation-Rules.md: -------------------------------------------------------------------------------- 1 | Listing Auto-Moderation-Rules {#list_auto_moderation_rules} 2 | ============ 3 | [For now it is here.](https://github.com/RealTimeChris/DiscordCoreAPI/blob/main/Source/AutoModerationEntities.cpp#L53) -------------------------------------------------------------------------------- /Documentation/Doxygen/Docs/documentation_examples/auto_moderation_rules/Modify Auto-Moderation-Rule.md: -------------------------------------------------------------------------------- 1 | Modifying an Auto-Moderation-Rule {#modify_auto_moderation_rule} 2 | ============ 3 | [For now it is here.](https://github.com/RealTimeChris/DiscordCoreAPI/blob/main/Source/AutoModerationEntities.cpp#L87) -------------------------------------------------------------------------------- /Documentation/Doxygen/Docs/documentation_examples/channels/Creating a Direct-Message.md: -------------------------------------------------------------------------------- 1 | Creating a Direct-Message {#creating_a_dm} 2 | ============ 3 | - Execute the, `discord_core_api::channels::createDMChannelAsync()` function, while passing in a data structure of type `discord_core_api::create_dmchannel_data`, with a return value of type `auto` or `discord_core_api::channel_data`. 4 | - call the function with `discord_core_api::co_routine::get()` added to the end in order to wait for the results now. 5 | 6 | ```cpp 7 | /// Test.hpp -header for the "test" command. 8 | /// https://github.com/RealTimeChris/DiscordCoreAPI 9 | 10 | #pragma once 11 | 12 | #include 13 | 14 | namespace discord_core_api { 15 | 16 | class test : public base_function { 17 | public: 18 | test() { 19 | commandName = "test"; 20 | helpDescription = "testing purposes!"; 21 | embed_data msgEmbed; 22 | msgEmbed.setDescription("------\nSimply enter !test or /test!\n------"); 23 | msgEmbed.setTitle("__**test usage:**__"); 24 | msgEmbed.setTimeStamp(getTimeAndDate()); 25 | msgEmbed.setColor("fe_fe_fe"); 26 | helpEmbed = msgEmbed; 27 | } 28 | 29 | unique_ptr create() { 30 | return makeUnique(); 31 | } 32 | 33 | virtual void execute(base_function_arguments& args) { 34 | try { 35 | create_dmchannel_data dataPackage; 36 | dataPackage.userId = args.eventData.getAuthorId(); 37 | 38 | channel dmChannel = discord_core_api::channels::createDMChannelAsync(dataPackage).get(); 39 | 40 | 41 | } catch (...) { 42 | rethrowException("test::execute()"); 43 | } 44 | } 45 | 46 | virtual ~test() = default; 47 | }; 48 | } 49 | ``` 50 | -------------------------------------------------------------------------------- /Documentation/Doxygen/Docs/documentation_examples/channels/Deleting Permission Overwrites.md: -------------------------------------------------------------------------------- 1 | Deleting Permission Overwrites {#deleting_permission_overwrites} 2 | ============ 3 | - Execute the `discord_core_api::channels::deleteChannelPermissionOverwritesAsync()` function, while having passed in a data structure of type `discord_core_api::delete_channel_permission_overwrites_data`. 4 | - call the function with `discord_core_api::co_routine::get()` added to the end in order to wait for its return value now. 5 | 6 | ```cpp 7 | /// Test.hpp -header for the "test" command. 8 | /// https://github.com/RealTimeChris/DiscordCoreAPI 9 | 10 | #pragma once 11 | 12 | #include 13 | 14 | namespace discord_core_api { 15 | 16 | class test : public base_function { 17 | public: 18 | test() { 19 | commandName = "test"; 20 | helpDescription = "testing purposes!"; 21 | embed_data msgEmbed; 22 | msgEmbed.setDescription("------\nSimply enter !test or /test!\n------"); 23 | msgEmbed.setTitle("__**test usage:**__"); 24 | msgEmbed.setTimeStamp(getTimeAndDate()); 25 | msgEmbed.setColor("fe_fe_fe"); 26 | helpEmbed = msgEmbed; 27 | } 28 | 29 | unique_ptr create() { 30 | return makeUnique(); 31 | } 32 | 33 | virtual void execute(base_function_arguments& args) { 34 | delete_channel_permission_overwrites_data dataPackage; 35 | dataPackage.channelId = args.eventData.getChannelId(); 36 | dataPackage.roleOrUserId = args.eventData.getAuthorId(); 37 | 38 | discord_core_api::channels::deleteChannelPermissionOverwritesAsync(dataPackage).get(); 39 | } 40 | }; 41 | } 42 | ``` 43 | -------------------------------------------------------------------------------- /Documentation/Doxygen/Docs/documentation_examples/channels/Deleting a Channel.md: -------------------------------------------------------------------------------- 1 | Deleting/Closing a Channel {#deleting_channel} 2 | ============ 3 | - Execute the `discord_core_api::channels::deleteOrCloseChannelAsync()` function, while passing in a data structure of type `discord_core_api::delete_or_close_channel_data`, with a return value of type `void`. 4 | - call the function with `discord_core_api::co_routine::get()` added to the end in order to wait for its return value now. 5 | 6 | ```cpp 7 | /// Test.hpp -header for the "test" command. 8 | /// https://github.com/RealTimeChris/DiscordCoreAPI 9 | 10 | #pragma once 11 | 12 | #include 13 | 14 | namespace discord_core_api { 15 | 16 | class test : public base_function { 17 | public: 18 | test() { 19 | commandName = "test"; 20 | helpDescription = "testing purposes!"; 21 | embed_data msgEmbed; 22 | msgEmbed.setDescription("------\nSimply enter !test or /test!\n------"); 23 | msgEmbed.setTitle("__**test usage:**__"); 24 | msgEmbed.setTimeStamp(getTimeAndDate()); 25 | msgEmbed.setColor("fe_fe_fe"); 26 | helpEmbed = msgEmbed; 27 | } 28 | 29 | unique_ptr create() { 30 | return makeUnique(); 31 | } 32 | 33 | virtual void execute(base_function_arguments& args) { 34 | try { 35 | delete_or_close_channel_data dataPackage; 36 | dataPackage.channelId = args.eventData.getChannelId(); 37 | dataPackage.reason = "deleting!"; 38 | 39 | discord_core_api::channels::deleteOrCloseChannelAsync(dataPackage).get(); 40 | 41 | 42 | } catch (...) { 43 | rethrowException("test::execute()"); 44 | } 45 | } 46 | }; 47 | } 48 | ``` 49 | -------------------------------------------------------------------------------- /Documentation/Doxygen/Docs/documentation_examples/channels/Following a News Channel.md: -------------------------------------------------------------------------------- 1 | Following a News Channel {#following_news_channel} 2 | ============= 3 | - Execute, the `discord_core_api::channels::followNewsChannelAsync()` function, while having passed in a data structure of type `discord_core_api::follow_news_channel_data` with a return value of `auto` or `discord_core_api::channel_data`. 4 | - call the function with `discord_core_api::co_routine::get()` added to the end in order to wait for the results now. 5 | 6 | ```cpp 7 | /// Test.hpp -header for the "test" command. 8 | /// https://github.com/RealTimeChris/DiscordCoreAPI 9 | 10 | #pragma once 11 | 12 | #include 13 | 14 | namespace discord_core_api { 15 | 16 | class test : public base_function { 17 | public: 18 | test() { 19 | commandName = "test"; 20 | helpDescription = "testing purposes!"; 21 | embed_data msgEmbed; 22 | msgEmbed.setDescription("------\nSimply enter !test or /test!\n------"); 23 | msgEmbed.setTitle("__**test usage:**__"); 24 | msgEmbed.setTimeStamp(getTimeAndDate()); 25 | msgEmbed.setColor("fe_fe_fe"); 26 | helpEmbed = msgEmbed; 27 | } 28 | 29 | unique_ptr create() { 30 | return makeUnique(); 31 | } 32 | 33 | virtual void execute(base_function_arguments& args) { 34 | try { 35 | follow_news_channel_data dataPackage; 36 | dataPackage.targetChannelId = args.eventData.getChannelId(); 37 | dataPackage.channelId = "34565656332236657533"; 38 | 39 | channel followChannel = discord_core_api::channels::followNewsChannelAsync(dataPackage).get(); 40 | 41 | } catch (...) { 42 | rethrowException("test::execute()"); 43 | } 44 | } 45 | }; 46 | } 47 | ``` 48 | -------------------------------------------------------------------------------- /Documentation/Doxygen/Docs/documentation_examples/channels/Getting Guild Channels.md: -------------------------------------------------------------------------------- 1 | Getting Guild Channels {#getting_guild_channels} 2 | ============ 3 | - Execute the `discord_core_api::channels::getGuildChannelsAsync()` function, while passing in a data structure of type `discord_core_api::get_guild_channels_data`, with a return value of type `auto` or `jsonifier::vector`. 4 | - call the function with `discord_core_api::co_routine::get()` added to the end in order to wait for the results now. 5 | 6 | ```cpp 7 | /// Test.hpp -header for the "test" command. 8 | /// https://github.com/RealTimeChris/DiscordCoreAPI 9 | 10 | #pragma once 11 | 12 | #include 13 | 14 | namespace discord_core_api { 15 | 16 | class test : public base_function { 17 | public: 18 | test() { 19 | commandName = "test"; 20 | helpDescription = "testing purposes!"; 21 | public 22 | embed_data msgEmbed; 23 | msgEmbed.setDescription("------\nSimply enter !test or /test!\n------"); 24 | msgEmbed.setTitle("__**test usage:**__"); 25 | msgEmbed.setTimeStamp(getTimeAndDate()); 26 | msgEmbed.setColor("fe_fe_fe"); 27 | helpEmbed = msgEmbed; 28 | } 29 | 30 | unique_ptr create() { 31 | return makeUnique(); 32 | } 33 | 34 | virtual void execute(base_function_arguments& args) { 35 | try { 36 | vector channels = 37 | public discord_core_api::channels::getGuildChannelsAsync({.guildId = args.eventData.getGuildId()}).get(); 38 | 39 | for (const auto& value: channels) { 40 | std::cout << "the name: " << value.name << std::endl; 41 | } 42 | 43 | 44 | } catch (...) { 45 | rethrowException("test::execute()"); 46 | } 47 | } 48 | }; 49 | } 50 | ``` 51 | -------------------------------------------------------------------------------- /Documentation/Doxygen/Docs/documentation_examples/channels/Getting Voice Regions.md: -------------------------------------------------------------------------------- 1 | Getting Voice Regions {#getting_voice_regions} 2 | ============ 3 | - Execute the, `discord_core_api::channels::getVoiceRegionsAsync()` function, with a return value of type `auto` or `jsonifier::vector`. 4 | - call the function with `discord_core_api::co_routine::get()` added to the end in order to wait for the results now. 5 | 6 | ```cpp 7 | /// Test.hpp -header for the "test" command. 8 | /// https://github.com/RealTimeChris/DiscordCoreAPI 9 | 10 | #pragma once 11 | 12 | #include 13 | 14 | namespace discord_core_api { 15 | 16 | class test : public base_function { 17 | public: 18 | test() { 19 | commandName = "test"; 20 | helpDescription = "testing purposes!"; 21 | embed_data msgEmbed; 22 | msgEmbed.setDescription("------\nSimply enter !test or /test!\n------"); 23 | msgEmbed.setTitle("__**test usage:**__"); 24 | msgEmbed.setTimeStamp(getTimeAndDate()); 25 | msgEmbed.setColor("fe_fe_fe"); 26 | helpEmbed = msgEmbed; 27 | } 28 | 29 | unique_ptr create() { 30 | return makeUnique(); 31 | } 32 | 33 | virtual void execute(base_function_arguments& args) { 34 | try { 35 | auto responseData = discord_core_api::channels::getVoiceRegionsAsync().get(); 36 | 37 | for (auto& value: responseData) { 38 | std::cout << "the region: " << value.name << std::endl; 39 | } 40 | 41 | 42 | } catch (...) { 43 | rethrowException("test::execute()"); 44 | } 45 | } 46 | 47 | virtual ~test() = default; 48 | }; 49 | } 50 | ``` 51 | -------------------------------------------------------------------------------- /Documentation/Doxygen/Docs/documentation_examples/channels/Getting a Channel.md: -------------------------------------------------------------------------------- 1 | Getting a Channel {#getting_channel} 2 | ============ 3 | - Execute the `discord_core_api::channels::getCachedChannel()` (which collects it from the cache), or `discord_core_api::getChannelAsync()` (which collects it from the discord servers) function, while passing to it a data structure of type `discord_core_api::get_channel_data`, with a return type of `auto` or `discord_core_api::channel_data`. 4 | - call the function with `discord_core_api::co_routine::get()` added to the end in order to wait for the results now. 5 | ```cpp 6 | /// Test.hpp -header for the "test" command. 7 | /// https://github.com/RealTimeChris/DiscordCoreAPI 8 | 9 | #pragma once 10 | 11 | #include "index.hpp" 12 | 13 | namespace discord_core_api { 14 | 15 | class test : public base_function { 16 | public: 17 | test() { 18 | commandName = "test"; 19 | helpDescription = "testing purposes!"; 20 | embed_data msgEmbed; 21 | msgEmbed.setDescription("------\nSimply enter !test or /test!\n------"); 22 | msgEmbed.setTitle("__**test usage:**__"); 23 | msgEmbed.setTimeStamp(getTimeAndDate()); 24 | msgEmbed.setColor("fe_fe_fe"); 25 | helpEmbed = msgEmbed; 26 | } 27 | 28 | unique_ptr create() { 29 | return makeUnique(); 30 | } 31 | 32 | virtual void execute(base_function_arguments& args) { 33 | channel channel = discord_core_api::channels::getCachedChannel({args.eventData.getChannelId()}).get(); 34 | 35 | channel channel = discord_core_api::channels::getChannelAsync({args.eventData.getChannelId()}).get(); 36 | } 37 | }; 38 | } 39 | ``` 40 | -------------------------------------------------------------------------------- /Documentation/Doxygen/Docs/documentation_examples/channels/Getting a Direct-Message Channel.md: -------------------------------------------------------------------------------- 1 | Getting a Direct-Message Channel {#getting_dm_channel} 2 | ============ 3 | - Execute the `discord_core_api::channels::createDMChannelAsync()` (which collects it from the discord servers)function, while passing to it a data structure of type `discord_core_api::create_dmchannel_data`, or simply `discord_core_api::{ .userId = targetuseridhere}`, with a return value of `auto` or `discord_core_api:channel`. 4 | - call the function with `discord_core_api::co_routine::get()` added to the end in order to wait for the results now. 5 | 6 | ```cpp 7 | /// Test.hpp -header for the "test" command. 8 | /// https://github.com/RealTimeChris/DiscordCoreAPI 9 | 10 | #pragma once 11 | 12 | #include "index.hpp" 13 | 14 | namespace discord_core_api { 15 | 16 | class test : public base_function { 17 | public: 18 | test() { 19 | commandName = "test"; 20 | helpDescription = "testing purposes!"; 21 | embed_data msgEmbed; 22 | msgEmbed.setDescription("------\nSimply enter !test or /test!\n------"); 23 | msgEmbed.setTitle("__**test usage:**__"); 24 | msgEmbed.setTimeStamp(getTimeAndDate()); 25 | msgEmbed.setColor("fe_fe_fe"); 26 | helpEmbed = msgEmbed; 27 | } 28 | 29 | unique_ptr create() { 30 | return makeUnique(); 31 | } 32 | 33 | virtual void execute(std::unique_pt args) { 34 | channel channel = discord_core_api::channels::createDMChannelAsync({.userId = args.eventData.getAuthorId()}).get(); 35 | } 36 | }; 37 | } 38 | ``` 39 | -------------------------------------------------------------------------------- /Documentation/Doxygen/Docs/documentation_examples/channels/Modifying a Channel.md: -------------------------------------------------------------------------------- 1 | Modifying a Channel {#modifying_channel} 2 | ============ 3 | - Execute the `discord_core_api::channels::modifyChannelAsync()` function, while passing to it a completed data structure `discord_core_api::modify_channel_data`, with a return value of `auto` or `discord_core_api::channel_data`. 4 | - call the function with `discord_core_api::co_routine::get()` added to the end in order to wait for the results now. 5 | 6 | ```cpp 7 | /// Test.hpp -header for the "test" command. 8 | /// https://github.com/RealTimeChris/DiscordCoreAPI 9 | 10 | #pragma once 11 | 12 | #include 13 | 14 | namespace discord_core_api { 15 | 16 | class test : public base_function { 17 | public: 18 | test() { 19 | commandName = "test"; 20 | helpDescription = "testing purposes!"; 21 | embed_data msgEmbed; 22 | msgEmbed.setDescription("------\nSimply enter !test or /test!\n------"); 23 | msgEmbed.setTitle("__**test usage:**__"); 24 | msgEmbed.setTimeStamp(getTimeAndDate()); 25 | msgEmbed.setColor("fe_fe_fe"); 26 | helpEmbed = msgEmbed; 27 | } 28 | 29 | unique_ptr create() { 30 | return makeUnique(); 31 | } 32 | 33 | virtual void execute(base_function_arguments& args) { 34 | try { 35 | channel channel = discord_core_api::channels::getCachedChannel({.channelId = args.eventData.getChannelId()}).get(); 36 | modify_channel_data dataPackage {channel}; 37 | dataPackage.channelData.name = "test update"; 38 | channel channelNew = discord_core_api::channels::modifyChannelAsync(dataPackage).get(); 39 | 40 | } catch (...) { 41 | rethrowException("test::execute() error: "); 42 | } 43 | } 44 | }; 45 | } 46 | ``` 47 | -------------------------------------------------------------------------------- /Documentation/Doxygen/Docs/documentation_examples/channels/Triggering the Typing Indicator.md: -------------------------------------------------------------------------------- 1 | Triggering the Typing Indicator {#triggering_the_typing_indicator} 2 | ============ 3 | - Execute the, `discord_core_api::channels::triggerTypingIndicatorAsync()` function, while passing in a data structure of type `discord_core_api::trigger_typing_indicator_data` with a return value of `void`. 4 | - call the function with `discord_core_api::co_routine::get()` added to the end in order to wait for the results now. 5 | 6 | ```cpp 7 | /// Test.hpp -header for the "test" command. 8 | /// https://github.com/RealTimeChris/DiscordCoreAPI 9 | 10 | #pragma once 11 | 12 | #include 13 | 14 | namespace discord_core_api { 15 | 16 | class test : public base_function { 17 | public: 18 | test() { 19 | commandName = "test"; 20 | helpDescription = "testing purposes!"; 21 | embed_data msgEmbed; 22 | msgEmbed.setDescription("------\nSimply enter !test or /test!\n------"); 23 | msgEmbed.setTitle("__**test usage:**__"); 24 | msgEmbed.setTimeStamp(getTimeAndDate()); 25 | msgEmbed.setColor("fe_fe_fe"); 26 | helpEmbed = msgEmbed; 27 | } 28 | 29 | unique_ptr create() { 30 | return makeUnique(); 31 | } 32 | 33 | virtual void execute(base_function_arguments& args) { 34 | try { 35 | trigger_typing_indicator_data dataPackage; 36 | dataPackage.channelId = args.eventData.getChannelId(); 37 | 38 | discord_core_api::channels::triggerTypingIndicatorAsync(dataPackage).get(); 39 | 40 | } catch (...) { 41 | rethrowException("test::execute()"); 42 | } 43 | } 44 | }; 45 | } 46 | ``` 47 | -------------------------------------------------------------------------------- /Documentation/Doxygen/Docs/documentation_examples/general_usage/Listening for a Discord Event.md: -------------------------------------------------------------------------------- 1 | Listening for a Discord Event {#listening_for_an_event} 2 | ============ 3 | - a complete list of possible events is [here](https://discord.com/developers/docs/topics/gateway#commands-and-events-gateway-events). 4 | - create a function that returns `discord_core_api::co_routine`, that takes an argument of a type that derives its name from the type of event that is being listened for, where the argument is of type `discord_core_api::eventname+data`. for example, the argument for the `discord_core_api::event_manager::onGuildCreation` event is `discord_core_api::on_guild_creation_data`. 5 | - the list of events can be found by dereferencing `discord_core_api::discord_core_client::eventManager`, where you pass into the function found here, a pointer to your own created function. 6 | 7 | ```cpp 8 | /// main.cpp-main entry point. 9 | /// https://github.com/RealTimeChris/DiscordCoreAPI 10 | 11 | #include 12 | 13 | co_routine onGuildCreation(on_guild_creation_data dataPackage) { 14 | co_await newThreadAwaitable(); 15 | std::cout << "guild_data name: " << dataPackage.guild_data.data.name << std::endl; 16 | co_return; 17 | } 18 | 19 | int32_t main() { 20 | jsonifier::string botToken {"YOUR_BOT_TOKEN_HERE"}; 21 | auto ptr = makeUnique(botToken, "!"); 22 | ptr->eventManager->onGuildCreation(&onGuildCreation); 23 | ptr->runBot(); 24 | return 0; 25 | } 26 | ``` 27 | -------------------------------------------------------------------------------- /Documentation/Doxygen/Docs/documentation_examples/general_usage/Running a Command.md: -------------------------------------------------------------------------------- 1 | Running a Command {#running_a_command} 2 | ============ 3 | - by default, once you have added a command, it will be executed upon receiving the associated registered slash command's input. 4 | - given that, assuming that the "test" command has been registered with the library, the following code would produce, in response to an individual entering "/test"(assuming it has been registered as a slash command), an ephemeral response message that states "test message!". 5 | ```cpp 6 | /// Test.hpp- header for the "test" command. 7 | /// https://github.com/RealTimeChris/DiscordCoreAPI 8 | 9 | #pragma once 10 | 11 | #include "index.hpp" 12 | 13 | namespace discord_core_api { 14 | 15 | class test : public base_function { 16 | public: 17 | test() { 18 | commandName = "test"; 19 | helpDescription = "testing purposes!"; 20 | embed_data msgEmbed; 21 | msgEmbed.setDescription("------\nSimply enter !test or /test!\n------"); 22 | msgEmbed.setTitle("__**test usage:**__"); 23 | msgEmbed.setTimeStamp(getTimeAndDate()); 24 | msgEmbed.setColor("fe_fe_fe"); 25 | helpEmbed = msgEmbed; 26 | } 27 | 28 | unique_ptr create() { 29 | return makeUnique(); 30 | } 31 | 32 | virtual void execute(base_function_arguments& args) { 33 | respond_to_input_event_data& dataPackage {args.eventData}; 34 | dataPackage.addContent("test message!"); 35 | dataPackage.setResponseType(input_event_response_type::Ephemeral_Interaction_Response) 36 | input_events::respondToInputEventAsync(dataPackage); 37 | } 38 | }; 39 | } 40 | ``` 41 | -------------------------------------------------------------------------------- /Documentation/Doxygen/Docs/documentation_examples/guild_members/Listing Guild Members.md: -------------------------------------------------------------------------------- 1 | Listing Guild Members {#listing_guild_members} 2 | ============ 3 | - Execute the, `discord_core_api::guild_members::listGuildMembersAsync()` function, while passing in a value of type `discord_core_api::list_guild_members_data`, with a return value of type `auto` or `jsonifier::vector`. 4 | - call the function with `discord_core_api::co_routine::get()` added to the end in order to wait for the results now. 5 | 6 | ```cpp 7 | /// Test.hpp -header for the "test" command. 8 | /// https://github.com/RealTimeChris/DiscordCoreAPI 9 | 10 | #pragma once 11 | 12 | #include 13 | 14 | namespace discord_core_api { 15 | 16 | class test : public base_function { 17 | public: 18 | test() { 19 | commandName = "test"; 20 | helpDescription = "testing purposes!"; 21 | embed_data msgEmbed; 22 | msgEmbed.setDescription("------\nSimply enter !test or /test!\n------"); 23 | msgEmbed.setTitle("__**test usage:**__"); 24 | msgEmbed.setTimeStamp(getTimeAndDate()); 25 | msgEmbed.setColor("fe_fe_fe"); 26 | helpEmbed = msgEmbed; 27 | } 28 | 29 | unique_ptr create() { 30 | return makeUnique(); 31 | } 32 | 33 | virtual void execute(base_function_arguments& args) { 34 | try { 35 | list_guild_members_data& dataPackage; 36 | dataPackage.guildId = args.eventData.getGuildId(); 37 | dataPackage.limit = 20; 38 | 39 | auto guildMembers = guild_members::listGuildMembersAsync(dataPackage).get(); 40 | 41 | for (const auto& value: guildMembers) { 42 | std::cout << "the name: " << value.user.userName << std::endl; 43 | } 44 | 45 | 46 | } catch (...) { 47 | rethrowException("test::execute()"); 48 | } 49 | } 50 | }; 51 | } 52 | ``` 53 | -------------------------------------------------------------------------------- /Documentation/Doxygen/Docs/documentation_examples/guild_members/Removing a Guild Member.md: -------------------------------------------------------------------------------- 1 | Removing a Guild Member {#removing_a_guild_member} 2 | ============ 3 | - Execute the, `discord_core_api::guild_members::removeGuildMemberAsync()` function, while passing in a value of type `discord_core_api::remove_guild_member_data`, with a return value of type `void`. 4 | - call the function with `discord_core_api::co_routine::get()` added to the end in order to wait for the results now. 5 | 6 | ```cpp 7 | /// Test.hpp -header for the "test" command. 8 | /// https://github.com/RealTimeChris/DiscordCoreAPI 9 | 10 | #pragma once 11 | 12 | #include 13 | 14 | namespace discord_core_api { 15 | 16 | class test : public base_function { 17 | public: 18 | test() { 19 | commandName = "test"; 20 | helpDescription = "testing purposes!"; 21 | embed_data msgEmbed; 22 | msgEmbed.setDescription("------\nSimply enter !test or /test!\n------"); 23 | msgEmbed.setTitle("__**test usage:**__"); 24 | msgEmbed.setTimeStamp(getTimeAndDate()); 25 | msgEmbed.setColor("fe_fe_fe"); 26 | helpEmbed = msgEmbed; 27 | } 28 | 29 | unique_ptr create() { 30 | return makeUnique(); 31 | } 32 | 33 | virtual void execute(base_function_arguments& args) { 34 | try { 35 | remove_guild_member_data& dataPackage01; 36 | dataPackage01.guildId = args.eventData.getGuildId(); 37 | if (args.argumentsArray.size() > 0) { 38 | dataPackage01.guildMemberId = args.argumentsArray[0]; 39 | } 40 | dataPackage01.reason = "testing purposes!"; 41 | 42 | guild_members::removeGuildMemberAsync(dataPackage01).get(); 43 | 44 | 45 | } catch (...) { 46 | rethrowException("test::execute()"); 47 | } 48 | } 49 | }; 50 | } 51 | ``` 52 | -------------------------------------------------------------------------------- /Documentation/Doxygen/Docs/documentation_examples/guilds/Creating a Guild Ban.md: -------------------------------------------------------------------------------- 1 | Creating a Guild Ban {#creating_a_guild_ban} 2 | ============ 3 | - Execute the, `discord_core_api::guilds::createGuildBanAsync()` function, while passing in a value of type `discord_core_api::create_guild_ban_data`, with a return value of type `void`. 4 | - call the function with `discord_core_api::co_routine::get()` added to the end in order to wait for the results now. 5 | 6 | ```cpp 7 | /// Test.hpp -header for the "test" command. 8 | /// https://github.com/RealTimeChris/DiscordCoreAPI 9 | 10 | #pragma once 11 | 12 | #include 13 | 14 | namespace discord_core_api { 15 | 16 | class test : public base_function { 17 | public: 18 | test() { 19 | commandName = "test"; 20 | helpDescription = "testing purposes!"; 21 | embed_data msgEmbed; 22 | msgEmbed.setDescription("------\nSimply enter !test or /test!\n------"); 23 | msgEmbed.setTitle("__**test usage:**__"); 24 | msgEmbed.setTimeStamp(getTimeAndDate()); 25 | msgEmbed.setColor("fe_fe_fe"); 26 | helpEmbed = msgEmbed; 27 | } 28 | 29 | unique_ptr create() { 30 | return makeUnique(); 31 | } 32 | 33 | virtual void execute(base_function_arguments& args) { 34 | try { 35 | create_guild_ban_data& dataPackage01; 36 | dataPackage01.guildId = args.eventData.getGuildId(); 37 | dataPackage01.guildMemberId = "851629399514415106"; 38 | dataPackage01.deleteMessageDays = 3; 39 | dataPackage01.reason = "testing purposes!"; 40 | 41 | guilds::createGuildBanAsync(dataPackage01).get(); 42 | 43 | 44 | } catch (...) { 45 | rethrowException("test::execute()"); 46 | } 47 | } 48 | }; 49 | } 50 | ``` 51 | -------------------------------------------------------------------------------- /Documentation/Doxygen/Docs/documentation_examples/guilds/Creating a Guild Template.md: -------------------------------------------------------------------------------- 1 | Creating a Guild Template {#creating_a_guild_template} 2 | ============= 3 | - Execute the, `discord_core_api::guilds::createGuildTemplateAsync()` function, while passing in a value of type `discord_core_api::create_guild_template_data`, with a return value of type `auto` or `discord_core_api::guild_template_data`. 4 | - call the function with `discord_core_api::co_routine::get()` added to the end in order to wait for the results now. 5 | 6 | ```cpp 7 | /// Test.hpp -header for the "test" command. 8 | /// https://github.com/RealTimeChris/DiscordCoreAPI 9 | 10 | #pragma once 11 | 12 | #include 13 | 14 | namespace discord_core_api { 15 | 16 | class test : public base_function { 17 | public: 18 | test() { 19 | commandName = "test"; 20 | helpDescription = "testing purposes!"; 21 | embed_data msgEmbed; 22 | msgEmbed.setDescription("------\nSimply enter !test or /test!\n------"); 23 | msgEmbed.setTitle("__**test usage:**__"); 24 | msgEmbed.setTimeStamp(getTimeAndDate()); 25 | msgEmbed.setColor("fe_fe_fe"); 26 | helpEmbed = msgEmbed; 27 | } 28 | 29 | unique_ptr create() { 30 | return makeUnique(); 31 | } 32 | 33 | virtual void execute(base_function_arguments& args) { 34 | try { 35 | create_guild_template_data& dataPackage01; 36 | dataPackage01.guildId = args.eventData.getGuildId(); 37 | dataPackage01.description = "testing template!"; 38 | dataPackage01.name = "test template!"; 39 | 40 | auto responseData = guilds::createGuildTemplateAsync(dataPackage01).get(); 41 | 42 | std::cout << "the name: " << responseData.name << std::endl; 43 | 44 | 45 | } catch (...) { 46 | rethrowException("test::execute()"); 47 | } 48 | } 49 | }; 50 | } 51 | ``` 52 | -------------------------------------------------------------------------------- /Documentation/Doxygen/Docs/documentation_examples/guilds/Creating a Guild from a Template.md: -------------------------------------------------------------------------------- 1 | Creating a Guild From a Guild Template {#creating_a_guild_from_a_guild_template} 2 | ============ 3 | - execue the, `discord_core_api::guilds::createGuildFromGuildTemplateAsync()` function, while passing in a value of type `discord_core_api::create_guild_from_guild_template_data`, with a return value of type `auto` or `discord_core_api::guild_data`. 4 | - call the function with `discord_core_api::co_routine::get()` added to the end in order to wait for the results now. 5 | 6 | ```cpp 7 | /// Test.hpp -header for the "test" command. 8 | /// https://github.com/RealTimeChris/DiscordCoreAPI 9 | 10 | #pragma once 11 | 12 | #include 13 | 14 | namespace discord_core_api { 15 | 16 | class test : public base_function { 17 | public: 18 | test() { 19 | commandName = "test"; 20 | helpDescription = "testing purposes!"; 21 | embed_data msgEmbed; 22 | msgEmbed.setDescription("------\nSimply enter !test or /test!\n------"); 23 | msgEmbed.setTitle("__**test usage:**__"); 24 | msgEmbed.setTimeStamp(getTimeAndDate()); 25 | msgEmbed.setColor("fe_fe_fe"); 26 | helpEmbed = msgEmbed; 27 | } 28 | 29 | unique_ptr create() { 30 | return makeUnique(); 31 | } 32 | 33 | virtual void execute(base_function_arguments& args) { 34 | try { 35 | create_guild_from_guild_template_data& dataPackage01; 36 | dataPackage01.templateCode = "ym_rr2bj5_ny_yx"; 37 | dataPackage01.name = "test guild_data!"; 38 | 39 | auto responseData = guilds::createGuildFromGuildTemplateAsync(dataPackage01).get(); 40 | 41 | std::cout << "guild_data name: " << responseData.name << std::endl; 42 | 43 | 44 | } catch (...) { 45 | rethrowException("test::execute()"); 46 | } 47 | } 48 | }; 49 | } 50 | ``` 51 | -------------------------------------------------------------------------------- /Documentation/Doxygen/Docs/documentation_examples/guilds/Creating a Guild.md: -------------------------------------------------------------------------------- 1 | Creating a Guild {#creating_a_guild} 2 | ============ 3 | - Execute the, `discord_core_api::guilds::createGuildAsync()` function, while passing in a data structure of type `discord_core_api::create_guild_data` with a return value of type `auto` or `discord_core_api::guild_data`. 4 | - call the function with `discord_core_api::co_routine::get()` added to the end in order to wait for the results now. 5 | 6 | ```cpp 7 | /// Test.hpp -header for the "test" command. 8 | /// https://github.com/RealTimeChris/DiscordCoreAPI 9 | 10 | #pragma once 11 | 12 | #include 13 | 14 | namespace discord_core_api { 15 | 16 | class test : public base_function { 17 | public: 18 | test() { 19 | commandName = "test"; 20 | helpDescription = "testing purposes!"; 21 | embed_data msgEmbed; 22 | msgEmbed.setDescription("------\nSimply enter !test or /test!\n------"); 23 | msgEmbed.setTitle("__**test Usage__"); 24 | msgEmbed.setTimeStamp(getTimeAndDate()); 25 | msgEmbed.setColor("fe_fe_fe"); 26 | helpEmbed = msgEmbed; 27 | } 28 | 29 | unique_ptr create() { 30 | return makeUnique(); 31 | } 32 | 33 | virtual void execute(base_function_arguments& args) { 34 | try { 35 | create_guild_data& dataPackage00; 36 | dataPackage00.name = "test guild_data"; 37 | 38 | auto guild_data = guilds::createGuildAsync(dataPackage00).get(); 39 | 40 | std::cout << "the name: " << guild_data.name << std::endl; 41 | 42 | 43 | } catch (...) { 44 | rethrowException("test::execute()"); 45 | } 46 | } 47 | }; 48 | } 49 | ``` 50 | -------------------------------------------------------------------------------- /Documentation/Doxygen/Docs/documentation_examples/guilds/Deleting a Guild Integration.md: -------------------------------------------------------------------------------- 1 | Deleting a Guild Integration {#deleting_a_guild_integration} 2 | ============ 3 | - Execute the, `discord_core_api::guilds::deleteGuildIntegrationAsync()` function, while passing in a value of type `discord_core_api::delete_guild_integration_data`, with a return value of type `void`. 4 | - call the function with `discord_core_api::co_routine::get()` added to the end in order to wait for the results now. 5 | 6 | ```cpp 7 | /// Test.hpp -header for the "test" command. 8 | /// https://github.com/RealTimeChris/DiscordCoreAPI 9 | 10 | #pragma once 11 | 12 | #include 13 | 14 | namespace discord_core_api { 15 | 16 | class test : public base_function { 17 | public: 18 | test() { 19 | commandName = "test"; 20 | helpDescription = "testing purposes!"; 21 | embed_data msgEmbed; 22 | msgEmbed.setDescription("------\nSimply enter !test or /test!\n------"); 23 | msgEmbed.setTitle("__**test usage:**__"); 24 | msgEmbed.setTimeStamp(getTimeAndDate()); 25 | msgEmbed.setColor("fe_fe_fe"); 26 | helpEmbed = msgEmbed; 27 | } 28 | 29 | unique_ptr create() { 30 | return makeUnique(); 31 | } 32 | 33 | virtual void execute(base_function_arguments& args) { 34 | try { 35 | delete_guild_integration_data& dataPackage01; 36 | dataPackage01.guildId = args.eventData.getGuildId(); 37 | dataPackage01.integrationId = "INTEGRATION_ID_HERE"; 38 | dataPackage01.reason = "testing purposes!"; 39 | 40 | guilds::deleteGuildIntegrationAsync(dataPackage01).get(); 41 | 42 | 43 | } catch (...) { 44 | rethrowException("test::execute()"); 45 | } 46 | } 47 | }; 48 | } 49 | ``` 50 | -------------------------------------------------------------------------------- /Documentation/Doxygen/Docs/documentation_examples/guilds/Deleting a Guild.md: -------------------------------------------------------------------------------- 1 | Deleting a Guild {#deleting_a_guild} 2 | ============ 3 | - Execute the, `discord_core_api::guilds::deleteGuildAsync()` function, while passing in a value of type `discord_core_api::delete_guild_data`, with a return value of type `void`. 4 | - call the function with `discord_core_api::co_routine::get()` added to the end in order to wait for the results now. 5 | 6 | ```cpp 7 | /// Test.hpp -header for the "test" command. 8 | /// https://github.com/RealTimeChris/DiscordCoreAPI 9 | 10 | #pragma once 11 | 12 | #include 13 | 14 | namespace discord_core_api { 15 | 16 | class test : public base_function { 17 | public: 18 | test() { 19 | commandName = "test"; 20 | helpDescription = "testing purposes!"; 21 | embed_data msgEmbed; 22 | msgEmbed.setDescription("------\nSimply enter !test or /test!\n------"); 23 | msgEmbed.setTitle("__**test usage:**__"); 24 | msgEmbed.setTimeStamp(getTimeAndDate()); 25 | msgEmbed.setColor("fe_fe_fe"); 26 | helpEmbed = msgEmbed; 27 | } 28 | 29 | unique_ptr create() { 30 | return makeUnique(); 31 | } 32 | 33 | virtual void execute(base_function_arguments& args) { 34 | try { 35 | vector guilds = guilds::getAllGuildsAsync().get(); 36 | for (const auto& value: guilds) { 37 | if (value.name == "newer test guild_data two!") { 38 | delete_guild_data dataPackage; 39 | dataPackage.guildId = value.id; 40 | guilds::deleteGuildAsync(dataPackage).get(); 41 | }; 42 | } 43 | 44 | 45 | } catch (...) { 46 | rethrowException("test::execute()"); 47 | } 48 | } 49 | }; 50 | } 51 | ``` 52 | -------------------------------------------------------------------------------- /Documentation/Doxygen/Docs/documentation_examples/guilds/Getting All Guilds.md: -------------------------------------------------------------------------------- 1 | Getting All Guilds {#getting_all_guilds} 2 | ============ 3 | - Execute the `discord_core_api::guilds::getAllGuildsAsync()` function and execute it, with a return value of type `auto` or `jsonifier::vector`. 4 | - call the function with `discord_core_api::co_routine::get()` added to the end in order to wait for the results now. 5 | 6 | ```cpp 7 | /// Test.hpp -header for the "test" command. 8 | /// https://github.com/RealTimeChris/DiscordCoreAPI 9 | 10 | #pragma once 11 | 12 | #include "index.hpp" 13 | 14 | namespace discord_core_api { 15 | 16 | class test : public base_function { 17 | public: 18 | test() { 19 | commandName = "test"; 20 | helpDescription = "testing purposes!"; 21 | embed_data msgEmbed; 22 | msgEmbed.setDescription("------\nSimply enter !test or /test!\n------"); 23 | msgEmbed.setTitle("__**test Usage__"); 24 | msgEmbed.setTimeStamp(getTimeAndDate()); 25 | msgEmbed.setColor("fe_fe_fe"); 26 | helpEmbed = msgEmbed; 27 | } 28 | 29 | unique_ptr create() { 30 | return makeUnique(); 31 | } 32 | 33 | virtual void execute(base_function_arguments& args) { 34 | vector guilds = guilds::getAllGuildsAsync().get(); 35 | } 36 | }; 37 | } 38 | ``` 39 | -------------------------------------------------------------------------------- /Documentation/Doxygen/Docs/documentation_examples/guilds/Getting Audit Logs.md: -------------------------------------------------------------------------------- 1 | Getting Audit Logs {#getting_audit_logs} 2 | ============ 3 | - Execute the, `discord_core_api::guilds::getGuildAuditLogsAsync()` function, while passing in a data structure of type `discord_core_api::get_guild_audit_logs_data` with a return value of type `auto` or `discord_core_api::audit_log_data`. 4 | - call the function with `discord_core_api::co_routine::get()` added to the end in order to wait for the results now. 5 | 6 | ```cpp 7 | /// Test.hpp -header for the "test" command. 8 | /// https://github.com/RealTimeChris/DiscordCoreAPI 9 | 10 | #pragma once 11 | 12 | #include "index.hpp" 13 | 14 | namespace discord_core_api { 15 | 16 | class test : public base_function { 17 | public: 18 | test() { 19 | commandName = "test"; 20 | helpDescription = "testing purposes!"; 21 | embed_data msgEmbed; 22 | msgEmbed.setDescription("------\nSimply enter !test or /test!\n------"); 23 | msgEmbed.setTitle("__**test Usage__"); 24 | msgEmbed.setTimeStamp(getTimeAndDate()); 25 | msgEmbed.setColor("fe_fe_fe"); 26 | helpEmbed = msgEmbed; 27 | } 28 | 29 | unique_ptr create() { 30 | return makeUnique(); 31 | } 32 | 33 | virtual void execute(base_function_arguments& args) { 34 | get_guild_audit_logs_data& dataPackage; 35 | dataPackage.actionType = audit_log_event::MEMBER_BAN_ADD; 36 | dataPackage.guildId = args.eventData.getGuildId(); 37 | dataPackage.limit = 25; 38 | dataPackage.userId = args.eventData.getAuthorId(); 39 | 40 | audit_log_data auditLogData = guilds::getGuildAuditLogsAsync(dataPackage).get(; 41 | } 42 | }; 43 | } 44 | ``` 45 | -------------------------------------------------------------------------------- /Documentation/Doxygen/Docs/documentation_examples/guilds/Getting Current User's Guilds.md: -------------------------------------------------------------------------------- 1 | Getting Current User's Guilds {#getting_current_users_guilds} 2 | ============ 3 | - Execute the, `discord_core_api::guilds::getCurrentUserGuildsAsync()` function, while passing in a value of type `discord_core_api::get_current_user_guilds_data`, with a return value of type `auto` or `jsonifier::vector`. 4 | - call the function with `discord_core_api::co_routine::get()` added to the end in order to wait for the results now. 5 | 6 | ```cpp 7 | /// Test.hpp -header for the "test" command. 8 | /// https://github.com/RealTimeChris/DiscordCoreAPI 9 | 10 | #pragma once 11 | 12 | #include 13 | 14 | namespace discord_core_api { 15 | 16 | class test : public base_function { 17 | public: 18 | test() { 19 | commandName = "test"; 20 | helpDescription = "testing purposes!"; 21 | embed_data msgEmbed; 22 | msgEmbed.setDescription("------\nSimply enter !test or /test!\n------"); 23 | msgEmbed.setTitle("__**test usage:**__"); 24 | msgEmbed.setTimeStamp(getTimeAndDate()); 25 | msgEmbed.setColor("fe_fe_fe"); 26 | helpEmbed = msgEmbed; 27 | } 28 | 29 | unique_ptr create() { 30 | return makeUnique(); 31 | } 32 | 33 | virtual void execute(base_function_arguments& args) { 34 | try { 35 | get_current_user_guilds_data& dataPackage; 36 | dataPackage.limit = 2; 37 | 38 | auto currentOutput = guilds::getCurrentUserGuildsAsync(dataPackage).get(); 39 | 40 | for (auto& value: currentOutput) { 41 | std::cout << "guild_data name: " << value.name << std::endl; 42 | } 43 | 44 | 45 | } catch (...) { 46 | rethrowException("test::execute()"); 47 | } 48 | } 49 | 50 | virtual ~test() = default; 51 | }; 52 | } 53 | 54 | 55 | ``` 56 | -------------------------------------------------------------------------------- /Documentation/Doxygen/Docs/documentation_examples/guilds/Getting Guild Bans.md: -------------------------------------------------------------------------------- 1 | Getting Guild Bans {#getting_guild_bans} 2 | ============ 3 | - Execute the, `discord_core_api::guilds::getGuildBansAsync()` function, while passing in a value of type `discord_core_api::get_guild_bans_data`, with a return value of type `auto` or `discord_core_api::vector`. 4 | - call the function with `discord_core_api::co_routine::get()` added to the end in order to wait for the results now. 5 | 6 | ```cpp 7 | /// Test.hpp -header for the "test" command. 8 | /// https://github.com/RealTimeChris/DiscordCoreAPI 9 | 10 | #pragma once 11 | 12 | #include 13 | 14 | namespace discord_core_api { 15 | 16 | class test : public base_function { 17 | public: 18 | test() { 19 | commandName = "test"; 20 | helpDescription = "testing purposes!"; 21 | embed_data msgEmbed; 22 | msgEmbed.setDescription("------\nSimply enter !test or /test!\n------"); 23 | msgEmbed.setTitle("__**test usage:**__"); 24 | msgEmbed.setTimeStamp(getTimeAndDate()); 25 | msgEmbed.setColor("fe_fe_fe"); 26 | helpEmbed = msgEmbed; 27 | } 28 | 29 | unique_ptr create() { 30 | return makeUnique(); 31 | } 32 | 33 | virtual void execute(base_function_arguments& args) { 34 | try { 35 | get_guild_bans_data& dataPackage01; 36 | dataPackage01.guildId = args.eventData.getGuildId(); 37 | 38 | auto guildBans = guilds::getGuildBansAsync(dataPackage01).get(); 39 | 40 | for (const auto& value: guildBans) { 41 | std::cout << "the ban name: " << value.user.userName << std::endl; 42 | } 43 | 44 | 45 | } catch (...) { 46 | rethrowException("test::execute()"); 47 | } 48 | } 49 | }; 50 | } 51 | ``` 52 | -------------------------------------------------------------------------------- /Documentation/Doxygen/Docs/documentation_examples/guilds/Getting Guild Integrations.md: -------------------------------------------------------------------------------- 1 | Getting Guild Integrations {#getting_guild_integrations} 2 | ============ 3 | - Execute the, `discord_core_api::guilds::getGuildIntegrationsAsync()` function, while passing in a value of type `discord_core_api::get_guild_integrations_data`, with a return value of type `auto` or `jsonifier::vector`. 4 | - call the function with `discord_core_api::co_routine::get()` added to the end in order to wait for the results now. 5 | 6 | ```cpp 7 | /// Test.hpp -header for the "test" command. 8 | /// https://github.com/RealTimeChris/DiscordCoreAPI 9 | 10 | #pragma once 11 | 12 | #include 13 | 14 | namespace discord_core_api { 15 | 16 | class test : public base_function { 17 | public: 18 | test() { 19 | commandName = "test"; 20 | helpDescription = "testing purposes!"; 21 | embed_data msgEmbed; 22 | msgEmbed.setDescription("------\nSimply enter !test or /test!\n------"); 23 | msgEmbed.setTitle("__**test usage:**__"); 24 | msgEmbed.setTimeStamp(getTimeAndDate()); 25 | msgEmbed.setColor("fe_fe_fe"); 26 | helpEmbed = msgEmbed; 27 | } 28 | 29 | unique_ptr create() { 30 | return makeUnique(); 31 | } 32 | 33 | virtual void execute(base_function_arguments& args) { 34 | try { 35 | get_guild_integrations_data& dataPackage01; 36 | dataPackage01.guildId = args.eventData.getGuildId(); 37 | 38 | auto responseData = guilds::getGuildIntegrationsAsync(dataPackage01).get(); 39 | 40 | for (const auto& value: responseData) { 41 | std::cout << value.name << std::endl; 42 | } 43 | 44 | 45 | } catch (...) { 46 | rethrowException("test::execute()"); 47 | } 48 | } 49 | }; 50 | } 51 | ``` 52 | -------------------------------------------------------------------------------- /Documentation/Doxygen/Docs/documentation_examples/guilds/Getting Guild Invites.md: -------------------------------------------------------------------------------- 1 | Getting Guild Invites {#getting_guild_invites} 2 | ============ 3 | - Execute the, `discord_core_api::guilds::getGuildInvitesAsync()` function, while passing in a value of type `discord_core_api::get_guild_invites_data`, with a return value of type `auto` or `jsonifier::vector`. 4 | - call the function with `discord_core_api::co_routine::get()` added to the end in order to wait for the results now. 5 | 6 | ```cpp 7 | /// Test.hpp -header for the "test" command. 8 | /// https://github.com/RealTimeChris/DiscordCoreAPI 9 | 10 | #pragma once 11 | 12 | #include 13 | 14 | namespace discord_core_api { 15 | 16 | class test : public base_function { 17 | public: 18 | test() { 19 | commandName = "test"; 20 | helpDescription = "testing purposes!"; 21 | embed_data msgEmbed; 22 | msgEmbed.setDescription("------\nSimply enter !test or /test!\n------"); 23 | msgEmbed.setTitle("__**test usage:**__"); 24 | msgEmbed.setTimeStamp(getTimeAndDate()); 25 | msgEmbed.setColor("fe_fe_fe"); 26 | helpEmbed = msgEmbed; 27 | } 28 | 29 | unique_ptr create() { 30 | return makeUnique(); 31 | } 32 | 33 | virtual void execute(base_function_arguments& args) { 34 | try { 35 | get_guild_invites_data& dataPackage01; 36 | dataPackage01.guildId = args.eventData.getGuildId(); 37 | 38 | auto responseData = guilds::getGuildInvitesAsync(dataPackage01).get(); 39 | 40 | for (const auto& value: responseData) { 41 | std::cout << value.code << std::endl; 42 | } 43 | 44 | 45 | } catch (...) { 46 | rethrowException("test::execute()"); 47 | } 48 | } 49 | }; 50 | } 51 | 52 | 53 | ``` 54 | -------------------------------------------------------------------------------- /Documentation/Doxygen/Docs/documentation_examples/guilds/Getting Guild Templates.md: -------------------------------------------------------------------------------- 1 | Getting Guild Templates {#getting_guild_templates} 2 | ============== 3 | - Execute the, `discord_core_api::guilds::getGuildTemplatesAsync()` function, while passing in a value of type `discord_core_api::get_guild_templates_data`, with a return value of type `auto` or `jsonifier::vector`. 4 | - call the function with `discord_core_api::co_routine::get()` added to the end in order to wait for the results now. 5 | 6 | ```cpp 7 | /// Test.hpp -header for the "test" command. 8 | /// https://github.com/RealTimeChris/DiscordCoreAPI 9 | 10 | #pragma once 11 | 12 | #include 13 | 14 | namespace discord_core_api { 15 | 16 | class test : public base_function { 17 | public: 18 | test() { 19 | commandName = "test"; 20 | helpDescription = "testing purposes!"; 21 | embed_data msgEmbed; 22 | msgEmbed.setDescription("------\nSimply enter !test or /test!\n------"); 23 | msgEmbed.setTitle("__**test usage:**__"); 24 | msgEmbed.setTimeStamp(getTimeAndDate()); 25 | msgEmbed.setColor("fe_fe_fe"); 26 | helpEmbed = msgEmbed; 27 | } 28 | 29 | unique_ptr create() { 30 | return makeUnique(); 31 | } 32 | 33 | virtual void execute(base_function_arguments& args) { 34 | try { 35 | get_guild_templates_data& dataPackage01; 36 | dataPackage01.guildId = args.eventData.getGuildId(); 37 | 38 | auto responseData = guilds::getGuildTemplatesAsync(dataPackage01).get(); 39 | 40 | for (auto& value: responseData) { 41 | std::cout << "the name: " << value.name << std::endl; 42 | } 43 | 44 | 45 | } catch (...) { 46 | rethrowException("test::execute()"); 47 | } 48 | } 49 | }; 50 | } 51 | ``` 52 | -------------------------------------------------------------------------------- /Documentation/Doxygen/Docs/documentation_examples/guilds/Getting Guild Voice Regions.md: -------------------------------------------------------------------------------- 1 | Getting Guild Voice Regions {#getting_guild_voice_regions} 2 | ============ 3 | - Execute the, `discord_core_api::guilds::getGuildVoiceRegionsAsync()` function, while passing in a value of type `discord_core_api::get_guild_voice_regions_data`, with a return value of type `auto` or `jsonifier::vector`. 4 | - call the function with `discord_core_api::co_routine::get()` added to the end in order to wait for the results now. 5 | 6 | ```cpp 7 | /// Test.hpp -header for the "test" command. 8 | /// https://github.com/RealTimeChris/DiscordCoreAPI 9 | 10 | #pragma once 11 | 12 | #include 13 | 14 | namespace discord_core_api { 15 | 16 | class test : public base_function { 17 | public: 18 | test() { 19 | commandName = "test"; 20 | helpDescription = "testing purposes!"; 21 | embed_data msgEmbed; 22 | msgEmbed.setDescription("------\nSimply enter !test or /test!\n------"); 23 | msgEmbed.setTitle("__**test usage:**__"); 24 | msgEmbed.setTimeStamp(getTimeAndDate()); 25 | msgEmbed.setColor("fe_fe_fe"); 26 | helpEmbed = msgEmbed; 27 | } 28 | 29 | unique_ptr create() { 30 | return makeUnique(); 31 | } 32 | 33 | virtual void execute(base_function_arguments& args) { 34 | try { 35 | get_guild_voice_regions_data& dataPackage01; 36 | dataPackage01.guildId = args.eventData.getGuildId(); 37 | 38 | auto responseData = guilds::getGuildVoiceRegionsAsync(dataPackage01).get(); 39 | 40 | for (const auto& value: responseData) { 41 | std::cout << value.name << std::endl; 42 | } 43 | 44 | 45 | } catch (...) { 46 | rethrowException("test::execute()"); 47 | } 48 | } 49 | }; 50 | } 51 | 52 | 53 | ``` 54 | -------------------------------------------------------------------------------- /Documentation/Doxygen/Docs/documentation_examples/guilds/Getting Guild Widget Settings.md: -------------------------------------------------------------------------------- 1 | Getting Guild Widget Settings {#getting_guild_widget_settings} 2 | ============ 3 | - Execute the, `discord_core_api::guilds::getGuildWidgetSettingsAsync()` function, while passing in a value of type `discord_core_api::get_guild_widget_settings_data`, with a return value of type `auto` or `discord_core_api::guild_widget_data`. 4 | - call the function with `discord_core_api::co_routine::get()` added to the end in order to wait for the results now. 5 | 6 | ```cpp 7 | /// Test.hpp -header for the "test" command. 8 | /// https://github.com/RealTimeChris/DiscordCoreAPI 9 | 10 | #pragma once 11 | 12 | #include 13 | 14 | namespace discord_core_api { 15 | 16 | class test : public base_function { 17 | public: 18 | test() { 19 | commandName = "test"; 20 | helpDescription = "testing purposes!"; 21 | embed_data msgEmbed; 22 | msgEmbed.setDescription("------\nSimply enter !test or /test!\n------"); 23 | msgEmbed.setTitle("__**test usage:**__"); 24 | msgEmbed.setTimeStamp(getTimeAndDate()); 25 | msgEmbed.setColor("fe_fe_fe"); 26 | helpEmbed = msgEmbed; 27 | } 28 | 29 | unique_ptr create() { 30 | return makeUnique(); 31 | } 32 | 33 | virtual void execute(base_function_arguments& args) { 34 | try { 35 | get_guild_widget_settings_data& dataPackage01; 36 | dataPackage01.guildId = args.eventData.getGuildId(); 37 | 38 | auto responseData = guilds::getGuildWidgetSettingsAsync(dataPackage01).get(); 39 | 40 | std::cout << boolalpha << responseData.enabled << std::endl; 41 | 42 | } catch (...) { 43 | rethrowException("test::execute()"); 44 | } 45 | } 46 | }; 47 | } 48 | ``` 49 | -------------------------------------------------------------------------------- /Documentation/Doxygen/Docs/documentation_examples/guilds/Getting a Guild Ban.md: -------------------------------------------------------------------------------- 1 | Getting a Guild Ban {#getting_a_guild_ban} 2 | ============ 3 | - Execute the, `discord_core_api::guilds::getGuildBanAsync()` function, while passing in a value of type `discord_core_api::get_guild_ban_data`, with a return value of type `auto` or `discord_core_api::ban_data`. 4 | - call the function with `discord_core_api::co_routine::get()` added to the end in order to wait for the results now. 5 | 6 | ```cpp 7 | /// Test.hpp -header for the "test" command. 8 | /// https://github.com/RealTimeChris/DiscordCoreAPI 9 | 10 | #pragma once 11 | 12 | #include 13 | 14 | namespace discord_core_api { 15 | 16 | class test : public base_function { 17 | public: 18 | test() { 19 | commandName = "test"; 20 | helpDescription = "testing purposes!"; 21 | embed_data msgEmbed; 22 | msgEmbed.setDescription("------\nSimply enter !test or /test!\n------"); 23 | msgEmbed.setTitle("__**test usage:**__"); 24 | msgEmbed.setTimeStamp(getTimeAndDate()); 25 | msgEmbed.setColor("fe_fe_fe"); 26 | helpEmbed = msgEmbed; 27 | } 28 | 29 | unique_ptr create() { 30 | return makeUnique(); 31 | } 32 | 33 | virtual void execute(base_function_arguments& args) { 34 | try { 35 | get_guild_ban_data& dataPackage01; 36 | dataPackage01.guildId = args.eventData.getGuildId(); 37 | dataPackage01.userId = "851629399514415106"; 38 | 39 | auto guildBan = guilds::getGuildBanAsync(dataPackage01).get(); 40 | 41 | std::cout << "the ban name: " << guildBan.user.userName << std::endl; 42 | 43 | 44 | } catch (...) { 45 | rethrowException("test::execute()"); 46 | } 47 | } 48 | }; 49 | } 50 | ``` 51 | -------------------------------------------------------------------------------- /Documentation/Doxygen/Docs/documentation_examples/guilds/Getting a Guild Preview.md: -------------------------------------------------------------------------------- 1 | Getting a Guild Preview {#getting_a_guild_preview} 2 | ============ 3 | - Execute the, `discord_core_api::guilds::getGuildPreviewAsync()` function, while passing in a value of type `discord_core_api::get_guild_preview_data`, with a return value of type `auto` or `discord_core_api::guild_preview_data`. 4 | - call the function with `discord_core_api::co_routine::get()` added to the end in order to wait for the results now. 5 | 6 | ```cpp 7 | /// Test.hpp -header for the "test" command. 8 | /// https://github.com/RealTimeChris/DiscordCoreAPI 9 | 10 | #pragma once 11 | 12 | #include 13 | 14 | namespace discord_core_api { 15 | 16 | class test : public base_function { 17 | public: 18 | test() { 19 | commandName = "test"; 20 | helpDescription = "testing purposes!"; 21 | embed_data msgEmbed; 22 | msgEmbed.setDescription("------\nSimply enter !test or /test!\n------"); 23 | msgEmbed.setTitle("__**test usage:**__"); 24 | msgEmbed.setTimeStamp(getTimeAndDate()); 25 | msgEmbed.setColor("fe_fe_fe"); 26 | helpEmbed = msgEmbed; 27 | } 28 | 29 | unique_ptr create() { 30 | return makeUnique(); 31 | } 32 | 33 | virtual void execute(base_function_arguments& args) { 34 | try { 35 | get_guild_preview_data& dataPackage00; 36 | dataPackage00.guildId = args.eventData.getGuildId(); 37 | 38 | auto guild_data = guilds::getGuildPreviewAsync(dataPackage00).get(); 39 | 40 | std::cout << "the name: " << guild_data.name << std::endl; 41 | 42 | 43 | } catch (...) { 44 | rethrowException("test::execute()"); 45 | } 46 | } 47 | }; 48 | } 49 | ``` 50 | -------------------------------------------------------------------------------- /Documentation/Doxygen/Docs/documentation_examples/guilds/Getting a Guild Prune Count.md: -------------------------------------------------------------------------------- 1 | Getting a Guild Prune Count {#getting_a_guild_prune_count} 2 | ============ 3 | - select, from the `discord_core_api::guilds::getGuildPruneCountAsync()` function, while passing in a value of type `discord_core_api::get_guild_prune_count_data`, with a return value of type `auto` or `discord_core_api::guild_prune_count_data`. 4 | - call the function with `discord_core_api::co_routine::get()` added to the end in order to wait for the results now. 5 | 6 | ```cpp 7 | /// Test.hpp -header for the "test" command. 8 | /// https://github.com/RealTimeChris/DiscordCoreAPI 9 | 10 | #pragma once 11 | 12 | #include 13 | 14 | namespace discord_core_api { 15 | 16 | class test : public base_function { 17 | public: 18 | test() { 19 | commandName = "test"; 20 | helpDescription = "testing purposes!"; 21 | embed_data msgEmbed; 22 | msgEmbed.setDescription("------\nSimply enter !test or /test!\n------"); 23 | msgEmbed.setTitle("__**test usage:**__"); 24 | msgEmbed.setTimeStamp(getTimeAndDate()); 25 | msgEmbed.setColor("fe_fe_fe"); 26 | helpEmbed = msgEmbed; 27 | } 28 | 29 | unique_ptr create() { 30 | return makeUnique(); 31 | } 32 | 33 | virtual void execute(base_function_arguments& args) { 34 | try { 35 | get_guild_prune_count_data& dataPackage01; 36 | dataPackage01.days = 28; 37 | dataPackage01.roles.emplace_back("860075141818744853"); 38 | dataPackage01.guildId = args.eventData.getGuildId(); 39 | 40 | auto responseData = guilds::getGuildPruneCountAsync(dataPackage01).get(); 41 | 42 | std::cout << responseData.count << std::endl; 43 | 44 | 45 | } catch (...) { 46 | rethrowException("test::execute()"); 47 | } 48 | } 49 | }; 50 | } 51 | 52 | 53 | ``` 54 | -------------------------------------------------------------------------------- /Documentation/Doxygen/Docs/documentation_examples/guilds/Getting a Guild Template.md: -------------------------------------------------------------------------------- 1 | Getting a Guild Template {#getting_a_guild_template} 2 | ============ 3 | - Execute the, `discord_core_api::guilds::getGuildTemplateAsync()` function, while passing in a value of type `discord_core_api::get_guild_template_data`, with a return value of type `auto` or `discord_core_api::guild_template_data`. 4 | - call the function with `discord_core_api::co_routine::get()` added to the end in order to wait for the results now. 5 | 6 | ```cpp 7 | /// Test.hpp -header for the "test" command. 8 | /// https://github.com/RealTimeChris/DiscordCoreAPI 9 | 10 | #pragma once 11 | 12 | #include 13 | 14 | namespace discord_core_api { 15 | 16 | class test : public base_function { 17 | public: 18 | test() { 19 | commandName = "test"; 20 | helpDescription = "testing purposes!"; 21 | embed_data msgEmbed; 22 | msgEmbed.setDescription("------\nSimply enter !test or /test!\n------"); 23 | msgEmbed.setTitle("__**test usage:**__"); 24 | msgEmbed.setTimeStamp(getTimeAndDate()); 25 | msgEmbed.setColor("fe_fe_fe"); 26 | helpEmbed = msgEmbed; 27 | } 28 | 29 | unique_ptr create() { 30 | return makeUnique(); 31 | } 32 | 33 | virtual void execute(base_function_arguments& args) { 34 | try { 35 | get_guild_template_data& dataPackage01; 36 | dataPackage01.templateCode = "ym_rr2bj5_ny_yx"; 37 | 38 | auto responseData = guilds::getGuildTemplateAsync(dataPackage01).get(); 39 | 40 | std::cout << "user name: " << responseData.creator.userName << std::endl; 41 | 42 | 43 | } catch (...) { 44 | rethrowException("test::execute()"); 45 | } 46 | } 47 | }; 48 | } 49 | ``` 50 | -------------------------------------------------------------------------------- /Documentation/Doxygen/Docs/documentation_examples/guilds/Getting a Guild Vanity Invite.md: -------------------------------------------------------------------------------- 1 | Getting a Guild Vanity Invite {#getting_a_guild_vanity_invite} 2 | ============ 3 | - Execute the, `discord_core_api::guilds::getGuildVanityInviteAsync()` function, while passing in a value of type `discord_core_api::get_guild_vanity_invite_data`, with a return value of type `auto` or `discord_core_api::invite_data`. 4 | - call the function with `discord_core_api::co_routine::get()` added to the end in order to wait for the results now. 5 | 6 | ```cpp 7 | /// Test.hpp -header for the "test" command. 8 | /// https://github.com/RealTimeChris/DiscordCoreAPI 9 | 10 | #pragma once 11 | 12 | #include 13 | 14 | namespace discord_core_api { 15 | 16 | class test : public base_function { 17 | public: 18 | test() { 19 | commandName = "test"; 20 | helpDescription = "testing purposes!"; 21 | embed_data msgEmbed; 22 | msgEmbed.setDescription("------\nSimply enter !test or /test!\n------"); 23 | msgEmbed.setTitle("__**test usage:**__"); 24 | msgEmbed.setTimeStamp(getTimeAndDate()); 25 | msgEmbed.setColor("fe_fe_fe"); 26 | helpEmbed = msgEmbed; 27 | } 28 | 29 | unique_ptr create() { 30 | return makeUnique(); 31 | } 32 | 33 | virtual void execute(base_function_arguments& args) { 34 | try { 35 | get_guild_vanity_invite_data& dataPackage01; 36 | dataPackage01.guildId = args.eventData.getGuildId(); 37 | 38 | auto responseData = guilds::getGuildVanityInviteAsync(dataPackage01).get(); 39 | 40 | std::cout << boolalpha << responseData.code << std::endl; 41 | 42 | } catch (...) { 43 | rethrowException("test::execute()"); 44 | } 45 | } 46 | }; 47 | } 48 | ``` 49 | -------------------------------------------------------------------------------- /Documentation/Doxygen/Docs/documentation_examples/guilds/Getting a Guild Welcome Screen.md: -------------------------------------------------------------------------------- 1 | Getting a Guild Welcome Screen {#getting_a_guild_welcome_screen} 2 | ============= 3 | - Execute the, `discord_core_api::guilds::getGuildWelcomeScreenAsync()` function, while passing in a value of type `discord_core_api::get_guild_welcome_screen_data`, with a return value of type `auto` or `discord_core_api::welcome_screen_data`. 4 | - call the function with `discord_core_api::co_routine::get()` added to the end in order to wait for the results now. 5 | 6 | ```cpp 7 | /// Test.hpp -header for the "test" command. 8 | /// https://github.com/RealTimeChris/DiscordCoreAPI 9 | 10 | #pragma once 11 | 12 | #include 13 | 14 | namespace discord_core_api { 15 | 16 | class test : public base_function { 17 | public: 18 | test() { 19 | commandName = "test"; 20 | helpDescription = "testing purposes!"; 21 | embed_data msgEmbed; 22 | msgEmbed.setDescription("------\nSimply enter !test or /test!\n------"); 23 | msgEmbed.setTitle("__**test usage:**__"); 24 | msgEmbed.setTimeStamp(getTimeAndDate()); 25 | msgEmbed.setColor("fe_fe_fe"); 26 | helpEmbed = msgEmbed; 27 | } 28 | 29 | unique_ptr create() { 30 | return makeUnique(); 31 | } 32 | 33 | virtual void execute(base_function_arguments& args) { 34 | try { 35 | get_guild_welcome_screen_data& dataPackage01; 36 | dataPackage01.guildId = args.eventData.getGuildId(); 37 | 38 | auto responseData = guilds::getGuildWelcomeScreenAsync(dataPackage01).get(); 39 | 40 | std::cout << boolalpha << responseData.welcomeChannels.at(0).channelId << std::endl; 41 | 42 | } catch (...) { 43 | rethrowException("test::execute()"); 44 | } 45 | } 46 | }; 47 | } 48 | ``` 49 | -------------------------------------------------------------------------------- /Documentation/Doxygen/Docs/documentation_examples/guilds/Getting a Guild Widget Image.md: -------------------------------------------------------------------------------- 1 | Getting a Guild Widget Image {#getting_a_guild_widget_image} 2 | ============ 3 | - Execute the, `discord_core_api::guilds::getGuildWidgetImageAsync()` function, while passing in a value of type `discord_core_api::get_guild_widget_image_data`, with a return value of type `auto` or `discord_core_api::guild_widget_image_data`. 4 | - call the function with `discord_core_api::co_routine::get()` added to the end in order to wait for the results now. 5 | 6 | ```cpp 7 | /// Test.hpp -header for the "test" command. 8 | /// https://github.com/RealTimeChris/DiscordCoreAPI 9 | 10 | #pragma once 11 | 12 | #include 13 | 14 | namespace discord_core_api { 15 | 16 | class test : public base_function { 17 | public: 18 | test() { 19 | commandName = "test"; 20 | helpDescription = "testing purposes!"; 21 | embed_data msgEmbed; 22 | msgEmbed.setDescription("------\nSimply enter !test or /test!\n------"); 23 | msgEmbed.setTitle("__**test usage:**__"); 24 | msgEmbed.setTimeStamp(getTimeAndDate()); 25 | msgEmbed.setColor("fe_fe_fe"); 26 | helpEmbed = msgEmbed; 27 | } 28 | 29 | unique_ptr create() { 30 | return makeUnique(); 31 | } 32 | 33 | virtual void execute(base_function_arguments& args) { 34 | try { 35 | get_guild_widget_image_data& dataPackage01; 36 | dataPackage01.guildId = args.eventData.getGuildId(); 37 | 38 | auto responseData = guilds::getGuildWidgetImageAsync(dataPackage01).get(); 39 | 40 | std::cout << boolalpha << responseData.url << std::endl; 41 | 42 | } catch (...) { 43 | rethrowException("test::execute()"); 44 | } 45 | } 46 | }; 47 | } 48 | ``` 49 | -------------------------------------------------------------------------------- /Documentation/Doxygen/Docs/documentation_examples/guilds/Getting a Guild Widget.md: -------------------------------------------------------------------------------- 1 | Getting a Guild Widget {#getting_a_guild_widget} 2 | ============ 3 | - Execute the, `discord_core_api::guilds::getGuildWidgetAsync()` function, while passing in a value of type `discord_core_api::get_guild_widget_data`, with a return value of type `auto` or `discord_core_api::guild_widget_data`. 4 | - call the function with `discord_core_api::co_routine::get()` added to the end in order to wait for the results now. 5 | 6 | ```cpp 7 | /// Test.hpp -header for the "test" command. 8 | /// https://github.com/RealTimeChris/DiscordCoreAPI 9 | 10 | #pragma once 11 | 12 | #include 13 | 14 | namespace discord_core_api { 15 | 16 | class test : public base_function { 17 | public: 18 | test() { 19 | commandName = "test"; 20 | helpDescription = "testing purposes!"; 21 | embed_data msgEmbed; 22 | msgEmbed.setDescription("------\nSimply enter !test or /test!\n------"); 23 | msgEmbed.setTitle("__**test usage:**__"); 24 | msgEmbed.setTimeStamp(getTimeAndDate()); 25 | msgEmbed.setColor("fe_fe_fe"); 26 | helpEmbed = msgEmbed; 27 | } 28 | 29 | unique_ptr create() { 30 | return makeUnique(); 31 | } 32 | 33 | virtual void execute(base_function_arguments& args) { 34 | try { 35 | get_guild_widget_data& dataPackage01; 36 | dataPackage01.guildId = args.eventData.getGuildId(); 37 | 38 | auto responseData = guilds::getGuildWidgetAsync(dataPackage01).get(); 39 | 40 | std::cout << boolalpha << responseData.enabled << std::endl; 41 | 42 | } catch (...) { 43 | rethrowException("test::execute()"); 44 | } 45 | } 46 | }; 47 | } 48 | ``` 49 | -------------------------------------------------------------------------------- /Documentation/Doxygen/Docs/documentation_examples/guilds/Getting a Guild.md: -------------------------------------------------------------------------------- 1 | Getting a Guild {#getting_a_guild} 2 | ============ 3 | - Execute the, `discord_core_api::guilds::getCachedGuild()` (which collects it from the cache), or `discord_core_api::guilds::getGuildAsync()` (which collects it from the discord servers) function, while passing to it a data structure of type `discord_core_api::get_guild_data`, with a return value of `discord_core_api::guild_data`. 4 | - call the function with `discord_core_api::co_routine::get()` added to the end in order to wait for the results now. 5 | 6 | ```cpp 7 | /// Test.hpp -header for the "test" command. 8 | /// https://github.com/RealTimeChris/DiscordCoreAPI 9 | 10 | #pragma once 11 | 12 | #include "index.hpp" 13 | 14 | namespace discord_core_api { 15 | 16 | class test : public base_function { 17 | public: 18 | test() { 19 | commandName = "test"; 20 | helpDescription = "testing purposes!"; 21 | embed_data msgEmbed; 22 | msgEmbed.setDescription("------\nSimply enter !test or /test!\n------"); 23 | msgEmbed.setTitle("__**test Usage__"); 24 | msgEmbed.setTimeStamp(getTimeAndDate()); 25 | msgEmbed.setColor("fe_fe_fe"); 26 | helpEmbed = msgEmbed; 27 | } 28 | 29 | unique_ptr create() { 30 | return makeUnique(); 31 | } 32 | 33 | virtual void execute(base_function_arguments& args) { 34 | guild_data guild01 = guilds::getCachedGuild({args.eventData.getGuildId()}).get(); 35 | 36 | guild_data guild02 = guilds::getGuildAsync({args.eventData.getGuildId()}).get(); 37 | } 38 | }; 39 | } 40 | ``` 41 | -------------------------------------------------------------------------------- /Documentation/Doxygen/Docs/documentation_examples/guilds/Leaving a Guild.md: -------------------------------------------------------------------------------- 1 | Leaving a Guild {#leaving_a_guild} 2 | ============ 3 | - Execute the, `discord_core_api::guilds::leaveGuildAsync()` function, while passing in a value of type `discord_core_api::leave_guild_data`, with a return value of type `void`. 4 | - call the function with `discord_core_api::co_routine::get()` added to the end in order to wait for the results now. 5 | 6 | ```cpp 7 | /// Test.hpp -header for the "test" command. 8 | /// https://github.com/RealTimeChris/DiscordCoreAPI 9 | 10 | #pragma once 11 | 12 | #include 13 | 14 | namespace discord_core_api { 15 | 16 | class test : public base_function { 17 | public: 18 | test() { 19 | commandName = "test"; 20 | helpDescription = "testing purposes!"; 21 | embed_data msgEmbed; 22 | msgEmbed.setDescription("------\nSimply enter !test or /test!\n------"); 23 | msgEmbed.setTitle("__**test usage:**__"); 24 | msgEmbed.setTimeStamp(getTimeAndDate()); 25 | msgEmbed.setColor("fe_fe_fe"); 26 | helpEmbed = msgEmbed; 27 | } 28 | 29 | unique_ptr create() { 30 | return makeUnique(); 31 | } 32 | 33 | virtual void execute(base_function_arguments& args) { 34 | try { 35 | leave_guild_data& dataPackage; 36 | dataPackage.guildId = "GUIILD_ID_HERE"; 37 | 38 | guilds::leaveGuildAsync(dataPackage).get(); 39 | 40 | 41 | } catch (...) { 42 | rethrowException("test::execute()"); 43 | } 44 | } 45 | 46 | virtual ~test() = default; 47 | }; 48 | } 49 | ``` 50 | -------------------------------------------------------------------------------- /Documentation/Doxygen/Docs/documentation_examples/guilds/Removing a Guild Ban.md: -------------------------------------------------------------------------------- 1 | Removing a Guild Ban {#removing_a_guild_ban} 2 | ============ 3 | - Execute the, `discord_core_api::guilds::removeGuildBanAsync()` function, while passing in a value of type `discord_core_api::remove_guild_ban_data`, with a return value of type `void`. 4 | - call the function with `discord_core_api::co_routine::get()` added to the end in order to wait for the results now. 5 | 6 | ```cpp 7 | /// Test.hpp -header for the "test" command. 8 | /// https://github.com/RealTimeChris/DiscordCoreAPI 9 | 10 | #pragma once 11 | 12 | #include 13 | 14 | namespace discord_core_api { 15 | 16 | class test : public base_function { 17 | public: 18 | test() { 19 | commandName = "test"; 20 | helpDescription = "testing purposes!"; 21 | embed_data msgEmbed; 22 | msgEmbed.setDescription("------\nSimply enter !test or /test!\n------"); 23 | msgEmbed.setTitle("__**test usage:**__"); 24 | msgEmbed.setTimeStamp(getTimeAndDate()); 25 | msgEmbed.setColor("fe_fe_fe"); 26 | helpEmbed = msgEmbed; 27 | } 28 | 29 | unique_ptr create() { 30 | return makeUnique(); 31 | } 32 | 33 | virtual void execute(base_function_arguments& args) { 34 | try { 35 | remove_guild_ban_data& dataPackage01; 36 | dataPackage01.guildId = args.eventData.getGuildId(); 37 | dataPackage01.userId = "869276807394902066"; 38 | dataPackage01.reason = "testing purposes!"; 39 | 40 | guilds::removeGuildBanAsync(dataPackage01).get(); 41 | 42 | 43 | } catch (...) { 44 | rethrowException("test::execute()"); 45 | } 46 | } 47 | }; 48 | } 49 | ``` 50 | -------------------------------------------------------------------------------- /Documentation/Doxygen/Docs/documentation_examples/input_events/Deleting an Interaction Response.md: -------------------------------------------------------------------------------- 1 | Deleting an Interaction Response {#deleting_an_input_event_response} 2 | ============ 3 | - Execute the, `discord_core_api::input_events::deleteInputEventResponseAsync()` function, while passing in a data structure of type `discord_core_api::input_event_data`, with a return value of type `void`. 4 | - call the function with `discord_core_api::co_routine::get()` added to the end in order to wait for its return value now. 5 | 6 | ```cpp 7 | /// Test.hpp -header for the "test" command. 8 | /// https://github.com/RealTimeChris/DiscordCoreAPI 9 | 10 | #pragma once 11 | 12 | #include "index.hpp" 13 | 14 | namespace discord_core_api { 15 | 16 | class test : public base_function { 17 | public: 18 | test() { 19 | commandName = "test"; 20 | helpDescription = "testing purposes!"; 21 | embed_data msgEmbed; 22 | msgEmbed.setDescription("------\nSimply enter !test or /test!\n------"); 23 | msgEmbed.setTitle("__**test usage:**__"); 24 | msgEmbed.setTimeStamp(getTimeAndDate()); 25 | msgEmbed.setColor("fe_fe_fe"); 26 | helpEmbed = msgEmbed; 27 | } 28 | 29 | unique_ptr create() { 30 | return makeUnique(); 31 | } 32 | 33 | virtual void execute(base_function_arguments& args) { 34 | input_events::deleteInputEventResponseAsync(args.eventData).get(); 35 | 36 | respond_to_input_event_data& dataPackage02 {args.eventData}; 37 | dataPackage02.addContent("test response"); 38 | auto inputEventData = input_events::respondToInputEventAsync(dataPackage02); 39 | 40 | input_events::deleteInputEventResponseAsync(inputEventData).get(); 41 | } 42 | }; 43 | } 44 | ``` 45 | -------------------------------------------------------------------------------- /Documentation/Doxygen/Docs/documentation_examples/interactions/Creating a Follow-Up Message.md: -------------------------------------------------------------------------------- 1 | Creating a Follow-Up Message {#creating_a_follow_up_message} 2 | ============ 3 | - Execute the, `discord_core_api::input_events::respondToInputEventAsync()` function, while passing in a data structure of type `discord_core_api::respond_to_input_event_data` with a type set to `discord_core_api::input_event_response_type::Follow_Up_Message`, with a return value of type `auto` or `discord_core_api::unique_ptr`. 4 | 5 | ```cpp 6 | /// Test.hpp -header for the "test" command. 7 | /// https://github.com/RealTimeChris/DiscordCoreAPI 8 | 9 | #pragma once 10 | 11 | #include 12 | 13 | namespace discord_core_api { 14 | 15 | class test : public base_function { 16 | public: 17 | test() { 18 | commandName = "test"; 19 | helpDescription = "testing purposes!"; 20 | embed_data msgEmbed { }; 21 | msgEmbed.setDescription("------\nSimply enter !test or /test!\n------"); 22 | msgEmbed.setTitle("__**test usage:**__"); 23 | msgEmbed.setTimeStamp(getTimeAndDate()); 24 | msgEmbed.setColor("fe_fe_fe"); 25 | helpEmbed = msgEmbed; 26 | } 27 | 28 | unique_ptr create() { 29 | return makeUnique(); 30 | } 31 | 32 | virtual void execute(base_function_arguments& args) { 33 | try { 34 | respond_to_input_event_data& dataPackage {args.eventData}; 35 | dataPackage.type = input_event_response_type::Follow_Up_Message; 36 | dataPackage.addContent("this is a test response message!"); 37 | auto responseData = input_events::respondToInputEventAsync(dataPackage); 38 | 39 | } catch (...) { 40 | rethrowException("test::execute() error: "); 41 | } 42 | } 43 | }; 44 | } 45 | ``` 46 | -------------------------------------------------------------------------------- /Documentation/Doxygen/Docs/documentation_examples/interactions/Deleting a Follow-Up Message.md: -------------------------------------------------------------------------------- 1 | Deleting a Follow-Up Message {#deleting_a_follow_up_message} 2 | ============ 3 | - Execute the, `discord_core_api::input_events::deleteInputEventResponseAsync()` function, while passing in a data structure of type `discord_core_api::input_event_data`, with a return value of type `void`. 4 | - call the function with `discord_core_api::co_routine::get()` added to the end in order to wait for its return value now. 5 | 6 | ```cpp 7 | /// Test.hpp -header for the "test" command. 8 | /// https://github.com/RealTimeChris/DiscordCoreAPI 9 | 10 | #pragma once 11 | 12 | #include 13 | 14 | namespace discord_core_api { 15 | 16 | class test : public base_function { 17 | public: 18 | test() { 19 | commandName = "test"; 20 | helpDescription = "testing purposes!"; 21 | embed_data msgEmbed { }; 22 | msgEmbed.setDescription("------\nSimply enter !test or /test!\n------"); 23 | msgEmbed.setTitle("__**test usage:**__"); 24 | msgEmbed.setTimeStamp(getTimeAndDate()); 25 | msgEmbed.setColor("fe_fe_fe"); 26 | helpEmbed = msgEmbed; 27 | } 28 | 29 | unique_ptr create() { 30 | return makeUnique(); 31 | } 32 | 33 | virtual void execute(base_function_arguments& args) { 34 | try { 35 | respond_to_input_event_data& dataPackage {args.eventData}; 36 | dataPackage.type = input_event_response_type::Follow_Up_Message; 37 | dataPackage.addContent("test content"); 38 | auto result = input_events::respondToInputEventAsync(dataPackage); 39 | auto responseData = input_events::deleteInputEventResponseAsync(result); 40 | 41 | } catch (...) { 42 | rethrowException("test::execute() error: "); 43 | } 44 | } 45 | }; 46 | } 47 | ``` 48 | -------------------------------------------------------------------------------- /Documentation/Doxygen/Docs/documentation_examples/interactions/Deleting an Interaction Response.md: -------------------------------------------------------------------------------- 1 | Deleting an Interaction Response {#deleting_an_interaction_response} 2 | ============ 3 | - Execute the, `discord_core_api::input_events::deleteInputEventResponseAsync()` function, while passing in a data structure of type `discord_core_api::input_event_data`, with a return value of type `void`. 4 | - call the function with `discord_core_api::co_routine::get()` added to the end in order to wait for its return value now. 5 | 6 | ```cpp 7 | /// Test.hpp -header for the "test" command. 8 | /// https://github.com/RealTimeChris/DiscordCoreAPI 9 | 10 | #pragma once 11 | 12 | #include "index.hpp" 13 | 14 | namespace discord_core_api { 15 | 16 | class test : public base_function { 17 | public: 18 | test() { 19 | commandName = "test"; 20 | helpDescription = "testing purposes!"; 21 | embed_data msgEmbed; 22 | msgEmbed.setDescription("------\nSimply enter !test or /test!\n------"); 23 | msgEmbed.setTitle("__**test usage:**__"); 24 | msgEmbed.setTimeStamp(getTimeAndDate()); 25 | msgEmbed.setColor("fe_fe_fe"); 26 | helpEmbed = msgEmbed; 27 | } 28 | 29 | unique_ptr create() { 30 | return makeUnique(); 31 | } 32 | 33 | virtual void execute(base_function_arguments& args) { 34 | input_events::deleteInputEventResponseAsync(args.eventData).get(); 35 | 36 | respond_to_input_event_data& dataPackage02 {args.eventData}; 37 | dataPackage02.type = input_event_response_type::Interaction_Response; 38 | dataPackage02.addContent("test response"); 39 | auto inputEventData = input_events::respondToInputEventAsync(dataPackage02); 40 | 41 | input_events::deleteInputEventResponseAsync(inputEventData).get(); 42 | } 43 | }; 44 | } 45 | ``` 46 | -------------------------------------------------------------------------------- /Documentation/Doxygen/Docs/documentation_examples/interactions/Editing a Follow-Up Message.md: -------------------------------------------------------------------------------- 1 | Editing a Follow-Up Message {#editing_a_follow_up_message} 2 | ============ 3 | - Execute the, `discord_core_api::input_events::respondToInputEventAsync()` function, while passing in a data structure of type `discord_core_api::respond_to_input_event_data` with a type set to `discord_core_api::input_event_response_type::Edit_Follow_Up_Message`, with a return value of type `auto` or `discord_core_api::unique_ptr`. 4 | 5 | ```cpp 6 | /// Test.hpp -header for the "test" command. 7 | /// https://github.com/RealTimeChris/DiscordCoreAPI 8 | 9 | #pragma once 10 | 11 | #include 12 | 13 | namespace discord_core_api { 14 | 15 | class test : public base_function { 16 | public: 17 | test() { 18 | commandName = "test"; 19 | helpDescription = "testing purposes!"; 20 | embed_data msgEmbed { }; 21 | msgEmbed.setDescription("------\nSimply enter !test or /test!\n------"); 22 | msgEmbed.setTitle("__**test usage:**__"); 23 | msgEmbed.setTimeStamp(getTimeAndDate()); 24 | msgEmbed.setColor("fe_fe_fe"); 25 | helpEmbed = msgEmbed; 26 | } 27 | 28 | unique_ptr create() { 29 | return makeUnique(); 30 | } 31 | 32 | virtual void execute(base_function_arguments& args) { 33 | try { 34 | respond_to_input_event_data& dataPackage {args.eventData}; 35 | dataPackage.type = input_event_response_type::follow_up_message_edit; 36 | dataPackage.addContent("this is a test response message!"); 37 | auto responseData = input_events::respondToInputEventAsync(dataPackage); 38 | 39 | } catch (...) { 40 | rethrowException("test::execute() error: "); 41 | } 42 | } 43 | }; 44 | } 45 | ``` 46 | -------------------------------------------------------------------------------- /Documentation/Doxygen/Docs/documentation_examples/interactions/Getting a Follow-Up Message.md: -------------------------------------------------------------------------------- 1 | Getting a Follow-Up Message {#getting_a_follow_up_message} 2 | ============ 3 | - Execute the, `discord_core_api::interactions::getFollowUpMessageAsync()` function and execute it, while passing in a data structure of type `discord_core_api::get_follow_up_message_data`, with a return value of type `auto` or `discord_core_api::message_data`. 4 | 5 | ```cpp 6 | /// Test.hpp -header for the "test" command. 7 | /// https://github.com/RealTimeChris/DiscordCoreAPI 8 | 9 | #pragma once 10 | 11 | #include 12 | 13 | namespace discord_core_api { 14 | 15 | class test : public base_function { 16 | public: 17 | test() { 18 | commandName = "test"; 19 | helpDescription = "testing purposes!"; 20 | embed_data msgEmbed { }; 21 | msgEmbed.setDescription("------\nSimply enter !test or /test!\n------"); 22 | msgEmbed.setTitle("__**test usage:**__"); 23 | msgEmbed.setTimeStamp(getTimeAndDate()); 24 | msgEmbed.setColor("fe_fe_fe"); 25 | helpEmbed = msgEmbed; 26 | } 27 | 28 | unique_ptr create() { 29 | return makeUnique(); 30 | } 31 | 32 | virtual void execute(base_function_arguments& args) { 33 | try { 34 | get_follow_up_message_data& dataPackage; 35 | dataPackage.applicationId = getBotUser().id; 36 | dataPackage.interactionToken = args.eventData.getInteractionToken(); 37 | dataPackage.interactionToken = args.eventData.getMessageId(); 38 | auto responseData = interactions::getFollowUpMessageAsync(dataPackage); 39 | 40 | } catch (...) { 41 | rethrowException("test::execute() error: "); 42 | } 43 | } 44 | }; 45 | } 46 | ``` 47 | -------------------------------------------------------------------------------- /Documentation/Doxygen/Docs/documentation_examples/interactions/Getting an Interaction Response.md: -------------------------------------------------------------------------------- 1 | Getting an Interaction Response {#getting_an_interaction_response} 2 | ============ 3 | - Execute the, `discord_core_api::interactions::getInteractionResponseAsync()` function, while passing in a data structure of type `discord_core_api::get_interaction_response_data`, with a return type of `discord_core_api::message_data`. 4 | 5 | ```cpp 6 | /// Test.hpp -header for the "test" command. 7 | /// https://github.com/RealTimeChris/DiscordCoreAPI 8 | 9 | #pragma once 10 | 11 | #include 12 | 13 | namespace discord_core_api { 14 | 15 | class test : public base_function { 16 | public: 17 | test() { 18 | commandName = "test"; 19 | helpDescription = "testing purposes!"; 20 | embed_data msgEmbed { }; 21 | msgEmbed.setDescription("------\nSimply enter !test or /test!\n------"); 22 | msgEmbed.setTitle("__**test usage:**__"); 23 | msgEmbed.setTimeStamp(getTimeAndDate()); 24 | msgEmbed.setColor("fe_fe_fe"); 25 | helpEmbed = msgEmbed; 26 | } 27 | 28 | unique_ptr create() { 29 | return makeUnique(); 30 | } 31 | 32 | virtual void execute(base_function_arguments& args) { 33 | try { 34 | get_interaction_response_data& dataPackage; 35 | dataPackage.applicationId = getBotUser().id; 36 | dataPackage.interactionToken = args.eventData.getInteractionToken(); 37 | 38 | auto interactionResponse = interactions::getInteractionResponseAsync(dataPackage).get(); 39 | 40 | 41 | } catch (...) { 42 | rethrowException("test::execute() error: "); 43 | } 44 | } 45 | }; 46 | } 47 | ``` 48 | -------------------------------------------------------------------------------- /Documentation/Doxygen/Docs/documentation_examples/login_setup/Login-Instantiation.md: -------------------------------------------------------------------------------- 1 | Login/Instantiation {#login_and_instantiation} 2 | ============ 3 | - note for sharding: make sure to set the `discord_core_api::sharding_options` options of the `discord_core_api::discord_core_client_config` structure. 4 | - install the dependencies, and `#include `. 5 | - create a string with your bot's token. 6 | - create an object of type `discord_core_api::discord_core_client`, using an instance of `discord_core_api::discord_core_client_config` as the argument - being sure to at least set the `discord_core_api::discord_core_client_config::botToken` member of it. 7 | - run the `discord_core_api::discord_core_client::runBot()` function. 8 | 9 | ```cpp 10 | /// main.cpp-main entry point. 11 | /// https://github.com/RealTimeChris/DiscordCoreAPI 12 | 13 | #include 14 | 15 | int main() 16 | { 17 | discord_core_client_config clientConfig{}; 18 | clientConfig.botToken = "YOUR_BOT_TOKEN_HERE"; 19 | jsonifier::vector activities{}; 20 | activity_data activity{}; 21 | activity.name = "/help for my commands!"; 22 | activity.type = activity_type::game; 23 | activities.pushBack(activity); 24 | clientConfig.presenceData.activities = activities; 25 | clientConfig.presenceData.afk = false; 26 | clientConfig.presenceData.since = 0; 27 | clientConfig.presenceData.status = "online"; 28 | auto ptr = makeUnique(clientConfig); 29 | } 30 | ``` 31 | -------------------------------------------------------------------------------- /Documentation/Doxygen/Docs/documentation_examples/messages/Bulk Deleting Messages.md: -------------------------------------------------------------------------------- 1 | Bulk Deleting Messages {#bulk_deleting_messages} 2 | ============ 3 | - Execute the, `discord_core_api::messages::deleteMessagesBulkAsync()` function, while passing in a data structure of type `discord_core_api::delete_messages_bulk_data`, with a return value of type `void`. 4 | - call the function with `discord_core_api::co_routine::get()` added to the end in order to wait for its return value now. 5 | 6 | ```cpp 7 | /// Test.hpp -header for the "test" command. 8 | /// https://github.com/RealTimeChris/DiscordCoreAPI 9 | 10 | #pragma once 11 | 12 | #include 13 | 14 | namespace discord_core_api { 15 | 16 | class test : public base_function { 17 | public: 18 | test() { 19 | commandName = "test"; 20 | helpDescription = "testing purposes!"; 21 | embed_data msgEmbed { }; 22 | msgEmbed.setDescription("------\nSimply enter !test or /test!\n------"); 23 | msgEmbed.setTitle("__**test usage:**__"); 24 | msgEmbed.setTimeStamp(getTimeAndDate()); 25 | msgEmbed.setColor("fe_fe_fe"); 26 | helpEmbed = msgEmbed; 27 | } 28 | 29 | unique_ptr create() { 30 | return makeUnique(); 31 | } 32 | 33 | virtual void execute(base_function_arguments& args) { 34 | try { 35 | delete_messages_bulk_data& dataPackage; 36 | dataPackage.channelId = args.eventData.getChannelId(); 37 | vector messageIds { }; 38 | messageIds.emplace_back(args.eventData.getMessageId()); 39 | dataPackage.messageIds = messageIds; 40 | 41 | messages::deleteMessagesBulkAsync(dataPackage).get(); 42 | 43 | 44 | } catch (...) { 45 | rethrowException("test::execute()"); 46 | } 47 | } 48 | }; 49 | } 50 | ``` 51 | -------------------------------------------------------------------------------- /Documentation/Doxygen/Docs/documentation_examples/messages/Creating a Message.md: -------------------------------------------------------------------------------- 1 | Creating a Message {#creating_a_message} 2 | ============ 3 | - Execute the, `discord_core_api::messages::createMessageAsync()` function, while passing in a data structure of type `discord_core_api::create_message_data`, with a return value of type `auto`, or, `discord_core_api::message_data`. 4 | - call the function with `discord_core_api::co_routine::get()` added to the end in order to wait for its return value now. 5 | 6 | ```cpp 7 | /// Test.hpp -header for the "test" command. 8 | /// https://github.com/RealTimeChris/DiscordCoreAPI 9 | 10 | #pragma once 11 | 12 | #include 13 | 14 | namespace discord_core_api { 15 | 16 | class test : public base_function { 17 | public: 18 | test() { 19 | commandName = "test"; 20 | helpDescription = "testing purposes!"; 21 | embed_data msgEmbed { }; 22 | msgEmbed.setDescription("------\nSimply enter !test or /test!\n------"); 23 | msgEmbed.setTitle("__**test usage:**__"); 24 | msgEmbed.setTimeStamp(getTimeAndDate()); 25 | msgEmbed.setColor("fe_fe_fe"); 26 | helpEmbed = msgEmbed; 27 | } 28 | 29 | unique_ptr create() { 30 | return makeUnique(); 31 | } 32 | 33 | virtual void execute(base_function_arguments& args) { 34 | try { 35 | create_message_data& dataPackage {args.eventData}; 36 | dataPackage.addContent("test content"); 37 | 38 | message responseMessages = messages::createMessageAsync(dataPackage).get(); 39 | 40 | 41 | } catch (...) { 42 | rethrowException("test::execute()"); 43 | } 44 | } 45 | }; 46 | } 47 | ``` 48 | -------------------------------------------------------------------------------- /Documentation/Doxygen/Docs/documentation_examples/messages/Crossposting a Message.md: -------------------------------------------------------------------------------- 1 | Crossposting a Message {#crossposting_a_message} 2 | ============ 3 | - Execute the, `discord_core_api::messages::crosspostMessageAsync()` function, while passing in a data structure of type `discord_core_api::crosspost_message_data`, with a return value of type `auto`, or, `discord_core_api::message_data`. 4 | - call the function with `discord_core_api::co_routine::get()` added to the end in order to wait for its return value now. 5 | 6 | ```cpp 7 | /// Test.hpp -header for the "test" command. 8 | /// https://github.com/RealTimeChris/DiscordCoreAPI 9 | 10 | #pragma once 11 | 12 | #include 13 | 14 | namespace discord_core_api { 15 | 16 | class test : public base_function { 17 | public: 18 | test() { 19 | commandName = "test"; 20 | helpDescription = "testing purposes!"; 21 | embed_data msgEmbed { }; 22 | msgEmbed.setDescription("------\nSimply enter !test or /test!\n------"); 23 | msgEmbed.setTitle("__**test usage:**__"); 24 | msgEmbed.setTimeStamp(getTimeAndDate()); 25 | msgEmbed.setColor("fe_fe_fe"); 26 | helpEmbed = msgEmbed; 27 | } 28 | 29 | unique_ptr create() { 30 | return makeUnique(); 31 | } 32 | 33 | virtual void execute(base_function_arguments& args) { 34 | try { 35 | crosspost_message_data& dataPackage; 36 | dataPackage.channelId = args.eventData.getChannelId(); 37 | dataPackage.messageId = args.eventData.getMessageId(); 38 | 39 | message responseMessages = messages::crosspostMessageAsync(dataPackage).get(); 40 | 41 | 42 | } catch (...) { 43 | rethrowException("test::execute()"); 44 | } 45 | } 46 | }; 47 | } 48 | ``` 49 | -------------------------------------------------------------------------------- /Documentation/Doxygen/Docs/documentation_examples/messages/Deleting a Message.md: -------------------------------------------------------------------------------- 1 | Deleting a Message {#deleting_a_message} 2 | ============ 3 | - Execute the, from the `discord_core_api::messages::deleteMessageAsync()` function, while passing in a data structure of type `discord_core_api::delete_message_data`, with a return value of type `void`. 4 | - call the function with `discord_core_api::co_routine::get()` added to the end in order to wait for its return value now. 5 | 6 | ```cpp 7 | /// Test.hpp -header for the "test" command. 8 | /// https://github.com/RealTimeChris/DiscordCoreAPI 9 | 10 | #pragma once 11 | 12 | #include 13 | 14 | namespace discord_core_api { 15 | 16 | class test : public base_function { 17 | public: 18 | test() { 19 | commandName = "test"; 20 | helpDescription = "testing purposes!"; 21 | embed_data msgEmbed { }; 22 | msgEmbed.setDescription("------\nSimply enter !test or /test!\n------"); 23 | msgEmbed.setTitle("__**test usage:**__"); 24 | msgEmbed.setTimeStamp(getTimeAndDate()); 25 | msgEmbed.setColor("fe_fe_fe"); 26 | helpEmbed = msgEmbed; 27 | } 28 | 29 | unique_ptr create() { 30 | return makeUnique(); 31 | } 32 | 33 | virtual void execute(base_function_arguments& args) { 34 | try { 35 | delete_message_data& dataPackage; 36 | dataPackage.timeDelay = 500; 37 | dataPackage.messageData = args.eventData.getMessageData(); 38 | 39 | messages::deleteMessageAsync(dataPackage).get(); 40 | 41 | 42 | } catch (...) { 43 | rethrowException("test::execute()"); 44 | } 45 | } 46 | }; 47 | } 48 | ``` 49 | -------------------------------------------------------------------------------- /Documentation/Doxygen/Docs/documentation_examples/messages/Editing a Message.md: -------------------------------------------------------------------------------- 1 | Editing a Message {#editing_a_message} 2 | ============ 3 | - Execute the, `discord_core_api::messages::editMessageAsync()` function, while passing in a data structure of type `discord_core_api::edit_message_data`, with a return value of type `discord_core_api::message_data`. 4 | - call the function with `discord_core_api::co_routine::get()` added to the end in order to wait for its return value now. 5 | 6 | ```cpp 7 | /// Test.hpp -header for the "test" command. 8 | /// https://github.com/RealTimeChris/DiscordCoreAPI 9 | 10 | #pragma once 11 | 12 | #include 13 | 14 | namespace discord_core_api { 15 | 16 | class test : public base_function { 17 | public: 18 | test() { 19 | commandName = "test"; 20 | helpDescription = "testing purposes!"; 21 | embed_data msgEmbed { }; 22 | msgEmbed.setDescription("------\nSimply enter !test or /test!\n------"); 23 | msgEmbed.setTitle("__**test usage:**__"); 24 | msgEmbed.setTimeStamp(getTimeAndDate()); 25 | msgEmbed.setColor("fe_fe_fe"); 26 | helpEmbed = msgEmbed; 27 | } 28 | 29 | unique_ptr create() { 30 | return makeUnique(); 31 | } 32 | 33 | virtual void execute(base_function_arguments& args) { 34 | try { 35 | edit_message_data& dataPackage {args.eventData}; 36 | dataPackage.addContent("test editing content!"); 37 | 38 | message newMessage = messages::editMessageAsync(dataPackage).get(); 39 | 40 | 41 | } catch (...) { 42 | rethrowException("test::execute()"); 43 | } 44 | } 45 | }; 46 | } 47 | ``` 48 | -------------------------------------------------------------------------------- /Documentation/Doxygen/Docs/documentation_examples/messages/Getting Channel Messages.md: -------------------------------------------------------------------------------- 1 | Getting Channel Messages {#getting_channel_messages} 2 | =========== 3 | - Execute the, `discord_core_api::messages::getMessagesAsync()` function, while passing in a data structure of type `discord_core_api::get_messages_data`, with a return value of type `auto`, or, `jsonifier::vector`. 4 | - call the function with `discord_core_api::co_routine::get()` added to the end in order to wait for its return value now. 5 | 6 | ```cpp 7 | /// Test.hpp -header for the "test" command. 8 | /// https://github.com/RealTimeChris/DiscordCoreAPI 9 | 10 | #pragma once 11 | 12 | #include 13 | 14 | namespace discord_core_api { 15 | 16 | class test : public base_function { 17 | public: 18 | test() { 19 | commandName = "test"; 20 | helpDescription = "testing purposes!"; 21 | embed_data msgEmbed { }; 22 | msgEmbed.setDescription("------\nSimply enter !test or /test!\n------"); 23 | msgEmbed.setTitle("__**test usage:**__"); 24 | msgEmbed.setTimeStamp(getTimeAndDate()); 25 | msgEmbed.setColor("fe_fe_fe"); 26 | helpEmbed = msgEmbed; 27 | } 28 | 29 | unique_ptr create() { 30 | return makeUnique(); 31 | } 32 | 33 | virtual void execute(base_function_arguments& args) { 34 | try { 35 | get_messages_data& dataPackage; 36 | dataPackage.channelId = args.eventData.getChannelId(); 37 | dataPackage.afterThisId = args.eventData.getMessageId(); 38 | 39 | auto responseMessages = messages::getMessagesAsync(dataPackage).get(); 40 | 41 | 42 | } catch (...) { 43 | rethrowException("test::execute()"); 44 | } 45 | } 46 | }; 47 | } 48 | ``` 49 | -------------------------------------------------------------------------------- /Documentation/Doxygen/Docs/documentation_examples/messages/Getting Pinned Messages.md: -------------------------------------------------------------------------------- 1 | Getting Pinned Messages {#getting_pinned_messages} 2 | ============ 3 | 4 | - Execute the, `discord_core_api::messages::getPinnedMessagesAsync()` function, while passing in a value of type `discord_core_api::get_pinned_messages_data`, with a return value of type `auto` or `jsonifier::vector`. 5 | - call the function with `discord_core_api::co_routine::get()` added to the end in order to wait for the results now. 6 | 7 | ```cpp 8 | /// Test.hpp -header for the "test" command. 9 | /// https://github.com/RealTimeChris/DiscordCoreAPI 10 | 11 | #pragma once 12 | 13 | #include 14 | 15 | namespace discord_core_api { 16 | 17 | class test : public base_function { 18 | public: 19 | test() { 20 | commandName = "test"; 21 | helpDescription = "testing purposes!"; 22 | embed_data msgEmbed { }; 23 | msgEmbed.setDescription("------\nSimply enter !test or /test!\n------"); 24 | msgEmbed.setTitle("__**test usage:**__"); 25 | msgEmbed.setTimeStamp(getTimeAndDate()); 26 | msgEmbed.setColor("fe_fe_fe"); 27 | helpEmbed = msgEmbed; 28 | } 29 | 30 | unique_ptr create() { 31 | return makeUnique(); 32 | } 33 | 34 | virtual void execute(base_function_arguments& args) { 35 | try { 36 | get_pinned_messages_data& dataPackage; 37 | dataPackage.channelId = args.eventData.getChannelId(); 38 | 39 | vector messagesVector = messages::getPinnedMessagesAsync(dataPackage).get(); 40 | 41 | for (const auto& value: messagesVector) { 42 | std::cout << "the id: " << value.id << std::endl; 43 | } 44 | 45 | 46 | } catch (...) { 47 | rethrowException("test::execute()"); 48 | } 49 | } 50 | }; 51 | } 52 | ``` 53 | -------------------------------------------------------------------------------- /Documentation/Doxygen/Docs/documentation_examples/messages/Getting a Message.md: -------------------------------------------------------------------------------- 1 | Getting a Message {#getting_a_message} 2 | ============ 3 | - Execute the, `discord_core_api::messages::getMessageAsync()` function, while passing in a data structure of type `discord_core_api::get_message_data`, with a return value of type `auto`, or, `discord_core_api::message_data`. 4 | - call the function with `discord_core_api::co_routine::get()` added to the end in order to wait for its return value now. 5 | 6 | ```cpp 7 | /// Test.hpp -header for the "test" command. 8 | /// https://github.com/RealTimeChris/DiscordCoreAPI 9 | 10 | #pragma once 11 | 12 | #include 13 | 14 | namespace discord_core_api { 15 | 16 | class test : public base_function { 17 | public: 18 | test() { 19 | commandName = "test"; 20 | helpDescription = "testing purposes!"; 21 | embed_data msgEmbed { }; 22 | msgEmbed.setDescription("------\nSimply enter !test or /test!\n------"); 23 | msgEmbed.setTitle("__**test usage:**__"); 24 | msgEmbed.setTimeStamp(getTimeAndDate()); 25 | msgEmbed.setColor("fe_fe_fe"); 26 | helpEmbed = msgEmbed; 27 | } 28 | 29 | unique_ptr create() { 30 | return makeUnique(); 31 | } 32 | 33 | virtual void execute(base_function_arguments& args) { 34 | try { 35 | get_message_data& dataPackage; 36 | dataPackage.channelId = args.eventData.getChannelId(); 37 | dataPackage.id = args.eventData.getMessageId(); 38 | 39 | message responseMessages = messages::getMessageAsync(dataPackage).get(); 40 | 41 | 42 | } catch (...) { 43 | rethrowException("test::execute()"); 44 | } 45 | } 46 | }; 47 | } 48 | ``` 49 | -------------------------------------------------------------------------------- /Documentation/Doxygen/Docs/documentation_examples/messages/Pinning a Message.md: -------------------------------------------------------------------------------- 1 | Pinning a Message {#pinning_a_message} 2 | ============ 3 | - Execute the, `discord_core_api::messages::pinMessageAsync()` function, while passing in a value of type `discord_core_api::pin_message_data`, with a return value of type `void` while passing it the created data structure. 4 | - call the function with `discord_core_api::co_routine::get()` added to the end in order to wait for the results now. 5 | 6 | ```cpp 7 | /// Test.hpp -header for the "test" command. 8 | /// https://github.com/RealTimeChris/DiscordCoreAPI 9 | 10 | #pragma once 11 | 12 | #include 13 | 14 | namespace discord_core_api { 15 | 16 | class test : public base_function { 17 | public: 18 | test() { 19 | commandName = "test"; 20 | helpDescription = "testing purposes!"; 21 | embed_data msgEmbed { }; 22 | msgEmbed.setDescription("------\nSimply enter !test or /test!\n------"); 23 | msgEmbed.setTitle("__**test usage:**__"); 24 | msgEmbed.setTimeStamp(getTimeAndDate()); 25 | msgEmbed.setColor("fe_fe_fe"); 26 | helpEmbed = msgEmbed; 27 | } 28 | 29 | unique_ptr create() { 30 | return makeUnique(); 31 | } 32 | 33 | virtual void execute(base_function_arguments& args) { 34 | try { 35 | pin_message_data& dataPackage; 36 | dataPackage.channelId = args.eventData.getChannelId(); 37 | dataPackage.messageId = args.eventData.getMessageId(); 38 | 39 | messages::pinMessageAsync(dataPackage).get(); 40 | 41 | 42 | } catch (...) { 43 | rethrowException("test::execute()"); 44 | } 45 | } 46 | }; 47 | } 48 | ``` 49 | -------------------------------------------------------------------------------- /Documentation/Doxygen/Docs/documentation_examples/messages/UnPinning a Message.md: -------------------------------------------------------------------------------- 1 | Unpinning a Message {#unpinning_a_message} 2 | ============ 3 | - Execute the, `discord_core_api::messages::unpinMessageAsync()` function, while passing in a value of type `discord_core_api::unpin_message_data`, with a return value of type `void`. 4 | - call the function with `discord_core_api::co_routine::get()` added to the end in order to wait for the results now. 5 | 6 | ```cpp 7 | /// Test.hpp -header for the "test" command. 8 | /// https://github.com/RealTimeChris/DiscordCoreAPI 9 | 10 | #pragma once 11 | 12 | #include 13 | 14 | namespace discord_core_api { 15 | 16 | class test : public base_function { 17 | public: 18 | test() { 19 | commandName = "test"; 20 | helpDescription = "testing purposes!"; 21 | embed_data msgEmbed { }; 22 | msgEmbed.setDescription("------\nSimply enter !test or /test!\n------"); 23 | msgEmbed.setTitle("__**test usage:**__"); 24 | msgEmbed.setTimeStamp(getTimeAndDate()); 25 | msgEmbed.setColor("fe_fe_fe"); 26 | helpEmbed = msgEmbed; 27 | } 28 | 29 | unique_ptr create() { 30 | return makeUnique(); 31 | } 32 | 33 | virtual void execute(base_function_arguments& args) { 34 | try { 35 | unpin_message_data& dataPackage; 36 | dataPackage.reason = "testing purposes!"; 37 | dataPackage.channelId = args.eventData.getChannelId(); 38 | dataPackage.messageId = "909216949471428659"; 39 | 40 | messages::unpinMessageAsync(dataPackage).get(); 41 | 42 | 43 | } catch (...) { 44 | rethrowException("test::execute()"); 45 | } 46 | } 47 | }; 48 | } 49 | ``` 50 | -------------------------------------------------------------------------------- /Documentation/Doxygen/Docs/documentation_examples/music_bot/MBot Introduction.md: -------------------------------------------------------------------------------- 1 | Introduction {#Introduction} 2 | ============ 3 | Hey there! So it looks as though this area is still under construction... But you may be able to piece things together with the code! If not - come and 4 | hit me up with any questions you may have on the Discord server! Cheers and happy coding! 5 | 6 | \ref HelperFunctions 7 | 8 | \ref Help 9 | 10 | \ref Play 11 | 12 | \ref Play-Right-Now 13 | 14 | \ref Play-Q 15 | 16 | \ref Skip 17 | 18 | \ref Queue 19 | 20 | \ref Stop 21 | 22 | \ref Clear 23 | 24 | \ref Pause 25 | 26 | \ref SetMusicChannel 27 | 28 | \ref Loop-All 29 | 30 | \ref Loop-Song 31 | 32 | \ref NP 33 | 34 | \ref Disconnect -------------------------------------------------------------------------------- /Documentation/Doxygen/Docs/documentation_examples/music_bot/Music-Bot Guide.md: -------------------------------------------------------------------------------- 1 | Music-Bot Guide {#music_bot_guide} 2 | ============ 3 | * \subpage Introduction 4 | 5 | * \subpage HelperFunctions 6 | 7 | * \subpage Help 8 | 9 | * \subpage Play 10 | 11 | * \subpage Play-Right-Now 12 | 13 | * \subpage Play-Q 14 | 15 | * \subpage Skip 16 | 17 | * \subpage Queue 18 | 19 | * \subpage Stop 20 | 21 | * \subpage Clear 22 | 23 | * \subpage Pause 24 | 25 | * \subpage SetMusicChannel 26 | 27 | * \subpage Loop-All 28 | 29 | * \subpage Loop-Song 30 | 31 | * \subpage NP 32 | 33 | * \subpage Disconnect -------------------------------------------------------------------------------- /Documentation/Doxygen/Docs/documentation_examples/reactions/Creating a Reaction.md: -------------------------------------------------------------------------------- 1 | Creating a Reaction {#creating_a_reaction} 2 | ============ 3 | - Execute the, `discord_core_api::reactions::createReactionAsync()` function, while passing in a data structure of type `discord_core_api::create_reaction_data`, with a return value of type `auto`, or, `discord_core_api::reaction`. 4 | - call the function with `discord_core_api::co_routine::get()` added to the end in order to wait for its return value now. 5 | 6 | ```cpp 7 | /// Test.hpp -header for the "test" command. 8 | /// https://github.com/RealTimeChris/DiscordCoreAPI 9 | 10 | #pragma once 11 | 12 | #include 13 | 14 | namespace discord_core_api { 15 | 16 | class test : public base_function { 17 | public: 18 | test() { 19 | commandName = "test"; 20 | helpDescription = "testing purposes!"; 21 | embed_data msgEmbed { }; 22 | msgEmbed.setDescription("------\nSimply enter !test or /test!\n------"); 23 | msgEmbed.setTitle("__**test usage:**__"); 24 | msgEmbed.setTimeStamp(getTimeAndDate()); 25 | msgEmbed.setColor("fe_fe_fe"); 26 | helpEmbed = msgEmbed; 27 | } 28 | 29 | unique_ptr create() { 30 | return makeUnique(); 31 | } 32 | 33 | virtual void execute(base_function_arguments& args) { 34 | try { 35 | create_reaction_data& dataPackage; 36 | dataPackage.channelId = args.eventData.getChannelId(); 37 | dataPackage.messageId = args.eventData.getMessageId(); 38 | dataPackage.emojiName = "😆"; 39 | 40 | reaction responseMessages = reactions::createReactionAsync(dataPackage).get(); 41 | 42 | 43 | } catch (...) { 44 | rethrowException("test::execute()"); 45 | } 46 | } 47 | }; 48 | } 49 | ``` 50 | -------------------------------------------------------------------------------- /Documentation/Doxygen/Docs/documentation_examples/reactions/Deleting All Reactions For Emoji.md: -------------------------------------------------------------------------------- 1 | Deleting All Reactions for Emoji {#deleting_all_reactions_for_emoji} 2 | ============ 3 | - Execute the, `discord_core_api::reactions::deleteReactionsByEmojiAsync()` function, while passing in a data structure of type `discord_core_api::delete_reactions_by_emoji_data`, with a return value of type `void`. 4 | - call the function with `discord_core_api::co_routine::get()` added to the end in order to wait for its return value now. 5 | 6 | ```cpp 7 | /// Test.hpp -header for the "test" command. 8 | /// https://github.com/RealTimeChris/DiscordCoreAPI 9 | 10 | #pragma once 11 | 12 | #include 13 | 14 | namespace discord_core_api { 15 | 16 | class test : public base_function { 17 | public: 18 | test() { 19 | commandName = "test"; 20 | helpDescription = "testing purposes!"; 21 | embed_data msgEmbed { }; 22 | msgEmbed.setDescription("------\nSimply enter !test or /test!\n------"); 23 | msgEmbed.setTitle("__**test usage:**__"); 24 | msgEmbed.setTimeStamp(getTimeAndDate()); 25 | msgEmbed.setColor("fe_fe_fe"); 26 | helpEmbed = msgEmbed; 27 | } 28 | 29 | unique_ptr create() { 30 | return makeUnique(); 31 | } 32 | 33 | virtual void execute(base_function_arguments& args) { 34 | try { 35 | delete_reactions_by_emoji_data& dataPackage; 36 | dataPackage.messageId = args.eventData.getMessageId(); 37 | dataPackage.channelId = args.eventData.getChannelId(); 38 | dataPackage.emojiName = "💯"; 39 | 40 | reactions::deleteReactionsByEmojiAsync(dataPackage).get(); 41 | 42 | 43 | } catch (...) { 44 | rethrowException("test::execute()"); 45 | } 46 | } 47 | }; 48 | } 49 | ``` 50 | -------------------------------------------------------------------------------- /Documentation/Doxygen/Docs/documentation_examples/reactions/Deleting All Reactions.md: -------------------------------------------------------------------------------- 1 | Deleting All Reactions {#deleting_all_reactions} 2 | ============ 3 | - Execute the, `discord_core_api::reactions::deleteAllReactionsAsync()` function, while passing in a data structure of type `discord_core_api::delete_all_reactions_data`, with a return value of type `void`. 4 | - call the function with `discord_core_api::co_routine::get()` added to the end in order to wait for its return value now. 5 | 6 | ```cpp 7 | /// Test.hpp -header for the "test" command. 8 | /// https://github.com/RealTimeChris/DiscordCoreAPI 9 | 10 | #pragma once 11 | 12 | #include 13 | 14 | namespace discord_core_api { 15 | 16 | class test : public base_function { 17 | public: 18 | test() { 19 | commandName = "test"; 20 | helpDescription = "testing purposes!"; 21 | embed_data msgEmbed { }; 22 | msgEmbed.setDescription("------\nSimply enter !test or /test!\n------"); 23 | msgEmbed.setTitle("__**test usage:**__"); 24 | msgEmbed.setTimeStamp(getTimeAndDate()); 25 | msgEmbed.setColor("fe_fe_fe"); 26 | helpEmbed = msgEmbed; 27 | } 28 | 29 | unique_ptr create() { 30 | return makeUnique(); 31 | } 32 | 33 | virtual void execute(base_function_arguments& args) { 34 | try { 35 | delete_all_reactions_data& dataPackage; 36 | dataPackage.messageId = args.eventData.getMessageId(); 37 | dataPackage.channelId = args.eventData.getChannelId(); 38 | 39 | reactions::deleteAllReactionsAsync(dataPackage).get(); 40 | 41 | 42 | } catch (...) { 43 | rethrowException("test::execute()"); 44 | } 45 | } 46 | }; 47 | } 48 | ``` 49 | -------------------------------------------------------------------------------- /Documentation/Doxygen/Docs/documentation_examples/reactions/Deleting Own Reaction.md: -------------------------------------------------------------------------------- 1 | Deleting Own Reaction {#deleting_own_reaction} 2 | ============ 3 | - Execute the, `discord_core_api::reactions::deleteOwnReactionAsync()` function, while passing in a data structure of type `discord_core_api::delete_own_reaction_data`, with a return value of type `void`. 4 | - call the function with `discord_core_api::co_routine::get()` added to the end in order to wait for its return value now. 5 | 6 | ```cpp 7 | /// Test.hpp -header for the "test" command. 8 | /// https://github.com/RealTimeChris/DiscordCoreAPI 9 | 10 | #pragma once 11 | 12 | #include 13 | 14 | namespace discord_core_api { 15 | 16 | class test : public base_function { 17 | public: 18 | test() { 19 | commandName = "test"; 20 | helpDescription = "testing purposes!"; 21 | embed_data msgEmbed { }; 22 | msgEmbed.setDescription("------\nSimply enter !test or /test!\n------"); 23 | msgEmbed.setTitle("__**test usage:**__"); 24 | msgEmbed.setTimeStamp(getTimeAndDate()); 25 | msgEmbed.setColor("fe_fe_fe"); 26 | helpEmbed = msgEmbed; 27 | } 28 | 29 | unique_ptr create() { 30 | return makeUnique(); 31 | } 32 | 33 | virtual void execute(base_function_arguments& args) { 34 | try { 35 | delete_own_reaction_data& dataPackage; 36 | dataPackage.channelId = args.eventData.getChannelId(); 37 | dataPackage.messageId = args.eventData.getMessageId(); 38 | dataPackage.emojiName = "😆"; 39 | 40 | reactions::deleteOwnReactionAsync(dataPackage).get(); 41 | 42 | 43 | } catch (...) { 44 | rethrowException("test::execute()"); 45 | } 46 | } 47 | }; 48 | } 49 | ``` 50 | -------------------------------------------------------------------------------- /Documentation/Doxygen/Docs/documentation_examples/reactions/Deleting User Reaction.md: -------------------------------------------------------------------------------- 1 | Deleting User Reaction {#deleting_user_reaction} 2 | ============ 3 | - Execute the, `discord_core_api::reactions::deleteUserReactionAsync()` function, while passing in a data structure of type `discord_core_api::delete_user_reaction_data`, with a return value of type `void`. 4 | - call the function with `discord_core_api::co_routine::get()` added to the end in order to wait for its return value now. 5 | 6 | ```cpp 7 | /// Test.hpp -header for the "test" command. 8 | /// https://github.com/RealTimeChris/DiscordCoreAPI 9 | 10 | #pragma once 11 | 12 | #include 13 | 14 | namespace discord_core_api { 15 | 16 | class test : public base_function { 17 | public: 18 | test() { 19 | commandName = "test"; 20 | helpDescription = "testing purposes!"; 21 | embed_data msgEmbed { }; 22 | msgEmbed.setDescription("------\nSimply enter !test or /test!\n------"); 23 | msgEmbed.setTitle("__**test usage:**__"); 24 | msgEmbed.setTimeStamp(getTimeAndDate()); 25 | msgEmbed.setColor("fe_fe_fe"); 26 | helpEmbed = msgEmbed; 27 | } 28 | 29 | unique_ptr create() { 30 | return makeUnique(); 31 | } 32 | 33 | virtual void execute(base_function_arguments& args) { 34 | try { 35 | delete_user_reaction_data& dataPackage; 36 | dataPackage.channelId = args.eventData.getChannelId(); 37 | dataPackage.messageId = args.eventData.getMessageId(); 38 | dataPackage.emojiName = "😆"; 39 | dataPackage.userId = args.eventData.getAuthorId(); 40 | 41 | reactions::deleteUserReactionAsync(dataPackage).get(); 42 | 43 | 44 | } catch (...) { 45 | rethrowException("test::execute()"); 46 | } 47 | } 48 | }; 49 | } 50 | ``` 51 | -------------------------------------------------------------------------------- /Documentation/Doxygen/Docs/documentation_examples/reactions/Getting Reactions.md: -------------------------------------------------------------------------------- 1 | Getting Reactions {#getting_reactions} 2 | ============ 3 | - Execute the, `discord_core_api::reactions::getReactionsAsync()` function, while passing in a data structure of type `discord_core_api::get_reactions_data`, with a return value of type `auto` or `jsonifier::vector`. 4 | - call the function with `discord_core_api::co_routine::get()` added to the end in order to wait for its return value now. 5 | 6 | ```cpp 7 | /// Test.hpp -header for the "test" command. 8 | /// https://github.com/RealTimeChris/DiscordCoreAPI 9 | 10 | #pragma once 11 | 12 | #include 13 | 14 | namespace discord_core_api { 15 | 16 | class test : public base_function { 17 | public: 18 | test() { 19 | commandName = "test"; 20 | helpDescription = "testing purposes!"; 21 | embed_data msgEmbed { }; 22 | msgEmbed.setDescription("------\nSimply enter !test or /test!\n------"); 23 | msgEmbed.setTitle("__**test usage:**__"); 24 | msgEmbed.setTimeStamp(getTimeAndDate()); 25 | msgEmbed.setColor("fe_fe_fe"); 26 | helpEmbed = msgEmbed; 27 | } 28 | 29 | unique_ptr create() { 30 | return makeUnique(); 31 | } 32 | 33 | virtual void execute(base_function_arguments& args) { 34 | try { 35 | get_reactions_data& dataPackage; 36 | dataPackage.afterId = args.eventData.getAuthorId(); 37 | dataPackage.messageId = args.eventData.getMessageId(); 38 | dataPackage.emoji = "😆"; 39 | dataPackage.limit = 50; 40 | 41 | vector usersResponse = reactions::getReactionsAsync(dataPackage).get(); 42 | 43 | 44 | } catch (...) { 45 | rethrowException("test::execute()"); 46 | } 47 | } 48 | }; 49 | } 50 | ``` 51 | -------------------------------------------------------------------------------- /Documentation/Doxygen/Docs/documentation_examples/reactions/Getting a List of Guild Emoji.md: -------------------------------------------------------------------------------- 1 | Getting A list of Guild Emoji {#getting_a_list_of_guild_emoji} 2 | ============ 3 | - Execute the, `discord_core_api::reactions::getEmojiListAsync()` function, while passing in a value of type `discord_core_api::get_emoji_list_data`, with a return value of type `auto` or `jsonifier::vector`. 4 | - call the function with `discord_core_api::co_routine::get()` added to the end in order to wait for the results now. 5 | 6 | ```cpp 7 | /// Test.hpp -header for the "test" command. 8 | /// https://github.com/RealTimeChris/DiscordCoreAPI 9 | 10 | #pragma once 11 | 12 | #include 13 | 14 | namespace discord_core_api { 15 | 16 | class test : public base_function { 17 | public: 18 | test() { 19 | commandName = "test"; 20 | helpDescription = "testing purposes!"; 21 | embed_data msgEmbed { }; 22 | msgEmbed.setDescription("------\nSimply enter !test or /test!\n------"); 23 | msgEmbed.setTitle("__**test usage:**__"); 24 | msgEmbed.setTimeStamp(getTimeAndDate()); 25 | msgEmbed.setColor("fe_fe_fe"); 26 | helpEmbed = msgEmbed; 27 | } 28 | 29 | unique_ptr create() { 30 | return makeUnique(); 31 | } 32 | 33 | virtual void execute(base_function_arguments& args) { 34 | try { 35 | get_emoji_list_data& dataPackage; 36 | dataPackage.guildId = args.eventData.getGuildId(); 37 | 38 | auto emojiList = reactions::getEmojiListAsync(dataPackage).get(); 39 | 40 | for (const auto& value: emojiList) { 41 | std::cout << "the name: " << value.name << std::endl; 42 | } 43 | 44 | 45 | } catch (...) { 46 | rethrowException("test::execute()"); 47 | } 48 | } 49 | }; 50 | } 51 | ``` 52 | -------------------------------------------------------------------------------- /Documentation/Doxygen/Docs/documentation_examples/roles/Adding a Role to a Guild Member.md: -------------------------------------------------------------------------------- 1 | Adding a Role to a Guild Member {#adding_a_role_to_a_guild_member} 2 | ============ 3 | - Execute the, `discord_core_api::roles::addGuildMemberRoleAsync()` function, while passing in a value of type `discord_core_api::add_guild_member_role_data`, with a return value of type `void`. 4 | - call the function with `discord_core_api::co_routine::get()` added to the end in order to wait for the results now. 5 | 6 | ```cpp 7 | /// Test.hpp -header for the "test" command. 8 | /// https://github.com/RealTimeChris/DiscordCoreAPI 9 | 10 | #pragma once 11 | 12 | #include 13 | 14 | namespace discord_core_api { 15 | 16 | class test : public base_function { 17 | public: 18 | test() { 19 | commandName = "test"; 20 | helpDescription = "testing purposes!"; 21 | embed_data msgEmbed { }; 22 | msgEmbed.setDescription("------\nSimply enter !test or /test!\n------"); 23 | msgEmbed.setTitle("__**test usage:**__"); 24 | msgEmbed.setTimeStamp(getTimeAndDate()); 25 | msgEmbed.setColor("fe_fe_fe"); 26 | helpEmbed = msgEmbed; 27 | } 28 | 29 | unique_ptr create() { 30 | return makeUnique(); 31 | } 32 | 33 | virtual void execute(base_function_arguments& args) { 34 | try { 35 | add_guild_member_role_data& dataPackage01; 36 | dataPackage01.guildId = args.eventData.getGuildId(); 37 | dataPackage01.userId = args.eventData.getAuthorId(); 38 | dataPackage01.reason = "testing purposes!"; 39 | dataPackage01.roleId = "866124519303020554"; 40 | 41 | roles::addGuildMemberRoleAsync(dataPackage01).get(); 42 | 43 | 44 | } catch (...) { 45 | rethrowException("test::execute()"); 46 | } 47 | } 48 | }; 49 | } 50 | ``` 51 | -------------------------------------------------------------------------------- /Documentation/Doxygen/Docs/documentation_examples/roles/Creating a Guild Role.md: -------------------------------------------------------------------------------- 1 | Creating a Guild Role {#creating_a_guild_role} 2 | ============ 3 | - Execute the, `discord_core_api::roles::createGuildRoleAsync()` function, while passing in a value of type `discord_core_api::create_guild_role_data`, with a return value of type `auto` or `discord_core_api::role`. 4 | - call the function with `discord_core_api::co_routine::get()` added to the end in order to wait for the results now. 5 | 6 | ```cpp 7 | /// Test.hpp -header for the "test" command. 8 | /// https://github.com/RealTimeChris/DiscordCoreAPI 9 | 10 | #pragma once 11 | 12 | #include 13 | 14 | namespace discord_core_api { 15 | 16 | class test : public base_function { 17 | public: 18 | test() { 19 | commandName = "test"; 20 | helpDescription = "testing purposes!"; 21 | embed_data msgEmbed { }; 22 | msgEmbed.setDescription("------\nSimply enter !test or /test!\n------"); 23 | msgEmbed.setTitle("__**test usage:**__"); 24 | msgEmbed.setTimeStamp(getTimeAndDate()); 25 | msgEmbed.setColor("fe_fe_fe"); 26 | helpEmbed = msgEmbed; 27 | } 28 | 29 | unique_ptr create() { 30 | return makeUnique(); 31 | } 32 | 33 | virtual void execute(base_function_arguments& args) { 34 | try { 35 | create_guild_role_data& dataPackage01; 36 | dataPackage01.name = "test role"; 37 | dataPackage01.hexColorValue = "fefe23"; 38 | dataPackage01.hoist = false; 39 | dataPackage01.reason = "testing!"; 40 | dataPackage01.guildId = args.eventData.getGuildId(); 41 | 42 | auto newRole = roles::createGuildRoleAsync(dataPackage01).get(); 43 | 44 | std::cout << "role name: " << newRole.name << std::endl; 45 | 46 | 47 | } catch (...) { 48 | rethrowException("test::execute()"); 49 | } 50 | } 51 | }; 52 | } 53 | 54 | 55 | ``` 56 | -------------------------------------------------------------------------------- /Documentation/Doxygen/Docs/documentation_examples/roles/Getting Guild Roles.md: -------------------------------------------------------------------------------- 1 | Getting Guild Roles {#getting_guild_roles} 2 | ============= 3 | - Execute the, `discord_core_api::roles::getGuildRolesAsync()` function, while passing in a value of type `discord_core_api::get_guild_roles_data`, with a return value of type `auto` or `jsonifier::vector`. 4 | - call the function with `discord_core_api::co_routine::get()` added to the end in order to wait for the results now. 5 | 6 | ```cpp 7 | /// Test.hpp -header for the "test" command. 8 | /// https://github.com/RealTimeChris/DiscordCoreAPI 9 | 10 | #pragma once 11 | 12 | #include 13 | 14 | namespace discord_core_api { 15 | 16 | class test : public base_function { 17 | public: 18 | test() { 19 | commandName = "test"; 20 | helpDescription = "testing purposes!"; 21 | embed_data msgEmbed { }; 22 | msgEmbed.setDescription("------\nSimply enter !test or /test!\n------"); 23 | msgEmbed.setTitle("__**test usage:**__"); 24 | msgEmbed.setTimeStamp(getTimeAndDate()); 25 | msgEmbed.setColor("fe_fe_fe"); 26 | helpEmbed = msgEmbed; 27 | } 28 | 29 | unique_ptr create() { 30 | return makeUnique(); 31 | } 32 | 33 | virtual void execute(base_function_arguments& args) { 34 | try { 35 | get_guild_roles_data& dataPackage01; 36 | dataPackage01.guildId = args.eventData.getGuildId(); 37 | 38 | auto rolesVector = roles::getGuildRolesAsync(dataPackage01).get(); 39 | 40 | for (const auto& value: rolesVector) { 41 | std::cout << "role name: " << value.name << std::endl; 42 | } 43 | 44 | 45 | } catch (...) { 46 | rethrowException("test::execute()"); 47 | } 48 | } 49 | }; 50 | } 51 | ``` 52 | -------------------------------------------------------------------------------- /Documentation/Doxygen/Docs/documentation_examples/roles/Getting a Role.md: -------------------------------------------------------------------------------- 1 | Getting a Role {#getting_a_role} 2 | ============= 3 | - Execute the, `discord_core_api::roles::getCachedRole()` (which collects it from the cache), or `discord_core_api::roles::getRoleAsync()` (which collects it from the discord servers) function, while passing in a value of type `discord_core_api::get_role_data`. 4 | - call the function with `discord_core_api::co_routine::get()` added to the end in order to wait for the results now. 5 | 6 | ```cpp 7 | /// Test.hpp -header for the "test" command. 8 | /// https://github.com/RealTimeChris/DiscordCoreAPI 9 | 10 | #pragma once 11 | 12 | #include "index.hpp" 13 | 14 | namespace discord_core_api { 15 | 16 | class test : public base_function { 17 | public: 18 | test() { 19 | commandName = "test"; 20 | helpDescription = "testing purposes!"; 21 | embed_data msgEmbed; 22 | msgEmbed.setDescription("------\nSimply enter !test or /test!\n------"); 23 | msgEmbed.setTitle("__**test usage:**__"); 24 | msgEmbed.setTimeStamp(getTimeAndDate()); 25 | msgEmbed.setColor("fe_fe_fe"); 26 | helpEmbed = msgEmbed; 27 | } 28 | 29 | unique_ptr create() { 30 | return makeUnique(); 31 | } 32 | 33 | virtual void execute(base_function_arguments& args) { 34 | get_role_data& dataPackage; 35 | dataPackage.guildId = args.eventData.getGuildId(); 36 | dataPackage.roleId = "YOUR_ROLE_ID_HERE"; 37 | 38 | role role = roles::getRoleAsync(dataPackage).get(); 39 | 40 | role role = roles::getCachedRole(dataPackage).get(); 41 | } 42 | }; 43 | } 44 | ``` 45 | -------------------------------------------------------------------------------- /Documentation/Doxygen/Docs/documentation_examples/roles/Removing a Guild Role.md: -------------------------------------------------------------------------------- 1 | Removing a Guild Role {#removing_a_guild_role} 2 | ============= 3 | - Execute the, `discord_core_api::roles::removeGuildRoleAsync()` function, while passing in a value of type `discord_core_api::remove_guild_role_data`, with a return value of type `void`. 4 | - call the function with `discord_core_api::co_routine::get()` added to the end in order to wait for the results now. 5 | 6 | ```cpp 7 | /// Test.hpp -header for the "test" command. 8 | /// https://github.com/RealTimeChris/DiscordCoreAPI 9 | 10 | #pragma once 11 | 12 | #include 13 | 14 | namespace discord_core_api { 15 | 16 | class test : public base_function { 17 | public: 18 | test() { 19 | commandName = "test"; 20 | helpDescription = "testing purposes!"; 21 | embed_data msgEmbed { }; 22 | msgEmbed.setDescription("------\nSimply enter !test or /test!\n------"); 23 | msgEmbed.setTitle("__**test usage:**__"); 24 | msgEmbed.setTimeStamp(getTimeAndDate()); 25 | msgEmbed.setColor("fe_fe_fe"); 26 | helpEmbed = msgEmbed; 27 | } 28 | 29 | unique_ptr create() { 30 | return makeUnique(); 31 | } 32 | 33 | virtual void execute(base_function_arguments& args) { 34 | try { 35 | remove_guild_role_data& dataPackage01; 36 | dataPackage01.roleId = "886366417316896799"; 37 | dataPackage01.reason = "testing!"; 38 | dataPackage01.guildId = args.eventData.getGuildId(); 39 | 40 | roles::removeGuildRoleAsync(dataPackage01).get(); 41 | 42 | 43 | } catch (...) { 44 | rethrowException("test::execute()"); 45 | } 46 | } 47 | }; 48 | } 49 | 50 | 51 | ``` 52 | -------------------------------------------------------------------------------- /Documentation/Doxygen/Docs/documentation_examples/roles/Removing a Role From a Guild Member.md: -------------------------------------------------------------------------------- 1 | Removing a Role from a Guild Member {#removing_a_role_from_a_guild_member} 2 | ============ 3 | - Execute the, `discord_core_api::roles::removeGuildMemberRoleAsync()` function, while passing in a value of type `discord_core_api::remove_guild_member_role_data`, with a return value of type `void`. 4 | - call the function with `discord_core_api::co_routine::get()` added to the end in order to wait for the results now. 5 | 6 | ```cpp 7 | /// Test.hpp -header for the "test" command. 8 | /// https://github.com/RealTimeChris/DiscordCoreAPI 9 | 10 | #pragma once 11 | 12 | #include 13 | 14 | namespace discord_core_api { 15 | 16 | class test : public base_function { 17 | public: 18 | test() { 19 | commandName = "test"; 20 | helpDescription = "testing purposes!"; 21 | embed_data msgEmbed { }; 22 | msgEmbed.setDescription("------\nSimply enter !test or /test!\n------"); 23 | msgEmbed.setTitle("__**test usage:**__"); 24 | msgEmbed.setTimeStamp(getTimeAndDate()); 25 | msgEmbed.setColor("fe_fe_fe"); 26 | helpEmbed = msgEmbed; 27 | } 28 | 29 | unique_ptr create() { 30 | return makeUnique(); 31 | } 32 | 33 | virtual void execute(base_function_arguments& args) { 34 | try { 35 | remove_guild_member_role_data& dataPackage01; 36 | dataPackage01.guildId = args.eventData.getGuildId(); 37 | dataPackage01.userId = args.eventData.getAuthorId(); 38 | dataPackage01.reason = "testing purposes!"; 39 | dataPackage01.roleId = "866124519303020554"; 40 | 41 | roles::removeGuildMemberRoleAsync(dataPackage01).get(); 42 | 43 | 44 | } catch (...) { 45 | rethrowException("test::execute()"); 46 | } 47 | } 48 | }; 49 | } 50 | ``` 51 | -------------------------------------------------------------------------------- /Documentation/Doxygen/Docs/documentation_examples/stage_instances/Deleting a Stage Instance.md: -------------------------------------------------------------------------------- 1 | Deleting a Stage Instance {#deleting_a_stage_instance} 2 | ============ 3 | - Execute the, `discord_core_api::stage_instances::deleteStageInstanceAsync()` function, while passing in a value of type `discord_core_api::delete_stage_instance_data`, with a return value of type `void`. 4 | - call the function with `discord_core_api::co_routine::get()` added to the end in order to wait for the results now. 5 | 6 | ```cpp 7 | /// Test.hpp -header for the "test" command. 8 | /// https://github.com/RealTimeChris/DiscordCoreAPI 9 | 10 | #pragma once 11 | 12 | #include 13 | 14 | namespace discord_core_api { 15 | 16 | class test : public base_function { 17 | public: 18 | test() { 19 | commandName = "test"; 20 | helpDescription = "testing purposes!"; 21 | embed_data msgEmbed { }; 22 | msgEmbed.setDescription("------\nSimply enter !test or /test!\n------"); 23 | msgEmbed.setTitle("__**test usage:**__"); 24 | msgEmbed.setTimeStamp(getTimeAndDate()); 25 | msgEmbed.setColor("fe_fe_fe"); 26 | helpEmbed = msgEmbed; 27 | } 28 | 29 | unique_ptr create() { 30 | return makeUnique(); 31 | } 32 | 33 | virtual void execute(base_function_arguments& args) { 34 | try { 35 | delete_stage_instance_data& dataPackage; 36 | dataPackage.channelId = "914726178022101052"; 37 | dataPackage.reason = "testing!"; 38 | 39 | stage_instances::deleteStageInstanceAsync(dataPackage).get(); 40 | 41 | 42 | } catch (...) { 43 | rethrowException("test::execute()"); 44 | } 45 | } 46 | 47 | virtual ~test() = default; 48 | }; 49 | } 50 | ``` 51 | -------------------------------------------------------------------------------- /Documentation/Doxygen/Docs/documentation_examples/stage_instances/Getting a Stage Instance.md: -------------------------------------------------------------------------------- 1 | Getting a Stage Instance {#getting_a_stage_instance} 2 | ============ 3 | - Execute the, `discord_core_api::stage_instances::getStageInstanceAsync()` function, while passing in a value of type `discord_core_api::get_stage_instance_data`, with a return value of type `auto` or `discord_core_api::stage_instance`. 4 | - call the function with `discord_core_api::co_routine::get()` added to the end in order to wait for the results now. 5 | 6 | ```cpp 7 | /// Test.hpp -header for the "test" command. 8 | /// https://github.com/RealTimeChris/DiscordCoreAPI 9 | 10 | #pragma once 11 | 12 | #include 13 | 14 | namespace discord_core_api { 15 | 16 | class test : public base_function { 17 | public: 18 | test() { 19 | commandName = "test"; 20 | helpDescription = "testing purposes!"; 21 | embed_data msgEmbed { }; 22 | msgEmbed.setDescription("------\nSimply enter !test or /test!\n------"); 23 | msgEmbed.setTitle("__**test usage:**__"); 24 | msgEmbed.setTimeStamp(getTimeAndDate()); 25 | msgEmbed.setColor("fe_fe_fe"); 26 | helpEmbed = msgEmbed; 27 | } 28 | 29 | unique_ptr create() { 30 | return makeUnique(); 31 | } 32 | 33 | virtual void execute(base_function_arguments& args) { 34 | try { 35 | get_stage_instance_data& dataPackage; 36 | dataPackage.channelId = "914726178022101052"; 37 | 38 | auto responseData = stage_instances::getStageInstanceAsync(dataPackage).get(); 39 | 40 | std::cout << "the topic: " << responseData.topic << std::endl; 41 | 42 | 43 | } catch (...) { 44 | rethrowException("test::execute()"); 45 | } 46 | } 47 | }; 48 | } 49 | ``` 50 | -------------------------------------------------------------------------------- /Documentation/Doxygen/Docs/documentation_examples/stickers/Getting Nitro Sticker Packs.md: -------------------------------------------------------------------------------- 1 | Getting Nitro Sticker Packs {#getting_nitro_sticker_packs} 2 | ============ 3 | - Execute the, `discord_core_api::stickers::getNitroStickerPacksAsync()` function, with a return value of type `auto` or `jsonifier::vector`. 4 | - call the function with `discord_core_api::co_routine::get()` added to the end in order to wait for the results now. 5 | 6 | ```cpp 7 | /// Test.hpp -header for the "test" command. 8 | /// https://github.com/RealTimeChris/DiscordCoreAPI 9 | 10 | #pragma once 11 | 12 | #include 13 | 14 | namespace discord_core_api { 15 | 16 | class test : public base_function { 17 | public: 18 | test() { 19 | commandName = "test"; 20 | helpDescription = "testing purposes!"; 21 | embed_data msgEmbed { }; 22 | msgEmbed.setDescription("------\nSimply enter !test or /test!\n------"); 23 | msgEmbed.setTitle("__**test usage:**__"); 24 | msgEmbed.setTimeStamp(getTimeAndDate()); 25 | msgEmbed.setColor("fe_fe_fe"); 26 | helpEmbed = msgEmbed; 27 | } 28 | 29 | unique_ptr create() { 30 | return makeUnique(); 31 | } 32 | 33 | virtual void execute(base_function_arguments& args) { 34 | try { 35 | auto responseData = stickers::getNitroStickerPacksAsync().get(); 36 | 37 | for (auto& value: responseData) { 38 | std::cout << "the name: " << value.name << std::endl; 39 | } 40 | 41 | 42 | } catch (...) { 43 | rethrowException("test::execute()"); 44 | } 45 | } 46 | 47 | virtual ~test() = default; 48 | }; 49 | } 50 | ``` 51 | -------------------------------------------------------------------------------- /Documentation/Doxygen/Docs/documentation_examples/stickers/Getting a List of Guild Stickers.md: -------------------------------------------------------------------------------- 1 | Getting a List of Guild Stickers {#getting_a_list_of_guild_stickers} 2 | ============ 3 | - Execute the, `discord_core_api::stickers::getGuildStickersAsync()` function, while passing in a value of type `discord_core_api::get_guild_stickers_data`, with a return value of type `auto` or `jsonifier::vector`. 4 | - call the function with `discord_core_api::co_routine::get()` added to the end in order to wait for the results now. 5 | 6 | ```cpp 7 | /// Test.hpp -header for the "test" command. 8 | /// https://github.com/RealTimeChris/DiscordCoreAPI 9 | 10 | #pragma once 11 | 12 | #include 13 | 14 | namespace discord_core_api { 15 | 16 | class test : public base_function { 17 | public: 18 | test() { 19 | commandName = "test"; 20 | helpDescription = "testing purposes!"; 21 | embed_data msgEmbed { }; 22 | msgEmbed.setDescription("------\nSimply enter !test or /test!\n------"); 23 | msgEmbed.setTitle("__**test usage:**__"); 24 | msgEmbed.setTimeStamp(getTimeAndDate()); 25 | msgEmbed.setColor("fe_fe_fe"); 26 | helpEmbed = msgEmbed; 27 | } 28 | 29 | unique_ptr create() { 30 | return makeUnique(); 31 | } 32 | 33 | virtual void execute(base_function_arguments& args) { 34 | try { 35 | get_guild_stickers_data& dataPackage; 36 | dataPackage.guildId = args.eventData.getGuildId(); 37 | 38 | auto responseData = stickers::getGuildStickersAsync(dataPackage).get(); 39 | 40 | for (auto& value: responseData) { 41 | std::cout << "the name: " << value.name << std::endl; 42 | } 43 | 44 | 45 | } catch (...) { 46 | rethrowException("test::execute()"); 47 | } 48 | } 49 | 50 | virtual ~test() = default; 51 | }; 52 | } 53 | ``` 54 | -------------------------------------------------------------------------------- /Documentation/Doxygen/Docs/documentation_examples/stickers/Getting a Sticker.md: -------------------------------------------------------------------------------- 1 | Getting a Sticker {#getting_a_sticker} 2 | ============ 3 | - Execute the, `discord_core_api::stickers::getStickerAsync()` function, while passing in a value of type `discord_core_api::get_sticker_data`, with a return value of type `auto` or `discord_core_api::sticker`. 4 | - call the function with `discord_core_api::co_routine::get()` added to the end in order to wait for the results now. 5 | 6 | ```cpp 7 | /// Test.hpp -header for the "test" command. 8 | /// https://github.com/RealTimeChris/DiscordCoreAPI 9 | 10 | #pragma once 11 | 12 | #include 13 | 14 | namespace discord_core_api { 15 | 16 | class test : public base_function { 17 | public: 18 | test() { 19 | commandName = "test"; 20 | helpDescription = "testing purposes!"; 21 | embed_data msgEmbed { }; 22 | msgEmbed.setDescription("------\nSimply enter !test or /test!\n------"); 23 | msgEmbed.setTitle("__**test usage:**__"); 24 | msgEmbed.setTimeStamp(getTimeAndDate()); 25 | msgEmbed.setColor("fe_fe_fe"); 26 | helpEmbed = msgEmbed; 27 | } 28 | 29 | unique_ptr create() { 30 | return makeUnique(); 31 | } 32 | 33 | virtual void execute(base_function_arguments& args) { 34 | try { 35 | get_sticker_data& dataPackage; 36 | dataPackage.stickerId = "YOUR_STICKER_ID_HERE"; 37 | 38 | auto responseData = stickers::getStickerAsync(dataPackage).get(); 39 | 40 | std::cout << "the name: " << responseData.name << std::endl; 41 | 42 | 43 | } catch (...) { 44 | rethrowException("test::execute()"); 45 | } 46 | } 47 | 48 | virtual ~test() = default; 49 | }; 50 | } 51 | ``` 52 | -------------------------------------------------------------------------------- /Documentation/Doxygen/Docs/documentation_examples/threads/Adding a User to a Thread.md: -------------------------------------------------------------------------------- 1 | Adding a User to a Thread {#adding_a_user_to_a_thread} 2 | ============ 3 | - Execute the, from the `discord_core_api::threads::addThreadMemberAsync()` function, while passing in a value of type `discord_core_api::add_thread_member_data`, with a return value of type `void`. 4 | - call the function with `discord_core_api::co_routine::get()` added to the end in order to wait for the results now. 5 | 6 | ```cpp 7 | /// Test.hpp -header for the "test" command. 8 | /// https://github.com/RealTimeChris/DiscordCoreAPI 9 | 10 | #pragma once 11 | 12 | #include 13 | 14 | namespace discord_core_api { 15 | 16 | class test : public base_function { 17 | public: 18 | test() { 19 | commandName = "test"; 20 | helpDescription = "testing purposes!"; 21 | embed_data msgEmbed { }; 22 | msgEmbed.setDescription("------\nSimply enter !test or /test!\n------"); 23 | msgEmbed.setTitle("__**test usage:**__"); 24 | msgEmbed.setTimeStamp(getTimeAndDate()); 25 | msgEmbed.setColor("fe_fe_fe"); 26 | helpEmbed = msgEmbed; 27 | } 28 | 29 | unique_ptr create() { 30 | return makeUnique(); 31 | } 32 | 33 | virtual void execute(base_function_arguments& args) { 34 | try { 35 | add_thread_member_data& dataPackage; 36 | dataPackage.channelId = "909407162776834069"; 37 | dataPackage.userId = args.eventData.getAuthorId(); 38 | 39 | threads::addThreadMemberAsync(dataPackage).get(); 40 | 41 | 42 | } catch (...) { 43 | rethrowException("test::execute()"); 44 | } 45 | } 46 | }; 47 | } 48 | ``` 49 | -------------------------------------------------------------------------------- /Documentation/Doxygen/Docs/documentation_examples/threads/Getting Joined Private Archived Threads.md: -------------------------------------------------------------------------------- 1 | Getting Joined Private Archived Threads {#getting_joined_private_archived_threads} 2 | ============ 3 | - Execute the, `discord_core_api::threads::getJoinedPrivateArchivedThreadsAsync()` function, while passing in a value of type `discord_core_api::get_joined_private_archived_threads_data`, with a return value of type `auto` or `discord_core_api::archived_threads_data`. 4 | - call the function with `discord_core_api::co_routine::get()` added to the end in order to wait for the results now. 5 | 6 | ```cpp 7 | /// Test.hpp -header for the "test" command. 8 | /// https://github.com/RealTimeChris/DiscordCoreAPI 9 | 10 | #pragma once 11 | 12 | #include 13 | 14 | namespace discord_core_api { 15 | 16 | class test : public base_function { 17 | public: 18 | test() { 19 | commandName = "test"; 20 | helpDescription = "testing purposes!"; 21 | embed_data msgEmbed { }; 22 | msgEmbed.setDescription("------\nSimply enter !test or /test!\n------"); 23 | msgEmbed.setTitle("__**test usage:**__"); 24 | msgEmbed.setTimeStamp(getTimeAndDate()); 25 | msgEmbed.setColor("fe_fe_fe"); 26 | helpEmbed = msgEmbed; 27 | } 28 | 29 | unique_ptr create() { 30 | return makeUnique(); 31 | } 32 | 33 | virtual void execute(base_function_arguments& args) { 34 | try { 35 | get_joined_private_archived_threads_data& dataPackage; 36 | dataPackage.channelId = args.eventData.getChannelId(); 37 | dataPackage.limit = 2; 38 | 39 | auto newActiveThreads = threads::getJoinedPrivateArchivedThreadsAsync(dataPackage).get(); 40 | 41 | 42 | } catch (...) { 43 | rethrowException("test::execute()"); 44 | } 45 | } 46 | }; 47 | } 48 | ``` 49 | -------------------------------------------------------------------------------- /Documentation/Doxygen/Docs/documentation_examples/threads/Getting Private Archived Threads.md: -------------------------------------------------------------------------------- 1 | Getting Private Archived Threads {#getting_private_archived_threads} 2 | ============ 3 | - Execute the, `discord_core_api::threads::getPrivateArchivedThreadsAsync()` function, while passing in a value of type `discord_core_api::get_private_archived_threads_data`, with a return value of type `auto` or `discord_core_api::archived_threads_data`. 4 | - call the function with `discord_core_api::co_routine::get()` added to the end in order to wait for the results now. 5 | 6 | ```cpp 7 | /// Test.hpp -header for the "test" command. 8 | /// https://github.com/RealTimeChris/DiscordCoreAPI 9 | 10 | #pragma once 11 | 12 | #include 13 | 14 | namespace discord_core_api { 15 | 16 | class test : public base_function { 17 | public: 18 | test() { 19 | commandName = "test"; 20 | helpDescription = "testing purposes!"; 21 | embed_data msgEmbed { }; 22 | msgEmbed.setDescription("------\nSimply enter !test or /test!\n------"); 23 | msgEmbed.setTitle("__**test usage:**__"); 24 | msgEmbed.setTimeStamp(getTimeAndDate()); 25 | msgEmbed.setColor("fe_fe_fe"); 26 | helpEmbed = msgEmbed; 27 | } 28 | 29 | unique_ptr create() { 30 | return makeUnique(); 31 | } 32 | 33 | virtual void execute(base_function_arguments& args) { 34 | try { 35 | get_private_archived_threads_data& dataPackage; 36 | dataPackage.channelId = args.eventData.getChannelId(); 37 | dataPackage.limit = 2; 38 | 39 | auto newActiveThreads = threads::getPrivateArchivedThreadsAsync(dataPackage).get(); 40 | 41 | 42 | } catch (...) { 43 | rethrowException("test::execute()"); 44 | } 45 | } 46 | }; 47 | } 48 | ``` 49 | -------------------------------------------------------------------------------- /Documentation/Doxygen/Docs/documentation_examples/threads/Getting Public Archived Threads.md: -------------------------------------------------------------------------------- 1 | Getting Public Archived Threads {#getting_public_archived_threads} 2 | ============ 3 | - Execute the, `discord_core_api::threads::getPublicArchivedThreadsAsync()` function, while passing in a value of type `discord_core_api::get_public_archived_threads_data`, with a return value of type `auto` or `discord_core_api::archived_threads_data`. 4 | - call the function with `discord_core_api::co_routine::get()` added to the end in order to wait for the results now. 5 | 6 | ```cpp 7 | /// Test.hpp -header for the "test" command. 8 | /// https://github.com/RealTimeChris/DiscordCoreAPI 9 | 10 | #pragma once 11 | 12 | #include 13 | 14 | namespace discord_core_api { 15 | 16 | class test : public base_function { 17 | public: 18 | test() { 19 | commandName = "test"; 20 | helpDescription = "testing purposes!"; 21 | embed_data msgEmbed { }; 22 | msgEmbed.setDescription("------\nSimply enter !test or /test!\n------"); 23 | msgEmbed.setTitle("__**test usage:**__"); 24 | msgEmbed.setTimeStamp(getTimeAndDate()); 25 | msgEmbed.setColor("fe_fe_fe"); 26 | helpEmbed = msgEmbed; 27 | } 28 | 29 | unique_ptr create() { 30 | return makeUnique(); 31 | } 32 | 33 | virtual void execute(base_function_arguments& args) { 34 | try { 35 | get_public_archived_threads_data& dataPackage; 36 | dataPackage.channelId = args.eventData.getChannelId(); 37 | dataPackage.limit = 1; 38 | 39 | auto newActiveThreads = threads::getPublicArchivedThreadsAsync(dataPackage).get(); 40 | 41 | 42 | } catch (...) { 43 | rethrowException("test::execute()"); 44 | } 45 | } 46 | }; 47 | } 48 | ``` 49 | -------------------------------------------------------------------------------- /Documentation/Doxygen/Docs/documentation_examples/threads/Getting a List of Active Threads.md: -------------------------------------------------------------------------------- 1 | Getting a List of Active Threads {#getting_a_list_of_active_threads} 2 | ============ 3 | - Execute the, `discord_core_api::threads::getActiveThreadsAsync()` function, while passing in a value of type `discord_core_api::get_active_threads_data`, with a return value of type `auto` or `discord_core_api::active_threads_data`. 4 | - call the function with `discord_core_api::co_routine::get()` added to the end in order to wait for the results now. 5 | 6 | ```cpp 7 | /// Test.hpp -header for the "test" command. 8 | /// https://github.com/RealTimeChris/DiscordCoreAPI 9 | 10 | #pragma once 11 | 12 | #include 13 | 14 | namespace discord_core_api { 15 | 16 | class test : public base_function { 17 | public: 18 | test() { 19 | commandName = "test"; 20 | helpDescription = "testing purposes!"; 21 | embed_data msgEmbed { }; 22 | msgEmbed.setDescription("------\nSimply enter !test or /test!\n------"); 23 | msgEmbed.setTitle("__**test usage:**__"); 24 | msgEmbed.setTimeStamp(getTimeAndDate()); 25 | msgEmbed.setColor("fe_fe_fe"); 26 | helpEmbed = msgEmbed; 27 | } 28 | 29 | unique_ptr create() { 30 | return makeUnique(); 31 | } 32 | 33 | virtual void execute(base_function_arguments& args) { 34 | try { 35 | get_active_threads_data& dataPackage; 36 | dataPackage.channelId = args.eventData.getChannelId(); 37 | 38 | auto newActiveThreads = threads::getActiveThreadsAsync(dataPackage).get(); 39 | 40 | 41 | } catch (...) { 42 | rethrowException("test::execute()"); 43 | } 44 | } 45 | }; 46 | } 47 | ``` 48 | -------------------------------------------------------------------------------- /Documentation/Doxygen/Docs/documentation_examples/threads/Getting a List of Thread Members.md: -------------------------------------------------------------------------------- 1 | Getting a List of Thread Members {#getting_a_list_of_thread_members} 2 | ============ 3 | - Execute the, `discord_core_api::threads::getThreadMembersAsync()` function, while passing in a value of type `discord_core_api::get_thread_members_data`, with a return value of type `auto` or `jsonifier::vector`. 4 | - call the function with `discord_core_api::co_routine::get()` added to the end in order to wait for the results now. 5 | 6 | ```cpp 7 | /// Test.hpp -header for the "test" command. 8 | /// https://github.com/RealTimeChris/DiscordCoreAPI 9 | 10 | #pragma once 11 | 12 | #include 13 | 14 | namespace discord_core_api { 15 | 16 | class test : public base_function { 17 | public: 18 | test() { 19 | commandName = "test"; 20 | helpDescription = "testing purposes!"; 21 | embed_data msgEmbed { }; 22 | msgEmbed.setDescription("------\nSimply enter !test or /test!\n------"); 23 | msgEmbed.setTitle("__**test usage:**__"); 24 | msgEmbed.setTimeStamp(getTimeAndDate()); 25 | msgEmbed.setColor("fe_fe_fe"); 26 | helpEmbed = msgEmbed; 27 | } 28 | 29 | unique_ptr create() { 30 | return makeUnique(); 31 | } 32 | 33 | virtual void execute(base_function_arguments& args) { 34 | try { 35 | get_thread_members_data& dataPackage; 36 | dataPackage.channelId = "909444594146639913"; 37 | 38 | auto newThreadMembers = threads::getThreadMembersAsync(dataPackage).get(); 39 | 40 | 41 | } catch (...) { 42 | rethrowException("test::execute()"); 43 | } 44 | } 45 | }; 46 | } 47 | ``` 48 | -------------------------------------------------------------------------------- /Documentation/Doxygen/Docs/documentation_examples/threads/Getting a Thread Member.md: -------------------------------------------------------------------------------- 1 | Getting a Thread Member {#getting_a_thread_member} 2 | ============ 3 | - Execute the, `discord_core_api::threads::getThreadMemberAsync()` function, while passing in a value of type `discord_core_api::get_thread_member_data`, with a return value of type `auto` or `discord_core_api::thread_member_data`. 4 | - call the function with `discord_core_api::co_routine::get()` added to the end in order to wait for the results now. 5 | 6 | ```cpp 7 | /// Test.hpp -header for the "test" command. 8 | /// https://github.com/RealTimeChris/DiscordCoreAPI 9 | 10 | #pragma once 11 | 12 | #include 13 | 14 | namespace discord_core_api { 15 | 16 | class test : public base_function { 17 | public: 18 | test() { 19 | commandName = "test"; 20 | helpDescription = "testing purposes!"; 21 | embed_data msgEmbed { }; 22 | msgEmbed.setDescription("------\nSimply enter !test or /test!\n------"); 23 | msgEmbed.setTitle("__**test usage:**__"); 24 | msgEmbed.setTimeStamp(getTimeAndDate()); 25 | msgEmbed.setColor("fe_fe_fe"); 26 | helpEmbed = msgEmbed; 27 | } 28 | 29 | unique_ptr create() { 30 | return makeUnique(); 31 | } 32 | 33 | virtual void execute(base_function_arguments& args) { 34 | try { 35 | get_thread_member_data& dataPackage; 36 | dataPackage.channelId = "909435143561809953"; 37 | dataPackage.userId = args.eventData.getAuthorId(); 38 | 39 | auto newThreadMember = threads::getThreadMemberAsync(dataPackage).get(); 40 | 41 | 42 | } catch (...) { 43 | rethrowException("test::execute()"); 44 | } 45 | } 46 | }; 47 | } 48 | ``` 49 | -------------------------------------------------------------------------------- /Documentation/Doxygen/Docs/documentation_examples/threads/Joining a Thread.md: -------------------------------------------------------------------------------- 1 | Joining a Thread {#joining_a_thread} 2 | ============ 3 | - Execute the, `discord_core_api::threads::joinThreadAsync()` function, while passing in a value of type `discord_core_api::join_thread_data`, with a return value of type `void`. 4 | - call the function with `discord_core_api::co_routine::get()` added to the end in order to wait for the results now. 5 | 6 | ```cpp 7 | /// Test.hpp -header for the "test" command. 8 | /// https://github.com/RealTimeChris/DiscordCoreAPI 9 | 10 | #pragma once 11 | 12 | #include 13 | 14 | namespace discord_core_api { 15 | 16 | class test : public base_function { 17 | public: 18 | test() { 19 | commandName = "test"; 20 | helpDescription = "testing purposes!"; 21 | embed_data msgEmbed { }; 22 | msgEmbed.setDescription("------\nSimply enter !test or /test!\n------"); 23 | msgEmbed.setTitle("__**test usage:**__"); 24 | msgEmbed.setTimeStamp(getTimeAndDate()); 25 | msgEmbed.setColor("fe_fe_fe"); 26 | helpEmbed = msgEmbed; 27 | } 28 | 29 | unique_ptr create() { 30 | return makeUnique(); 31 | } 32 | 33 | virtual void execute(base_function_arguments& args) { 34 | try { 35 | join_thread_data& dataPackage; 36 | dataPackage.channelId = "909400437902413896"; 37 | 38 | threads::joinThreadAsync(dataPackage).get(); 39 | 40 | 41 | } catch (...) { 42 | rethrowException("test::execute()"); 43 | } 44 | } 45 | }; 46 | } 47 | ``` 48 | -------------------------------------------------------------------------------- /Documentation/Doxygen/Docs/documentation_examples/threads/Listing Active Threads.md: -------------------------------------------------------------------------------- 1 | Listing Active Threads {#listing_active_threads} 2 | ============ 3 | - Execute the, `discord_core_api::threads::getActiveThreadsAsync()` function, while passing in a value of type `discord_core_api::get_active_threads_data`, with a return value of type `auto` or `discord_core_api::active_threads_data`. 4 | - call the function with `discord_core_api::co_routine::get()` added to the end in order to wait for the results now. 5 | 6 | ```cpp 7 | /// Test.hpp -header for the "test" command. 8 | /// https://github.com/RealTimeChris/DiscordCoreAPI 9 | 10 | #pragma once 11 | 12 | #include 13 | 14 | namespace discord_core_api { 15 | 16 | class test : public base_function { 17 | public: 18 | test() { 19 | commandName = "test"; 20 | helpDescription = "testing purposes!"; 21 | embed_data msgEmbed { }; 22 | msgEmbed.setDescription("------\nSimply enter !test or /test!\n------"); 23 | msgEmbed.setTitle("__**test usage:**__"); 24 | msgEmbed.setTimeStamp(getTimeAndDate()); 25 | msgEmbed.setColor("fe_fe_fe"); 26 | helpEmbed = msgEmbed; 27 | } 28 | 29 | unique_ptr create() { 30 | return makeUnique(); 31 | } 32 | 33 | virtual void execute(base_function_arguments& args) { 34 | try { 35 | get_active_threads_data& dataPackage; 36 | dataPackage.guildId = args.eventData.getGuildId(); 37 | 38 | auto threadsVector = threads::getActiveThreadsAsync(dataPackage).get(); 39 | 40 | for (const auto& value: threadsVector.threads) { 41 | std::cout << "the name: " << value.name << std::endl; 42 | } 43 | 44 | 45 | } catch (...) { 46 | rethrowException("test::execute()"); 47 | } 48 | } 49 | }; 50 | } 51 | ``` 52 | -------------------------------------------------------------------------------- /Documentation/Doxygen/Docs/documentation_examples/threads/Removing a User from a Thread.md: -------------------------------------------------------------------------------- 1 | Removing a User from a Thread {#removing_a_user_from_a_thread} 2 | ============ 3 | - Execute the, `discord_core_api::threads::removeThreadMemberAsync()` function, while passing in a value of type `discord_core_api::remove_thread_member_data`, with a return value of type `void`. 4 | - call the function with `discord_core_api::co_routine::get()` added to the end in order to wait for the results now. 5 | 6 | ```cpp 7 | /// Test.hpp -header for the "test" command. 8 | /// https://github.com/RealTimeChris/DiscordCoreAPI 9 | 10 | #pragma once 11 | 12 | #include 13 | 14 | namespace discord_core_api { 15 | 16 | class test : public base_function { 17 | public: 18 | test() { 19 | commandName = "test"; 20 | helpDescription = "testing purposes!"; 21 | embed_data msgEmbed { }; 22 | msgEmbed.setDescription("------\nSimply enter !test or /test!\n------"); 23 | msgEmbed.setTitle("__**test usage:**__"); 24 | msgEmbed.setTimeStamp(getTimeAndDate()); 25 | msgEmbed.setColor("fe_fe_fe"); 26 | helpEmbed = msgEmbed; 27 | } 28 | 29 | unique_ptr create() { 30 | return makeUnique(); 31 | } 32 | 33 | virtual void execute(base_function_arguments& args) { 34 | try { 35 | remove_thread_member_data& dataPackage; 36 | dataPackage.channelId = "909407162776834069"; 37 | dataPackage.userId = args.eventData.getAuthorId(); 38 | 39 | threads::removeThreadMemberAsync(dataPackage).get(); 40 | 41 | } catch (...) { 42 | rethrowException("test::execute()"); 43 | } 44 | } 45 | }; 46 | } 47 | ``` 48 | -------------------------------------------------------------------------------- /Documentation/Doxygen/Docs/documentation_examples/threads/Starting a Thread in a Forum Channel.md: -------------------------------------------------------------------------------- 1 | Starting a Thread in a Forum Channel {#starting_a_thread_in_a_forum_channel} 2 | ============ 3 | - Execute the, `discord_core_api::threads::startThreadInForumChannelAsync()` function, while passing in a value of type `discord_core_api::start_thread_in_forum_channel_data`, with a return value of type `auto` or `discord_core_api::thread`. 4 | - call the function with `discord_core_api::co_routine::get()` added to the end in order to wait for the results now. 5 | 6 | ```cpp 7 | // Test.hpp- header for the "test" command. 8 | // https://github.com/RealTimeChris 9 | 10 | #pragma once 11 | 12 | #include "HelperFunctions.hpp" 13 | 14 | namespace discord_core_api { 15 | 16 | class test : public base_function { 17 | public: 18 | test() { 19 | commandName = "test"; 20 | helpDescription = "testing purposes!"; 21 | embed_data msgEmbed{}; 22 | msgEmbed.setDescription("------\nSimply enter /test!\n------"); 23 | msgEmbed.setTitle("__**test usage:**__"); 24 | msgEmbed.setTimeStamp(getTimeAndDate()); 25 | msgEmbed.setColor("fe_fe_fe"); 26 | helpEmbed = msgEmbed; 27 | } 28 | 29 | unique_ptr create() { 30 | return makeUnique(); 31 | } 32 | 33 | virtual void execute(base_function_arguments& newArgs) { 34 | try { 35 | 36 | start_thread_in_forum_channel_data& dataPackage; 37 | dataPackage.channelId = newArgs.eventData.getChannelId(); 38 | dataPackage.message.content = "testing"; 39 | dataPackage.name = "the test thread"; 40 | threads::startThreadInForumChannelAsync(dataPackage).get(); 41 | 42 | return; 43 | } catch (...) { 44 | reportException("test::execute()"); 45 | } 46 | } 47 | virtual ~test(){}; 48 | }; 49 | } 50 | ``` 51 | -------------------------------------------------------------------------------- /Documentation/Doxygen/Docs/documentation_examples/users/Getting Current User Application Info.md: -------------------------------------------------------------------------------- 1 | Getting Current User Application Info {#getting_current_user_application_info} 2 | =========== 3 | - Execute the, `discord_core_api::users::getCurrentUserApplicationInfoAsync()` function, with a return value of type `auto` or `discord_core_api::application_data`. 4 | - call the function with `discord_core_api::co_routine::get()` added to the end in order to wait for the results now. 5 | 6 | ```cpp 7 | /// Test.hpp -header for the "test" command. 8 | /// https://github.com/RealTimeChris/DiscordCoreAPI 9 | 10 | #pragma once 11 | 12 | #include 13 | 14 | namespace discord_core_api { 15 | 16 | class test : public base_function { 17 | public: 18 | test() { 19 | commandName = "test"; 20 | helpDescription = "testing purposes!"; 21 | embed_data msgEmbed { }; 22 | msgEmbed.setDescription("------\nSimply enter !test or /test!\n------"); 23 | msgEmbed.setTitle("__**test usage:**__"); 24 | msgEmbed.setTimeStamp(getTimeAndDate()); 25 | msgEmbed.setColor("fe_fe_fe"); 26 | helpEmbed = msgEmbed; 27 | } 28 | 29 | unique_ptr create() { 30 | return makeUnique(); 31 | } 32 | 33 | virtual void execute(base_function_arguments& args) { 34 | try { 35 | auto responseData = users::getCurrentUserApplicationInfoAsync().get(); 36 | 37 | std::cout << "the name: " << responseData.name << std::endl; 38 | 39 | 40 | } catch (...) { 41 | rethrowException("test::execute()"); 42 | } 43 | } 44 | 45 | virtual ~test() = default; 46 | }; 47 | } 48 | ``` 49 | -------------------------------------------------------------------------------- /Documentation/Doxygen/Docs/documentation_examples/users/Getting Current User Authorization Info.md: -------------------------------------------------------------------------------- 1 | Getting Current User Authorization Info {#getting_current_user_authorization_info} 2 | ============ 3 | - Execute the, `discord_core_api::users::getCurrentUserAuthorizationInfoAsync()` function, with a return value of type `auto` or `discord_core_api::authorization_info_data`. 4 | - call the function with `discord_core_api::co_routine::get()` added to the end in order to wait for the results now. 5 | 6 | ```cpp 7 | /// Test.hpp -header for the "test" command. 8 | /// https://github.com/RealTimeChris/DiscordCoreAPI 9 | 10 | #pragma once 11 | 12 | #include 13 | 14 | namespace discord_core_api { 15 | 16 | class test : public base_function { 17 | public: 18 | test() { 19 | commandName = "test"; 20 | helpDescription = "testing purposes!"; 21 | embed_data msgEmbed { }; 22 | msgEmbed.setDescription("------\nSimply enter !test or /test!\n------"); 23 | msgEmbed.setTitle("__**test usage:**__"); 24 | msgEmbed.setTimeStamp(getTimeAndDate()); 25 | msgEmbed.setColor("fe_fe_fe"); 26 | helpEmbed = msgEmbed; 27 | } 28 | 29 | unique_ptr create() { 30 | return makeUnique(); 31 | } 32 | 33 | virtual void execute(base_function_arguments& args) { 34 | try { 35 | auto responseData = users::getCurrentUserAuthorizationInfoAsync().get(); 36 | 37 | std::cout << "the name: " << responseData.user.userName << std::endl; 38 | 39 | 40 | } catch (...) { 41 | rethrowException("test::execute()"); 42 | } 43 | } 44 | 45 | virtual ~test() = default; 46 | }; 47 | } 48 | ``` 49 | -------------------------------------------------------------------------------- /Documentation/Doxygen/Docs/documentation_examples/users/Getting User Connections.md: -------------------------------------------------------------------------------- 1 | Getting User Connections {#getting_user_connections} 2 | ============ 3 | - Execute the, `discord_core_api::users::getUserConnectionsAsync()` function, with a return value of type `auto` or `jsonifier::vector`. 4 | - call the function with `discord_core_api::co_routine::get()` added to the end in order to wait for the results now. 5 | 6 | ```cpp 7 | /// Test.hpp -header for the "test" command. 8 | /// https://github.com/RealTimeChris/DiscordCoreAPI 9 | 10 | #pragma once 11 | 12 | #include 13 | 14 | namespace discord_core_api { 15 | 16 | class test : public base_function { 17 | public: 18 | test() { 19 | commandName = "test"; 20 | helpDescription = "testing purposes!"; 21 | embed_data msgEmbed { }; 22 | msgEmbed.setDescription("------\nSimply enter !test or /test!\n------"); 23 | msgEmbed.setTitle("__**test usage:**__"); 24 | msgEmbed.setTimeStamp(getTimeAndDate()); 25 | msgEmbed.setColor("fe_fe_fe"); 26 | helpEmbed = msgEmbed; 27 | } 28 | 29 | unique_ptr create() { 30 | return makeUnique(); 31 | } 32 | 33 | virtual void execute(base_function_arguments& args) { 34 | try { 35 | auto responseVector = users::getUserConnectionsAsync(dataPackage).get(); 36 | 37 | for (auto& value: responseVector) { 38 | std::cout << "the id: " << value.id << std::endl; 39 | } 40 | 41 | 42 | } catch (...) { 43 | rethrowException("test::execute()"); 44 | } 45 | } 46 | 47 | virtual ~test() = default; 48 | }; 49 | } 50 | ``` 51 | -------------------------------------------------------------------------------- /Documentation/Doxygen/Docs/documentation_examples/users/Getting a User.md: -------------------------------------------------------------------------------- 1 | Getting a User {#getting_a_user} 2 | ============ 3 | - Execute the, `discord_core_api::users::getCachedUser()` (which collects it from the cache), or `discord_core_api::users::getUserAsync()` (which collects it from the discord servers) function, while passing in a value of type `discord_core_api::get_user_data`, with a return value of `auto` or `discord_core_api::user`. 4 | - call the function with `discord_core_api::co_routine::get()` added to the end in order to wait for the results now. 5 | 6 | ```cpp 7 | /// Test.hpp -header for the "test" command. 8 | /// https://github.com/RealTimeChris/DiscordCoreAPI 9 | 10 | #pragma once 11 | 12 | #include 13 | 14 | namespace discord_core_api { 15 | 16 | class test : public base_function { 17 | public: 18 | test() { 19 | commandName = "test"; 20 | helpDescription = "testing purposes!"; 21 | embed_data msgEmbed { }; 22 | msgEmbed.setDescription("------\nSimply enter !test or /test!\n------"); 23 | msgEmbed.setTitle("__**test usage:**__"); 24 | msgEmbed.setTimeStamp(getTimeAndDate()); 25 | msgEmbed.setColor("fe_fe_fe"); 26 | helpEmbed = msgEmbed; 27 | } 28 | 29 | unique_ptr create() { 30 | return makeUnique(); 31 | } 32 | 33 | virtual void execute(base_function_arguments& args) { 34 | try { 35 | get_user_data& dataPackage; 36 | dataPackage.userId = args.eventData.getAuthorId(); 37 | 38 | auto currentUser = users::getUserAsync(dataPackage).get(); 39 | 40 | std::cout << currentUser.userName << std::endl; 41 | 42 | 43 | } catch (...) { 44 | rethrowException("test::execute()"); 45 | } 46 | } 47 | 48 | virtual ~test() = default; 49 | }; 50 | } 51 | 52 | 53 | ``` 54 | -------------------------------------------------------------------------------- /Documentation/Doxygen/Docs/documentation_examples/users/Getting the Current User.md: -------------------------------------------------------------------------------- 1 | Getting the Current User {#getting_the_current_user} 2 | ============ 3 | - Execute the, `discord_core_api::users::getCurrentUserAsync()` function, with a return value of type `auto` or `discord_core_api::user`. 4 | - call the function with `discord_core_api::co_routine::get()` added to the end in order to wait for the results now. 5 | 6 | ```cpp 7 | /// Test.hpp -header for the "test" command. 8 | /// https://github.com/RealTimeChris/DiscordCoreAPI 9 | 10 | #pragma once 11 | 12 | #include 13 | 14 | namespace discord_core_api { 15 | 16 | class test : public base_function { 17 | public: 18 | test() { 19 | commandName = "test"; 20 | helpDescription = "testing purposes!"; 21 | embed_data msgEmbed { }; 22 | msgEmbed.setDescription("------\nSimply enter !test or /test!\n------"); 23 | msgEmbed.setTitle("__**test usage:**__"); 24 | msgEmbed.setTimeStamp(getTimeAndDate()); 25 | msgEmbed.setColor("fe_fe_fe"); 26 | helpEmbed = msgEmbed; 27 | } 28 | 29 | unique_ptr create() { 30 | return makeUnique(); 31 | } 32 | 33 | virtual void execute(base_function_arguments& args) { 34 | try { 35 | auto currentUser = users::getCurrentUserAsync().get(); 36 | 37 | std::cout << currentUser.userName << std::endl; 38 | 39 | 40 | } catch (...) { 41 | rethrowException("test::execute()"); 42 | } 43 | } 44 | 45 | virtual ~test() = default; 46 | }; 47 | } 48 | ``` 49 | -------------------------------------------------------------------------------- /Documentation/Doxygen/Docs/documentation_examples/users/Modifying Current User's Voice State.md: -------------------------------------------------------------------------------- 1 | Modifying Current User's Voice State {#modifying_current_user_voice_state} 2 | ============ 3 | - Execute the, `discord_core_api::users::modifyCurrentUserVoiceStateAsync()` function, while passing in a value of type `discord_core_api::modify_current_user_voice_state_data`, with a return value of type `void`. 4 | - call the function with `discord_core_api::co_routine::get()` added to the end in order to wait for the results now. 5 | 6 | ```cpp 7 | /// Test.hpp -header for the "test" command. 8 | /// https://github.com/RealTimeChris/DiscordCoreAPI 9 | 10 | #pragma once 11 | 12 | #include 13 | 14 | namespace discord_core_api { 15 | 16 | class test : public base_function { 17 | public: 18 | test() { 19 | commandName = "test"; 20 | helpDescription = "testing purposes!"; 21 | embed_data msgEmbed { }; 22 | msgEmbed.setDescription("------\nSimply enter !test or /test!\n------"); 23 | msgEmbed.setTitle("__**test usage:**__"); 24 | msgEmbed.setTimeStamp(getTimeAndDate()); 25 | msgEmbed.setColor("fe_fe_fe"); 26 | helpEmbed = msgEmbed; 27 | } 28 | 29 | unique_ptr create() { 30 | return makeUnique(); 31 | } 32 | 33 | virtual void execute(base_function_arguments& args) { 34 | try { 35 | modify_current_user_voice_state_data& dataPackage; 36 | dataPackage.guildId = args.eventData.getGuildId(); 37 | dataPackage.channelId = args.eventData.getChannelId(); 38 | dataPackage.suppress = false; 39 | 40 | users::modifyCurrentUserVoiceStateAsync(dataPackage).get(); 41 | 42 | 43 | } catch (...) { 44 | rethrowException("test::execute()"); 45 | } 46 | } 47 | }; 48 | } 49 | ``` 50 | -------------------------------------------------------------------------------- /Documentation/Doxygen/Docs/documentation_examples/users/Modifying a User's Voice State.md: -------------------------------------------------------------------------------- 1 | Modifying a User's Voice State {#modifying_a_user_voice_state} 2 | ============ 3 | - Execute the, `discord_core_api::users::modifyUserVoiceStateAsync()` function, while passing in a value of type `discord_core_api::modify_user_voice_state_data`, with a return value of type `void`. 4 | - call the function with `discord_core_api::co_routine::get()` added to the end in order to wait for the results now. 5 | 6 | ```cpp 7 | /// Test.hpp -header for the "test" command. 8 | /// https://github.com/RealTimeChris/DiscordCoreAPI 9 | 10 | #pragma once 11 | 12 | #include 13 | 14 | namespace discord_core_api { 15 | 16 | class test : public base_function { 17 | public: 18 | test() { 19 | commandName = "test"; 20 | helpDescription = "testing purposes!"; 21 | embed_data msgEmbed { }; 22 | msgEmbed.setDescription("------\nSimply enter !test or /test!\n------"); 23 | msgEmbed.setTitle("__**test usage:**__"); 24 | msgEmbed.setTimeStamp(getTimeAndDate()); 25 | msgEmbed.setColor("fe_fe_fe"); 26 | helpEmbed = msgEmbed; 27 | } 28 | 29 | unique_ptr create() { 30 | return makeUnique(); 31 | } 32 | 33 | virtual void execute(base_function_arguments& args) { 34 | try { 35 | modify_user_voice_state_data& dataPackage; 36 | dataPackage.guildId = args.eventData.getGuildId(); 37 | dataPackage.channelId = args.eventData.getChannelId(); 38 | dataPackage.suppress = false; 39 | dataPackage.userId = args.eventData.getAuthorId(); 40 | 41 | users::modifyUserVoiceStateAsync(dataPackage).get(); 42 | 43 | 44 | } catch (...) { 45 | rethrowException("test::execute()"); 46 | } 47 | } 48 | }; 49 | } 50 | ``` 51 | -------------------------------------------------------------------------------- /Documentation/Doxygen/Docs/documentation_examples/users/Modifying the Current User.md: -------------------------------------------------------------------------------- 1 | Modifying the Current User {#modifying_the_current_user} 2 | ============ 3 | - Execute the, `discord_core_api::users::modifyCurrentUserAsync()` function, while passing in a value of type `discord_core_api::modify_current_user_data`, with a return value of type `auto` or `discord_core_api::user`. 4 | - call the function with `discord_core_api::co_routine::get()` added to the end in order to wait for the results now. 5 | 6 | ```cpp 7 | /// Test.hpp -header for the "test" command. 8 | /// https://github.com/RealTimeChris/DiscordCoreAPI 9 | 10 | #pragma once 11 | 12 | #include 13 | 14 | namespace discord_core_api { 15 | 16 | class test : public base_function { 17 | public: 18 | test() { 19 | commandName = "test"; 20 | helpDescription = "testing purposes!"; 21 | embed_data msgEmbed { }; 22 | msgEmbed.setDescription("------\nSimply enter !test or /test!\n------"); 23 | msgEmbed.setTitle("__**test usage:**__"); 24 | msgEmbed.setTimeStamp(getTimeAndDate()); 25 | msgEmbed.setColor("fe_fe_fe"); 26 | helpEmbed = msgEmbed; 27 | } 28 | 29 | unique_ptr create() { 30 | return makeUnique(); 31 | } 32 | 33 | virtual void execute(base_function_arguments& args) { 34 | try { 35 | modify_current_user_data& dataPackage; 36 | dataPackage.userName = "MBot_GameHouse"; 37 | 38 | auto currentUser = users::modifyCurrentUserAsync(dataPackage).get(); 39 | 40 | std::cout << currentUser.userName << std::endl; 41 | 42 | 43 | } catch (...) { 44 | rethrowException("test::execute()"); 45 | } 46 | } 47 | 48 | virtual ~test() = default; 49 | }; 50 | } 51 | ``` 52 | -------------------------------------------------------------------------------- /Documentation/Doxygen/Docs/documentation_examples/webhooks/Creating a WebHook.md: -------------------------------------------------------------------------------- 1 | Sending a WebHook using a Discord Bot Library C++ {#creating_a_web_hook} 2 | ============ 3 | - Execute the, `discord_core_api::web_hooks::createWebHookAsync()` function, while passing in a value of type `discord_core_api::create_web_hook_data`, with a return value of type `auto` or `discord_core_api::web_hook_data`. 4 | - call the function with `discord_core_api::co_routine::get()` added to the end in order to wait for the results now. 5 | 6 | ```cpp 7 | /// Test.hpp -header for the "test" command. 8 | /// https://github.com/RealTimeChris/DiscordCoreAPI 9 | 10 | #pragma once 11 | 12 | #include 13 | 14 | namespace discord_core_api { 15 | 16 | class test : public base_function { 17 | public: 18 | test() { 19 | commandName = "test"; 20 | helpDescription = "testing purposes!"; 21 | embed_data msgEmbed { }; 22 | msgEmbed.setDescription("------\nSimply enter !test or /test!\n------"); 23 | msgEmbed.setTitle("__**test usage:**__"); 24 | msgEmbed.setTimeStamp(getTimeAndDate()); 25 | msgEmbed.setColor("fe_fe_fe"); 26 | helpEmbed = msgEmbed; 27 | } 28 | 29 | unique_ptr create() { 30 | return makeUnique(); 31 | } 32 | 33 | virtual void execute(base_function_arguments& args) { 34 | try { 35 | create_web_hook_data& dataPackage; 36 | dataPackage.channelId = args.eventData.getChannelId(); 37 | dataPackage.name = "TEST_WEBHOOK"; 38 | 39 | auto newWebHook = discord_core_api::web_hooks::createWebHookAsync(dataPackage).get(); 40 | 41 | std::cout << "the name: " << newWebHook.name << std::endl; 42 | 43 | 44 | } catch (...) { 45 | rethrowException("test::execute()"); 46 | } 47 | } 48 | 49 | virtual ~test() = default; 50 | }; 51 | } 52 | ``` 53 | -------------------------------------------------------------------------------- /Documentation/Doxygen/Docs/documentation_examples/webhooks/Deleting a WebHook.md: -------------------------------------------------------------------------------- 1 | Deleting a WebHook {#deleting_a_web_hook} 2 | ============ 3 | - Execute the, `discord_core_api::web_hooks::deleteWebHookAsync()` function, while passing in a value of type `discord_core_api::delete_web_hook_data`, with a return value of type `void`. 4 | - call the function with `discord_core_api::co_routine::get()` added to the end in order to wait for the results now. 5 | 6 | ```cpp 7 | /// Test.hpp -header for the "test" command. 8 | /// https://github.com/RealTimeChris/DiscordCoreAPI 9 | 10 | #pragma once 11 | 12 | #include 13 | 14 | namespace discord_core_api { 15 | 16 | class test : public base_function { 17 | public: 18 | test() { 19 | commandName = "test"; 20 | helpDescription = "testing purposes!"; 21 | embed_data msgEmbed { }; 22 | msgEmbed.setDescription("------\nSimply enter !test or /test!\n------"); 23 | msgEmbed.setTitle("__**test usage:**__"); 24 | msgEmbed.setTimeStamp(getTimeAndDate()); 25 | msgEmbed.setColor("fe_fe_fe"); 26 | helpEmbed = msgEmbed; 27 | } 28 | 29 | unique_ptr create() { 30 | return makeUnique(); 31 | } 32 | 33 | virtual void execute(base_function_arguments& args) { 34 | try { 35 | get_guild_web_hooks_data& dataPackage; 36 | dataPackage.guildId = args.eventData.getGuildId(); 37 | 38 | auto newWebHooks = discord_core_api::web_hooks::getGuildWebHooksAsync(dataPackage).get(); 39 | 40 | delete_web_hook_data& dataPackage01; 41 | dataPackage01.webHookId = newWebHooks[0].id; 42 | 43 | discord_core_api::web_hooks::deleteWebHookAsync(dataPackage01).get(); 44 | 45 | 46 | } catch (...) { 47 | rethrowException("test::execute()"); 48 | } 49 | } 50 | 51 | virtual ~test() = default; 52 | }; 53 | } 54 | ``` 55 | -------------------------------------------------------------------------------- /Documentation/Doxygen/Docs/documentation_examples/webhooks/Getting Channel WebHooks.md: -------------------------------------------------------------------------------- 1 | Getting Channel WebHooks {#getting_channel_web_hooks} 2 | ============ 3 | - Execute the, `discord_core_api::web_hooks::getChannelWebHooksAsync()` function, while passing in a value of type `discord_core_api::get_channel_web_hooks_data`, with a return value of type `auto` or `jsonifier::vector`. 4 | - call the function with `discord_core_api::co_routine::get()` added to the end in order to wait for the results now. 5 | 6 | ```cpp 7 | /// Test.hpp -header for the "test" command. 8 | /// https://github.com/RealTimeChris/DiscordCoreAPI 9 | 10 | #pragma once 11 | 12 | #include 13 | 14 | namespace discord_core_api { 15 | 16 | class test : public base_function { 17 | public: 18 | test() { 19 | commandName = "test"; 20 | helpDescription = "testing purposes!"; 21 | embed_data msgEmbed { }; 22 | msgEmbed.setDescription("------\nSimply enter !test or /test!\n------"); 23 | msgEmbed.setTitle("__**test usage:**__"); 24 | msgEmbed.setTimeStamp(getTimeAndDate()); 25 | msgEmbed.setColor("fe_fe_fe"); 26 | helpEmbed = msgEmbed; 27 | } 28 | 29 | unique_ptr create() { 30 | return makeUnique(); 31 | } 32 | 33 | virtual void execute(base_function_arguments& args) { 34 | try { 35 | get_channel_web_hooks_data& dataPackage; 36 | dataPackage.channelId = args.eventData.getChannelId(); 37 | 38 | auto newWebHooks = discord_core_api::web_hooks::getChannelWebHooksAsync(dataPackage).get(); 39 | 40 | for (auto& value: newWebHooks) { 41 | std::cout << "the name: " << value.name << std::endl; 42 | } 43 | 44 | 45 | } catch (...) { 46 | rethrowException("test::execute()"); 47 | } 48 | } 49 | 50 | virtual ~test() = default; 51 | }; 52 | } 53 | ``` 54 | -------------------------------------------------------------------------------- /Documentation/Doxygen/Docs/documentation_examples/webhooks/Getting Guild WebHooks.md: -------------------------------------------------------------------------------- 1 | Getting Guild WebHooks {#getting_guild_web_hooks} 2 | ============ 3 | - Execute the, `discord_core_api::web_hooks::getGuildWebHooksAsync()` function, while passing in a value of type `discord_core_api::get_guild_web_hooks_data`, with a return value of type `auto` or `jsonifier::vector`. 4 | - call the function with `discord_core_api::co_routine::get()` added to the end in order to wait for the results now. 5 | 6 | ```cpp 7 | /// Test.hpp -header for the "test" command. 8 | /// https://github.com/RealTimeChris/DiscordCoreAPI 9 | 10 | #pragma once 11 | 12 | #include 13 | 14 | namespace discord_core_api { 15 | 16 | class test : public base_function { 17 | public: 18 | test() { 19 | commandName = "test"; 20 | helpDescription = "testing purposes!"; 21 | embed_data msgEmbed { }; 22 | msgEmbed.setDescription("------\nSimply enter !test or /test!\n------"); 23 | msgEmbed.setTitle("__**test usage:**__"); 24 | msgEmbed.setTimeStamp(getTimeAndDate()); 25 | msgEmbed.setColor("fe_fe_fe"); 26 | helpEmbed = msgEmbed; 27 | } 28 | 29 | unique_ptr create() { 30 | return makeUnique(); 31 | } 32 | 33 | virtual void execute(base_function_arguments& args) { 34 | try { 35 | get_guild_web_hooks_data& dataPackage; 36 | dataPackage.guildId = args.eventData.getGuildId(); 37 | 38 | auto newWebHooks = discord_core_api::web_hooks::getGuildWebHooksAsync(dataPackage).get(); 39 | 40 | for (auto& value: newWebHooks) { 41 | std::cout << "the name: " << value.name << std::endl; 42 | } 43 | 44 | 45 | } catch (...) { 46 | rethrowException("test::execute()"); 47 | } 48 | } 49 | 50 | virtual ~test() = default; 51 | }; 52 | } 53 | ``` 54 | -------------------------------------------------------------------------------- /Documentation/Doxygen/Docs/guides.md: -------------------------------------------------------------------------------- 1 | Guides {#guides} 2 | ============ 3 | * \subpage music_bot_guide 4 | -------------------------------------------------------------------------------- /Documentation/Doxygen/Images/TheLogo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/RealTimeChris/DiscordCoreAPI/249494033a541ec859f289aa3f59ebe5c27eb05a/Documentation/Doxygen/Images/TheLogo.png -------------------------------------------------------------------------------- /Documentation/Images/Message-Command.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/RealTimeChris/DiscordCoreAPI/249494033a541ec859f289aa3f59ebe5c27eb05a/Documentation/Images/Message-Command.png -------------------------------------------------------------------------------- /Documentation/Images/Modal-01.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/RealTimeChris/DiscordCoreAPI/249494033a541ec859f289aa3f59ebe5c27eb05a/Documentation/Images/Modal-01.png -------------------------------------------------------------------------------- /Documentation/Images/Modal-02.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/RealTimeChris/DiscordCoreAPI/249494033a541ec859f289aa3f59ebe5c27eb05a/Documentation/Images/Modal-02.png -------------------------------------------------------------------------------- /Documentation/Images/Rate-Limit.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/RealTimeChris/DiscordCoreAPI/249494033a541ec859f289aa3f59ebe5c27eb05a/Documentation/Images/Rate-Limit.png -------------------------------------------------------------------------------- /Documentation/Images/Select-Menu-01.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/RealTimeChris/DiscordCoreAPI/249494033a541ec859f289aa3f59ebe5c27eb05a/Documentation/Images/Select-Menu-01.png -------------------------------------------------------------------------------- /Documentation/Images/Select-Menu-02.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/RealTimeChris/DiscordCoreAPI/249494033a541ec859f289aa3f59ebe5c27eb05a/Documentation/Images/Select-Menu-02.png -------------------------------------------------------------------------------- /Documentation/Images/Slash-Commands and Buttons.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/RealTimeChris/DiscordCoreAPI/249494033a541ec859f289aa3f59ebe5c27eb05a/Documentation/Images/Slash-Commands and Buttons.png -------------------------------------------------------------------------------- /Documentation/Images/TheLogo.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/RealTimeChris/DiscordCoreAPI/249494033a541ec859f289aa3f59ebe5c27eb05a/Documentation/Images/TheLogo.ico -------------------------------------------------------------------------------- /Documentation/Images/TheLogo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/RealTimeChris/DiscordCoreAPI/249494033a541ec859f289aa3f59ebe5c27eb05a/Documentation/Images/TheLogo.png -------------------------------------------------------------------------------- /Documentation/Images/TheLogo01.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/RealTimeChris/DiscordCoreAPI/249494033a541ec859f289aa3f59ebe5c27eb05a/Documentation/Images/TheLogo01.png -------------------------------------------------------------------------------- /Documentation/Images/User-Command.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/RealTimeChris/DiscordCoreAPI/249494033a541ec859f289aa3f59ebe5c27eb05a/Documentation/Images/User-Command.png -------------------------------------------------------------------------------- /Include/discordcoreapi/Index.hpp: -------------------------------------------------------------------------------- 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 | /// Index.hpp - Header for the final index. 27 | /// Oct 6, 2021 28 | /// https://discordcoreapi.com 29 | /// \file Index.hpp 30 | #pragma once 31 | 32 | #include 33 | #include 34 | -------------------------------------------------------------------------------- /License.md: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2023 RealTimeChris 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /Vcpkg/ports/discordcoreapi/portfile.cmake: -------------------------------------------------------------------------------- 1 | if(VCPKG_TARGET_IS_LINUX) 2 | message(WARNING "DiscordCoreAPI only supports g++ 11 on linux.") 3 | endif() 4 | 5 | vcpkg_from_github( 6 | OUT_SOURCE_PATH SOURCE_PATH 7 | REPO RealTimeChris/DiscordCoreAPI 8 | REF "v${VERSION}" 9 | SHA512 f4957899d8bb8683d9a9515a1e58fc3c0babc69f19bf671209ce4a187fb7c50b5b3d31a167100da702801bcc52892a1923d50bdcb6e5d1dc4f2e6f3c329e5661 10 | HEAD_REF main 11 | ) 12 | 13 | vcpkg_cmake_configure( 14 | SOURCE_PATH "${SOURCE_PATH}" 15 | ) 16 | 17 | vcpkg_cmake_install() 18 | 19 | vcpkg_cmake_config_fixup(NO_PREFIX_CORRECTION) 20 | 21 | file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/debug/include" "${CURRENT_PACKAGES_DIR}/debug/share") 22 | 23 | if(VCPKG_LIBRARY_LINKAGE STREQUAL "static") 24 | file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/bin" "${CURRENT_PACKAGES_DIR}/debug/bin") 25 | endif() 26 | 27 | vcpkg_install_copyright(FILE_LIST "${SOURCE_PATH}/License.md") 28 | -------------------------------------------------------------------------------- /Vcpkg/ports/discordcoreapi/vcpkg.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "discordcoreapi", 3 | "version": "2.0.9", 4 | "description": "A Discord bot library written in C++ using custom asynchronous coroutines.", 5 | "homepage": "https://discordcoreapi.com", 6 | "license": "MIT", 7 | "supports": "(windows & x64 & !xbox) | (linux & x64) | (osx & x64)", 8 | "dependencies": [ 9 | "jsonifier", 10 | "libsodium", 11 | "openssl", 12 | "opus", 13 | { 14 | "name": "vcpkg-cmake", 15 | "host": true 16 | }, 17 | { 18 | "name": "vcpkg-cmake-config", 19 | "host": true 20 | } 21 | ] 22 | } --------------------------------------------------------------------------------