aboutsummaryrefslogtreecommitdiff
path: root/src/client/event_handler.rs
Commit message (Collapse)AuthorAgeFilesLines
* Change signature of EventHandler::message_update and the dispatch call to ↵fix_message_updateMishio5952018-09-051-1/+1
| | | | account for situations where the new message is not cached
* Old message on update (#368)Adelyn2018-08-261-5/+12
|
* Remove extraneous spaces at the end of linesZeyla Hellyer2018-06-171-54/+54
|
* Replace (most) placeholders with actual namesacdenisSK2018-05-221-54/+54
|
* Refactor imports/exports to use nested groups and better formattingacdenisSK2018-03-291-2/+4
|
* Add documentation to `EventHandler`acdenisSK2018-02-191-2/+205
|
* Add an event for shard updatesZeyla Hellyer2018-01-011-0/+6
| | | | | Add an event in the EventHandler to be called when a shard updates its Connection Stage.
* Break up the model moduleZeyla Hellyer2017-12-161-2/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The `model` module has historically been one giant module re-exporting all of the model types, which is somewhere around 100 types. This can be a lot to look at for a new user and somewhat overwhelming, especially with a large number of fine-grained imports from the module. The module is now neatly split up into submodules, mostly like it has been internally since the early versions of the library. The submodules are: - application - channel - error - event - gateway - guild - id - invite - misc - permissions - prelude - user - voice - webhook Each submodule contains types that are "owned" by the module. For example, the `guild` submodule contains, but not limited to, Emoji, AuditLogsEntry, Role, and Member. `channel` contains, but not limited to, Attachment, Embed, Message, and Reaction. Upgrade path: Instead of glob importing the models via `use serenity::model::*;`, instead glob import via the prelude: ```rust use serenity::model::prelude::*; ``` Instead of importing from the root model module: ```rust use serenity::model::{Guild, Message, OnlineStatus, Role, User}; ``` instead import from the submodules like so: ```rust use serenity::model::channel::Message; use serenity::model::guild::{Guild, Role}; use serenity::model::user::{OnlineStatus, User}; ```
* Re-order use statements alphabeticallyZeyla Hellyer2017-11-111-2/+2
|
* Remove `on_` prefix to EventHandler tymethodsZeyla Hellyer2017-10-221-51/+51
| | | | | It was voted that the `on_` prefix is unnecessary, so these have been dropped.
* Switch to parking_lot::{Mutex, RwLock}Zeyla Hellyer2017-10-101-2/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Switch to the `parking_lot` crate's implementations of `std::sync::Mutex` and `std::sync::RwLock`, which are more efficient. A writeup on why `parking_lot` is more efficient can be read here: <https://github.com/Amanieu/parking_lot> Upgrade path: Modify `mutex.lock().unwrap()` usage to `mutex.lock()` (not needing to unwrap or handle a result), and `rwlock.read().unwrap()`/`rwlock.write().unwrap()` usage to `rwlock.read()` and `rwlock.write()`. For example, modify: ```rust use serenity::CACHE; println!("{}", CACHE.read().unwrap().user.id); ``` to: ```rust use serenity::CACHE; println!("{}", CACHE.read().user.id); ```
* Implement categoriesacdenisSK2017-09-091-0/+2
|
* rustfmtacdenisSK2017-07-271-21/+21
|
* Apply the new api change for dms in botsacdenisSK2017-07-071-3/+3
|
* Add an `is_new` to the arguments of the `guild_create` handleracdenisSK2017-07-051-1/+3
| | | | To make a better distinction from a guild that the bot's already in and from the ones it's joining
* Whoops, and add a fail-safe to an upcomming pr to the compileracdenisSK2017-06-281-47/+47
| | | | https://github.com/rust-lang/rust/pull/42894
* Merge branch "trait-based-event-handling"acdenisSK2017-06-281-0/+77