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

Commit

Permalink
Added timer convenience function
Browse files Browse the repository at this point in the history
  • Loading branch information
zeroxs committed Sep 4, 2019
1 parent cd98b5d commit d619f7a
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions include/aegis/core.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -446,6 +446,16 @@ class core
*/
AEGIS_DECL void update_presence(const std::string& text, gateway::objects::activity::activity_type type = gateway::objects::activity::Game, gateway::objects::presence::user_status status = gateway::objects::presence::Online);

/// Passes through to Websocket++
/**
* @param duration Time until function should be run in milliseconds
* @param callback Function to run when timer expires
*/
AEGIS_DECL std::shared_ptr<asio::steady_timer> set_timer(long duration, std::function<void(const asio::error_code &)> callback)
{
return get_shard_mgr().get_websocket().set_timer(duration, std::move(callback));
}

std::unordered_map<snowflake, std::unique_ptr<channel>> channels;
std::unordered_map<snowflake, std::unique_ptr<guild>> guilds;
#if !defined(AEGIS_DISABLE_ALL_CACHE)
Expand Down

0 comments on commit d619f7a

Please sign in to comment.