aboutsummaryrefslogtreecommitdiff
path: root/src/model/permissions.rs
Commit message (Collapse)AuthorAgeFilesLines
* A bunch of typo fixes (#404)Perry Fraser2018-10-011-1/+1
|
* Fix all the dead links in the docsErk-2018-08-091-12/+12
|
* Fixes all of the dead links in permissions. (#359)Erk-2018-08-071-75/+75
|
* Added support for the new PRIORITY_SPEAKER permission (#360)Erk-2018-08-071-0/+8
|
* Change the way ids and some enums are made (#295)Leah2018-03-231-39/+45
| | | | | This makes them easier to be found by tools like rls. Also update struct inits to use the shorthand version for `x: x`.
* Implement or derive Serialize on all modelsZeyla Hellyer2018-01-011-20/+8
|
* Add the `VIEW_AUDIT_LOG` permission (#229)Lakelezz2017-12-041-0/+8
|
* Fix clippy lintsZeyla Hellyer2017-10-111-1/+1
|
* Update bitflags, other dependenciesZeyla Hellyer2017-09-211-28/+28
| | | | | | | | | | | | | | | | | | | | | | | Bitflags changed its macro codegen from creating constants to associated constants on structs. Upgrade path: Update code from: ```rust use serenity::model::permissions::{ADD_REACTIONS, MANAGE_MESSAGES}; foo(vec![ADD_REACTIONS, MANAGE_MESSAGES]); ``` to: ```rust use serenity::model::Permissions; foo(vec![Permissions::ADD_REACTIONS, Permissions::MANAGE_MESSAGES]); ```
* Fix the PRESET_GENERAL permission constantZeyla Hellyer2017-09-031-1/+1
| | | | | These bits were completely wrong and even gave the Administrator permission.
* Clippy lintsZeyla Hellyer2017-08-181-30/+30
|
* Change the config a bit, and a few nitpicksacdenisSK2017-07-271-1/+3
|
* rustfmtacdenisSK2017-07-271-97/+33
|
* Remove the deprecated functionsacdenisSK2017-07-111-27/+0
| | | | It's already been enough time for people to migrate
* Update dependenciesZeyla Hellyer2017-06-211-28/+28
|
* Fix broken docs links on Permissions structZeyla Hellyer2017-06-171-5/+5
|
* Restructure modulesZeyla Hellyer2017-05-221-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Modules are now separated into a fashion where the library can be used for most use cases, without needing to compile the rest. The core of serenity, with no features enabled, contains only the struct (model) definitions, constants, and prelude. Models do not have most functions compiled in, as that is separated into the `model` feature. The `client` module has been split into 3 modules: `client`, `gateway`, and `http`. `http` contains functions to interact with the REST API. `gateway` contains the Shard to interact with the gateway, requiring `http` for retrieving the gateway URL. `client` requires both of the other features and acts as an abstracted interface over both the gateway and REST APIs, handling the event loop. The `builder` module has been separated from `utils`, and can now be optionally compiled in. It and the `http` feature are required by the `model` feature due to a large number of methods requiring access to them. `utils` now contains a number of utilities, such as the Colour struct, the `MessageBuilder`, and mention parsing functions. Each of the original `ext` modules are still featured, with `cache` not requiring any feature to be enabled, `framework` requiring the `client`, `model`, and `utils`, and `voice` requiring `gateway`. In total the features and their requirements are: - `builder`: none - `cache`: none - `client`: `gateway`, `http` - `framework`: `client`, `model`, `utils` - `gateway`: `http` - `http`: none - `model`: `builder`, `http` - `utils`: none - `voice`: `gateway` The default features are `builder`, `cache`, `client`, `framework`, `gateway`, `model`, `http`, and `utils`. To help with forwards compatibility, modules have been re-exported from their original locations.
* Use constant for preset permissionsZeyla Hellyer2017-05-021-17/+41
| | | | | | | | Instead of having methods which return a preset value, use constants since the actual values are themselves constant. Deprecate the previous methods and move documentation to the new constants.
* Update most dependency version requirementsZeyla Hellyer2017-04-231-3/+3
| | | | | | | | Update the dependencies `base64`, `bitflags`, `byteorder`, `serde`, `serde_derive`, and `serde_json`. These dependencies have been updated, with byteorder and serde** hitting v1.0.0, so they should be updated for the v0.2.0 serenity release.
* Switch to using serde for deserializationZeyla Hellyer2017-04-111-6/+37
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The current build system is rudimentary, incomplete, and rigid, offering little in the way of customizing decoding options. To solve this, switch to using serde-derive with custom Deserialization implementations. This allows very simple deserialization when special logic does not need to be applied, yet allows us to implement our own deserialization logic when required. The problem with the build system was that it built enums and structs from YAML files. This is not so good, because it requires creating a custom build system (which was rudimentary), creating "special struct configs" when logic needed to be ever so slightly extended (rigid), and if special logic needed to be applied, a custom deserialization method would have been needed to be made anyway (incomplete). To solve this, switch to serde-derive and implementing Deserialize ourselves where required. This reduces YAML definitions that might look like: ```yaml --- name: Group description: > A group channel, potentially including other users, separate from a [`Guild`]. [`Guild`]: struct.Guild.html fields: - name: channel_id description: The Id of the group channel. from: id type: ChannelId - name: icon description: The optional icon of the group channel. optional: true type: string - name: last_message_id description: The Id of the last message sent. optional: true type: MessageId - name: last_pin_timestamp description: Timestamp of the latest pinned message. optional: true type: string - name: name description: The name of the group channel. optional: true type: string - name: owner_id description: The Id of the group channel creator. type: UserId - name: recipients description: Group channel's members. custom: decode_users t: UserId, Arc<RwLock<User>> type: hashmap ``` to: ```rs /// A group channel - potentially including other [`User`]s - separate from a /// [`Guild`]. /// /// [`Guild`]: struct.Guild.html /// [`User`]: struct.User.html pub struct Group { /// The Id of the group channel. #[serde(rename="id")] pub channel_id: ChannelId, /// The optional icon of the group channel. pub icon: Option<String>, /// The Id of the last message sent. pub last_message_id: Option<MessageId>, /// Timestamp of the latest pinned message. pub last_pin_timestamp: Option<String>, /// The name of the group channel. pub name: Option<String>, /// The Id of the group owner. pub owner_id: UserId, /// A map of the group's recipients. #[serde(deserialize_with="deserialize_users")] pub recipients: HashMap<UserId, Arc<RwLock<User>>>, } ``` This is much simpler and does not have as much boilerplate. There should not be any backwards incompatible changes other than the old, public - yet undocumented (and hidden from documentation) - decode methods being removed. Due to the nature of this commit, field names may be incorrect, and will need to be corrected as deserialization errors are found.
* Clippy lints + permission byte literalsZeyla Hellyer2017-04-091-27/+27
| | | | | Perform a number of various clippy lints, and rewrite the permissions values to use byte literals instead of bitshifts.
* Add slightly more documentationZeyla Hellyer2017-03-251-1/+9
|
* Remove the 'extras' feature flagAustin Hellyer2016-11-261-3/+0
| | | | | | There aren't many things behind this flag (6), and it only causes annoyances for locally-generated docs, which won't show these mostly-useful items behind the flag.
* Rename PublicChannel to GuildChannelAustin Hellyer2016-11-251-1/+1
|
* Rename guild structs to Guild and PartialGuildAustin Hellyer2016-11-241-1/+1
|
* Add state/framework/etc. conditional compile flagsAustin Hellyer2016-11-151-0/+3
| | | | | | | | | | | | | | | This adds conditional compilation for the following features, in addition to the voice conditional compilation flag: - extras (message builder) - framework - methods - state These 4 are enabled _by default_, while the `voice` feature flag is disabled. Disabling the state will allow incredibly low-memory bots.
* Add missing permission shorthandsAustin Hellyer2016-11-141-0/+16
|
* Add internal moduleAustin Hellyer2016-11-141-1/+1
| | | | | Create a general `internal` module, and move `prelude_internal` to `internal::prelude`.
* Add Manage Webhooks to permissions 2FA listAustin Hellyer2016-11-081-0/+2
|
* Add some more documentationAustin Hellyer2016-11-061-1/+1
|
* Add a prelude for userlandAustin Hellyer2016-11-051-1/+1
| | | | | | | Users can now import all of a prelude via `use serenity::prelude::*;`, which should provide some helpful stuff. As such, the internal prelude is now named `serenity::prelude_internal`, and all internal uses have been adjusted.
* Fix doc links to enum variantsAustin Hellyer2016-11-051-1/+1
| | | | | | Most of the docs were linking to `enum.EnumName.html#VariantName.v`, which should have been linking to `enum.EnumName.html#variant.VariantName`.
* Add message reactionsAustin Hellyer2016-11-051-6/+18
| | | | | | | | | | | | | | | | | | | | | | Add message reaction structs and an enum to differentiate between the two types of reactions, as well as event decoding and event handlers with dispatches. The following is, more or less, what is added: - `reactions` field to the `Message` struct; - `MessageReaction` struct, which is a consolidated form of reaction, containing the type of reaction, the number of them, and whether the current user has performed that type of reaction; - `Reaction`, a struct containing the information about a reaction - `ReactionType`, an enum to differentiate between the two types of reactions: `Custom` (a guild's custom emoji) and `Unicode` (twemoji); - Decoding for `MESSAGE_REACTION_ADD` and `MESSAGE_REACTION_REMOVE`; - Permission flag `ADD_REACTIONS`; - `Message::react` method; - Three `http` payload senders: `create_reaction`, `delete_reaction`, and `get_reaction_users`; - Three `Context` methods of equal names to the above.
* Initial commitAustin Hellyer2016-10-181-0/+446