mirror of
https://github.com/VCMP-SqMod/SqMod.git
synced 2026-12-01 08:07:08 +01:00
Basic Discord library layout.
Foundation for the discord library bindings. To be gradually exposed to the script.
This commit is contained in:
1 parent
f6cb8ff8a1
commit
4f70f89b78
138 files changed
+60430
No files matched your search
+35
@@ -0,0 +1,35 @@
|
||||
#include <dpp/discord.h>
|
||||
#include <dpp/event.h>
|
||||
#include <string>
|
||||
#include <iostream>
|
||||
#include <fstream>
|
||||
#include <dpp/discordclient.h>
|
||||
#include <dpp/discordevents.h>
|
||||
#include <dpp/discord.h>
|
||||
#include <dpp/cache.h>
|
||||
#include <dpp/stringops.h>
|
||||
#include <dpp/nlohmann/json.hpp>
|
||||
#include <fmt/format.h>
|
||||
|
||||
using json = nlohmann::json;
|
||||
|
||||
namespace dpp { namespace events {
|
||||
|
||||
using namespace dpp;
|
||||
void thread_create::handle(discord_client* client, json& j, const std::string& raw) {
|
||||
json& d = j["d"];
|
||||
|
||||
dpp::channel t;
|
||||
t.fill_from_json(&d);
|
||||
dpp::guild* g = dpp::find_guild(t.guild_id);
|
||||
if (g) {
|
||||
g->threads.push_back(t.id);
|
||||
if (client->creator->dispatch.thread_create) {
|
||||
dpp::thread_create_t tc(client, raw);
|
||||
tc.created = t;
|
||||
tc.creating_guild = g;
|
||||
client->creator->dispatch.thread_create(tc);
|
||||
}
|
||||
}
|
||||
}
|
||||
}};
|
||||
Reference in new issue
Block a user