Skip to content
This repository was archived by the owner on Dec 1, 2021. It is now read-only.

Commit 40c24e3

Browse files
change discordapp.com domain name for REST endpoints to discord.com in preperation for this being mandatory later.
add .vimrc to allow for indenting when editing in vim.
1 parent 6f64b64 commit 40c24e3

File tree

2 files changed

+20
-6
lines changed

2 files changed

+20
-6
lines changed

.vimrc

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
set foldlevel=99 " go deep
2+
set tabstop=4 softtabstop=0 expandtab shiftwidth=4 smarttab

include/aegis/impl/core.cpp

Lines changed: 18 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -107,7 +107,7 @@ AEGIS_DECL void core::setup_shard_mgr()
107107
{
108108
_shard_mgr = std::make_shared<shards::shard_mgr>(_token, *_io_context, log);
109109

110-
_rest = std::make_shared<rest::rest_controller>(_token, "/api/v6", "discordapp.com", &get_io_context());
110+
_rest = std::make_shared<rest::rest_controller>(_token, "/api/v6", "discord.com", &get_io_context());
111111

112112
setup_gateway();
113113

@@ -789,6 +789,18 @@ AEGIS_DECL void core::on_message(websocketpp::connection_hdl hdl, std::string ms
789789
if (!result["s"].is_null())
790790
_shard->set_sequence(result["s"]);
791791

792+
/* XXX NOT WORKING
793+
794+
if (result["op"] == 7)
795+
{
796+
//Disconnect and RESUME
797+
log->debug("Discord requested reconnect for shard {}", _shard->get_id());
798+
//_shard_mgr->close(_shard);
799+
_shard->_heartbeat_status = heartbeat_status::waiting;
800+
_shard->lastheartbeat = std::chrono::steady_clock::now() - 21s;
801+
return;
802+
}*/
803+
792804
if (!result["t"].is_null())
793805
{
794806
const std::string & cmd = result["t"];
@@ -899,11 +911,11 @@ AEGIS_DECL void core::on_message(websocketpp::connection_hdl hdl, std::string ms
899911
}
900912
}
901913
};
902-
// If intents have been specified by create_bot_t, send them
903-
// FIXME: We can't use aegis::intent within this lambda!
904-
if (_intents != 0xffffffff) {
905-
obj["d"]["intents"] = _intents;
906-
}
914+
// If intents have been specified by create_bot_t, send them
915+
// FIXME: We can't use aegis::intent within this lambda!
916+
if (_intents != 0xffffffff) {
917+
obj["d"]["intents"] = _intents;
918+
}
907919
_shard_mgr->_last_identify = std::chrono::steady_clock::now();
908920
if (!self_presence.empty())
909921
{

0 commit comments

Comments
 (0)