aboutsummaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorZeyla Hellyer <[email protected]>2018-04-27 08:05:56 -0700
committerKen Swenson <[email protected]>2018-11-06 20:35:51 -0500
commit3e54f4c524ad609b31c061286eab971f0084a4c5 (patch)
tree907334e8b8a2823696f2b96456aca062f3d00a40 /tests
parentMake builders mutably borrowed (diff)
downloadserenity-3e54f4c524ad609b31c061286eab971f0084a4c5.tar.xz
serenity-3e54f4c524ad609b31c061286eab971f0084a4c5.zip
Add Rich Presence parsing support
Adds support for parsing Rich Presences. This can not be used for setting activities with bots. Upgrade path: Basically change your import and usage from `serenity::model::gateway::Game` to `serenity::model::gateway::Activity`.
Diffstat (limited to 'tests')
-rw-r--r--tests/resources/activity_1.json (renamed from tests/resources/game_1.json)0
-rw-r--r--tests/resources/activity_2.json26
-rw-r--r--tests/test_deser.rs13
3 files changed, 33 insertions, 6 deletions
diff --git a/tests/resources/game_1.json b/tests/resources/activity_1.json
index 4e8a4b4..4e8a4b4 100644
--- a/tests/resources/game_1.json
+++ b/tests/resources/activity_1.json
diff --git a/tests/resources/activity_2.json b/tests/resources/activity_2.json
new file mode 100644
index 0000000..12b0d4f
--- /dev/null
+++ b/tests/resources/activity_2.json
@@ -0,0 +1,26 @@
+{
+ "user": {
+ "id": "210141176211177474"
+ },
+ "status": "idle",
+ "game": {
+ "type": 2,
+ "timestamps": {
+ "start": 1524840854122,
+ "end": 1524841056674
+ },
+ "sync_id": "3MzqPLieWzTj5NW6WEzICu",
+ "state": "I Fight Dragons",
+ "session_id": "f737b052de95d8199723b92c1457463e",
+ "party": {
+ "id": "spotify:210141176211177474"
+ },
+ "name": "Spotify",
+ "flags": 48,
+ "details": "Pretend",
+ "assets": {
+ "large_text": "The Near Future",
+ "large_image": "spotify:a253f70af71e454b1021f8323357f6f983d622ed"
+ }
+ }
+}
diff --git a/tests/test_deser.rs b/tests/test_deser.rs
index 72c955d..dde1ff6 100644
--- a/tests/test_deser.rs
+++ b/tests/test_deser.rs
@@ -16,6 +16,13 @@ macro_rules! p {
}};
}
+// An activity with null type.
+#[test]
+fn activity() {
+ p!(Activity, "activity_1");
+ p!(Activity, "activity_2");
+}
+
#[test]
fn channel_create() {
p!(ChannelCreateEvent, "channel_create_1");
@@ -41,12 +48,6 @@ fn emoji_animated() {
p!(Emoji, "emoji_animated");
}
-// A game with null type.
-#[test]
-fn game() {
- p!(Game, "game_1");
-}
-
#[test]
fn guild_ban_add() {
p!(GuildBanAddEvent, "guild_ban_add_1");