aboutsummaryrefslogtreecommitdiff
path: root/src/utils/message_builder.rs
Commit message (Collapse)AuthorAgeFilesLines
* Add newline in MessageBuilder::push_codeblock_safeZeyla Hellyer2018-08-301-5/+7
| | | | | | | | | | | | | | | | | | | | | | | MessageBuilder::push_codeblock_safe did not add a newline after the language or code fence, resulting in an output like: ```code here``` or: ```rustcode here``` This commit fixes that, and makes the equivalent outputs: ``` code here``` and: ```rust code here``` Closes #374.
* Add more unit tests for MessageBuilderZeyla Hellyer2018-08-301-0/+205
|
* Move unit tests into sourceZeyla Hellyer2018-08-011-0/+78
| | | | | | | | | Move the unit tests into the relevant source files. There's no need for them to be seprate, especially when the `tests` directory is meant to be for integration tests. The deserialization tests that include JSON files are still in the `tests` dir, along with the public prelude re-export tests.
* Fix some clippy lintsZeyla Hellyer2018-07-151-3/+3
| | | | | Some lints were not resolved due to causing API changes. Most lints in the framework were left unfixed.
* Monomorphize all functionsZeyla Hellyer2018-07-041-4/+14
| | | | | | | | | | | | | | | | | | | | | | | | | | | This commit monomorphizes all functions, turning functions like: ```rust fn foo<T: Into<Bar>>(baz: T) { baz = baz.into(); // function here } ``` Into functions like: ```rust fn foo<T: Into<Bar>>(baz: T) { _foo(baz.into()) } fn _foo(baz: Bar) { // function here } ``` This avoids binary bloat and improves build times, by reducing the amount of code duplication.
* Fix dead link.Lakelezz2018-04-201-1/+1
|
* Refactor imports/exports to use nested groups and better formattingacdenisSK2018-03-291-6/+10
|
* Fix broken docs links caused by model mod changesZeyla Hellyer2018-01-311-11/+11
| | | | | Fix broken links caused by the `model` module changes in v0.5.0, which split up the module into sub-modules for better organization.
* Add `animated` to `Emoji` and `ReactionType`Zeyla Hellyer2017-12-201-0/+2
| | | | | | | | | | Adds an animated structfield to `Emoji` and `ReactionType`'s `Custom` variant, which defaults to false if not present. A test has been added for deserializing it, taken from a REST API GET Emojis response. (cherry picked from commit 5286949f424e824784344ebb7b7af4e52fb819c3)
* Fix doc-tests and `single_zc`acdenisSK2017-12-171-3/+3
|
* Fix most clippy lints, take more refeerncesZeyla Hellyer2017-12-161-2/+2
| | | | | Fix clippy lints and subsequently accept references for more function parameters.
* Break up the model moduleZeyla Hellyer2017-12-161-5/+8
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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}; ```
* Use `ToString`'s blanket impl for `Display`sacdenisSK2017-11-271-1/+1
|
* Re-order use statements alphabeticallyZeyla Hellyer2017-11-111-1/+1
|
* Add Debug derives to more public typesthelearnerofcode2017-11-071-5/+5
|
* Force `I` to be not implemented outside serenityacdenisSK2017-10-091-3/+15
|
* Revert "Use the de-generification trick."acdenisSK2017-10-091-18/+6
| | | | Makes the compiliation time just a bit worse
* Use the de-generification trick.acdenisSK2017-10-091-6/+18
| | | | Fixes #168
* `to_owned` -> `to_string`acdenisSK2017-10-091-2/+2
|
* Apply rustfmtZeyla Hellyer2017-09-181-2/+5
|
* Add ability to play DCA and Opus files. (#148)Maiddog2017-08-271-5/+2
|
* Revamp `RwLock` usage in the libacdenisSK2017-08-241-2/+5
| | | | Also not quite sure if they goofed rustfmt or something, but its changes it did were a bit bizarre.
* Apply rustfmtZeyla Hellyer2017-08-181-15/+12
|
* Remove the `I` bound for the language param and fix `push_mono_safe`acdenisSK2017-08-081-5/+5
|
* Fix the test `message_content_safe`acdenisSK2017-08-061-67/+78
| | | | This commit does NOT interfere with the "accept Display" change to the builder
* >.>acdenisSK2017-08-051-1/+1
|
* Refactor the display stuff a bitacdenisSK2017-08-041-53/+16
|
* Make so content and language can be of different typesacdenisSK2017-08-041-2/+2
|
* Also make the message builder use DisplayacdenisSK2017-08-041-53/+119
|
* Fix failing tests (#133)Andrej2017-07-311-2/+3
|
* Remove a few clonesacdenisSK2017-07-291-8/+6
|
* rustfmtacdenisSK2017-07-271-30/+20
|
* Add Content for MessageBuilderSkye2017-05-301-9/+194
| | | Allow `push` and `push_safe` to use a flexible syntax for formatting.
* Add _line + _line_safe methods to MessageBuilderMaiddog2017-05-281-0/+250
| | | | | | Add new methods to MessageBuilder to push content similar to the other methods, except with the addition of appending a newline afterwards. This should help prettify some MessageBuilder usage.
* Add more examples and improve some othersZeyla Hellyer2017-05-231-13/+195
| | | | | Add examples to some functions, and update some of the old examples to use the `?` operator instead of unwrapping.
* Reasonably derive Debug on itemsZeyla Hellyer2017-05-221-6/+1
|
* Stop abusing unicode for sanitisationIllia2017-01-111-6/+6
|
* Use zero-width space for mention preventionIllia2017-01-111-13/+13
|
* Fix typoIllia2016-12-311-1/+1
|
* Make Id displays format u64 instead of a mentionAustin Hellyer2016-12-171-3/+3
| | | | | | Instead of mentioning the channel, role, or user on an Id display format, format its inner u64 instead. Instead, use `Id::mention()` to accomplish the equivilant.
* Re-order message builder fileAustin Hellyer2016-11-281-22/+21
|
* Fix some clippy lintsAustin Hellyer2016-11-281-7/+7
|
* Improve docs and add new message builder methodsIllia K2016-11-281-6/+165
| | | | | Add documentation for some missing methods - such as Game methods - and add more methods to the Message Builder.
* Add a bit more docsAustin Hellyer2016-11-261-1/+0
|
* Rename PublicChannel to GuildChannelAustin Hellyer2016-11-251-2/+2
|
* A bit of docsAustin Hellyer2016-11-181-8/+69
|
* Add some more documentationAustin Hellyer2016-11-061-1/+3
|
* Convert all doc anchors to named anchorsAustin Hellyer2016-11-051-2/+3
| | | | | | | | | | | | | | | | | | | | Convert all of the non-named anchors in docs to named anchors. Example: ```md Kicks a [`Member`](../model/struct.Member.html) from the specified [`Guild`](../model/struct.Guild.html) if they are in it. ``` is now written as: ```md Kicks a [`Member`] from the specified [`Guild`] if they are in it. [`Guild`]: ../model/struct.Guild.html [`Member`]: ../model/struct.Member.html ```
* Initial commitAustin Hellyer2016-10-181-0/+97