Commit Graph

401 Commits

Author SHA1 Message Date
kozabrada123 d2b5fb7d72 Add GuildScheduledEvent Events (pt 2) 2023-05-22 16:46:49 +02:00
kozabrada123 e54ad258f8 Add GuildScheduledEvent Events 2023-05-22 16:43:06 +02:00
kozabrada123 5dec2dbf36 Remove unused 2023-05-22 15:57:37 +02:00
kozabrada123 73a9e5b0fc Merge branch 'main' 2023-05-22 13:30:19 +02:00
bitfl0wer 5af2216882 move integration test from guild to integration.rs 2023-05-21 16:02:54 +02:00
bitfl0wer 5e5be4a9b4 Add delete() to User 2023-05-21 15:05:02 +02:00
bitfl0wer 8aa4dea9c4 Fix 'already borrowed: BorrowMutError' 2023-05-20 23:21:24 +02:00
bitfl0wer 8a1c1f0a41 Replace &mut Instance with Rc<RefCell<Instance>>
Replace &mut Instance with Rc<RefCell<Instance>> on the User struct to represent the 1:n relation of Instance:User
2023-05-20 23:10:25 +02:00
kozabrada123 ed144e723d Add Guild Audit Log Entry Create 2023-05-20 13:03:44 +02:00
kozabrada123 6ceaee4f14 Add Invite Create & Delete 2023-05-20 12:50:05 +02:00
kozabrada123 b207521bbd Add Passive Update V1 2023-05-20 09:35:48 +02:00
kozabrada123 1a98e7db6b Duplicate VoiceState 2023-05-20 08:59:14 +02:00
kozabrada123 50fb208023 Update dependencies, deserialize errors 2023-05-20 08:39:02 +02:00
kozabrada123 2bc24ed949 Merge pull request #60 from polyphony-chat/main
Rebase feature/fgc
2023-05-20 08:37:34 +02:00
kozabrada123 f33411e6c3 Solve deserialization problem semi optimally 2023-05-17 18:16:47 +02:00
kozabrada123 ae06991be6 Revert "Deserialize from String" (Ugh)
This reverts commit 79eb3e3b30.

If course I can't just do that, ugh
Keeping the formatting would require using RawValue, but as we use one struct for sending an recieving, having to make RawValue to send would be pretty dumb
2023-05-17 17:24:29 +02:00
kozabrada123 79eb3e3b30 Deserialize from String instead of Value 2023-05-17 17:03:03 +02:00
kozabrada123 57dd0978dd Some minor changes 2023-05-17 16:24:04 +02:00
bitfl0wer 376ae83f58 Implement modify(), untested as of now 2023-05-16 15:59:23 +02:00
bitfl0wer 29318e9085 Add UserModifySchema 2023-05-16 15:59:06 +02:00
bitfl0wer a1397cf46f Add PasswordRequiredError 2023-05-16 15:58:51 +02:00
bitfl0wer fbd9170806 Start working on User::modify(). 2023-05-15 23:20:23 +02:00
kozabrada123 2b4786b4bb Fix spelling mistake, add minor docs 2023-05-15 20:54:16 +02:00
kozabrada123 a977d97684 Fix some deser errors, add CHANNEL_UNREAD_UPDATE 2023-05-15 20:45:33 +02:00
kozabrada123 32d160db64 Merge pull request #58 from polyphony-chat/main
Bring full-gateway-coverage up to date from main
2023-05-15 12:42:06 +00:00
bitfl0wer aaa16ef532 remove accidental doctests 2023-05-14 22:47:34 +02:00
bitfl0wer e552bdb352 make fields on GuildCreateSchema pub 2023-05-14 22:45:55 +02:00
bitfl0wer b4cc8fd64b add type guildcreateresponse 2023-05-14 22:45:42 +02:00
bitfl0wer fbfd0e627f Remove unused import 2023-05-14 22:45:31 +02:00
bitfl0wer 120cdfd14f Change function signatures, add tests 2023-05-14 22:45:18 +02:00
kozabrada123 7e6507c206 Fix some gateway deserialization errors 2023-05-14 19:55:43 +02:00
kozabrada123 fcbca459dc Add some Guild, Integration and Webhook events 2023-05-14 15:55:20 +02:00
kozabrada123 0173ca9e62 Add session, guild event types 2023-05-14 15:37:30 +02:00
bitfl0wer 833c3733d7 Add guild delete route 2023-05-14 14:16:21 +02:00
kozabrada123 1b0456c5c3 Merge branch 'feature/full-gateway-coverage' into feature/rest-of-discord-types 2023-05-14 12:05:26 +00:00
kozabrada123 2ff5e4fd9d Add Readies to Events, try to fix msg_create error 2023-05-14 14:03:18 +02:00
bitfl0wer d797a10009 Add RateLimit information 2023-05-14 13:12:02 +02:00
bitfl0wer 4b4adbe1cc impl ToString for LimitType 2023-05-14 13:11:50 +02:00
bitfl0wer 598ad093a1 Improve error handling on request sending 2023-05-14 13:07:46 +02:00
bitfl0wer d5103ea03f Merge branch 'feature/rest-of-discord-types' into feature/guild-creation-deletion 2023-05-14 12:55:39 +02:00
bitfl0wer 9b1a7f9bd8 Remove duplicate VoiceState 2023-05-14 12:55:19 +02:00
bitfl0wer bb546cdc82 Merge branch 'feature/rest-of-discord-types' into feature/guild-creation-deletion 2023-05-14 12:52:25 +02:00
bitfl0wer 2072ae11a5 Add full Guild type 2023-05-14 12:40:31 +02:00
kozabrada123 2209d967cd Flatten, new events 2023-05-14 11:43:17 +02:00
kozabrada123 40b459b974 Add call update and delete 2023-05-14 08:39:23 +02:00
kozabrada123 262cd0e780 Add more events, fix deserialization errors 2023-05-14 08:20:25 +02:00
bitfl0wer 51ecf888b8 remove get() 2023-05-13 23:45:49 +02:00
bitfl0wer 3fca30db35 start implementing get() 2023-05-13 23:15:28 +02:00
bitfl0wer ea454228ac Add documentation 2023-05-13 22:55:17 +02:00
bitfl0wer 1934622e4c Implement Guild::create() 2023-05-13 22:14:53 +02:00
bitfl0wer e0a45edb3c Add GuildCreateSchema as per Spacebar Docs 2023-05-13 22:11:06 +02:00
bitfl0wer 5031db6547 Update docs, remove panic in favor of Err Result 2023-05-13 22:10:46 +02:00
bitfl0wer c436fdb857 Remove panic on send_request error 2023-05-13 22:06:44 +02:00
kozabrada123 a93962b667 Add Stage Instance and Voice State 2023-05-13 22:01:04 +02:00
kozabrada123 4e51d1251b Add integrations 2023-05-13 21:50:36 +02:00
bitfl0wer ca8f94c18e create src/api/guilds/guilds.rs 2023-05-13 21:42:43 +02:00
kozabrada123 0c3e99057f Add channel and thread types, start guild 2023-05-13 21:27:44 +02:00
kozabrada123 e3a5a532c3 Merge branch 'polyphony-chat:main' into main 2023-05-13 14:49:53 +00:00
kozabrada123 a3969e8cb6 Small changes for merging 2023-05-13 16:43:29 +02:00
bitfl0wer 3c6a549db7 Fix tests 2023-05-13 16:42:24 +02:00
bitfl0wer 092eed6957 update file to one that always exists, fix test 2023-05-13 16:40:34 +02:00
bitfl0wer c74e40e5f9 comment out view_nsfw_guilds to fix tests 2023-05-13 16:36:28 +02:00
kozabrada123 9a80f68787 Warnings 2023-05-13 16:35:42 +02:00
kozabrada123 4765b7a362 WebSocketConnection are no longer used 2023-05-13 16:34:05 +02:00
kozabrada123 41b75be2fb Add a few more gateway events 2023-05-13 16:24:34 +02:00
kozabrada123 11d371eee2 Add rest of send events 2023-05-13 15:59:46 +02:00
kozabrada123 595716afc5 Small unit test update 2023-05-13 15:36:29 +02:00
kozabrada123 bcb97977f7 Remove terrible debug messages 2023-05-13 09:54:23 +02:00
kozabrada123 959bbac9bd Fix nested task issues 2023-05-13 09:47:12 +02:00
kozabrada123 cef8fe9fdb Deserialization error.. 2023-05-13 09:05:20 +02:00
kozabrada123 28e956e969 Merge branch 'polyphony-chat:main' into main 2023-05-13 06:11:07 +00:00
bitfl0wer 4abe3d87ec Change visibility of attachments 2023-05-12 19:18:51 +02:00
bitfl0wer ec37e89cc4 add set_id() to FileAttachment
This is so that the id of the Attachment to be sent can just be overwritten by the send() method.
2023-05-12 19:18:40 +02:00
bitfl0wer 1d2ebdd3cd Make attachment sending work! 2023-05-12 19:18:00 +02:00
kozabrada123 94fabbffb0 Merge branch 'polyphony-chat:main' into main 2023-05-12 11:41:53 +00:00
bitfl0wer 32f337015a cargo fix 2023-05-12 12:35:06 +02:00
bitfl0wer 56be2c9a17 Change send to no longer take static refs 2023-05-12 12:34:27 +02:00
bitfl0wer 9fd3f733f7 Mark unused var as unused 2023-05-12 12:34:00 +02:00
bitfl0wer 6732640f96 impl PartialDiscordFileAttachment
Now contains move_$ methods, which can move individual values out of the PartialDiscordFileAttachment while preserving the rest of the object.
2023-05-12 12:33:39 +02:00
bitfl0wer c544bd409d work on implementing message attachment sending 2023-05-11 23:35:36 +02:00
kozabrada123 6dfaa6e91f Attempted reimpl 2023-05-11 22:47:31 +02:00
bitfl0wer ce46452a2f change message send impl 2023-05-11 22:36:35 +02:00
bitfl0wer a2819c13f0 add a todo so i dont forget to not eat all ram 2023-05-11 00:07:45 +02:00
bitfl0wer fe63d11055 cool i have written a memory hog 2023-05-11 00:06:13 +02:00
bitfl0wer 7387053998 Change imports 2023-05-10 18:44:17 +02:00
bitfl0wer 5a7d5e0a4c Change register test 2023-05-10 18:44:10 +02:00
kozabrada123 6ce7396275 Merge branch 'feature/gateway-observer' into main 2023-05-09 18:35:53 +00:00
bitfl0wer 3011b1164f Change test_registration 2023-05-09 19:30:52 +02:00
bitfl0wer 1bc8081655 Make register and login return UserObject 2023-05-09 17:19:41 +02:00
bitfl0wer e6291bf384 Extend UserObject to match with Spacebars' User 2023-05-09 17:19:23 +02:00
bitfl0wer aaf454ffa7 remove println 2023-05-09 17:19:04 +02:00
bitfl0wer a7514a28c6 impl get_settings() 2023-05-09 14:05:36 +02:00
bitfl0wer f06b43a8fe Make register and login return User 2023-05-09 14:05:03 +02:00
bitfl0wer b199d11889 Made modules public, removed 110 warnings 2023-05-09 14:04:46 +02:00
bitfl0wer c073d6be54 Removed empty lines of code 2023-05-09 14:04:34 +02:00
bitfl0wer f59f705ec0 make token pub 2023-05-09 13:10:07 +02:00
kozabrada123 fa05680552 Less spam debug log 2023-05-07 12:44:11 +02:00
bitfl0wer 40b7064541 Remove logged_in from User 2023-05-07 12:42:52 +02:00
bitfl0wer 31407c1bf1 Run clippy 2023-05-07 12:41:14 +02:00
bitfl0wer 6a94d34bb5 Remove unneccessary imports 2023-05-07 12:39:56 +02:00
bitfl0wer 240882ffdf Remove lifetime from Instance (see below)
Originally, it was planned, that the Instance object would store Users. I have identified, that this was not needed, as it goes beyond the scope of a library; Users of this library are expected to keep track of users themselves. The removal of this user storage also prevented further overcomplications.
2023-05-07 12:39:04 +02:00
kozabrada123 e67acfab49 Was still a merge conflict there 2023-05-07 12:05:58 +02:00
kozabrada123 0fd7be51a8 Fix merge conflict 2023-05-07 12:04:46 +02:00
kozabrada123 b4888d2f70 Rethink websockets, fix thread blocks 2023-05-07 11:58:12 +02:00
bitfl0wer 7904b3d9f8 add docs, add instance.get_user() 2023-05-07 11:54:49 +02:00
kozabrada123 fc93762cf7 Fix deserialization error 2023-05-07 11:47:12 +02:00
bitfl0wer 3cd19ed15e Remove display impl, add default trait 2023-05-07 11:32:25 +02:00
bitfl0wer fafc864dfe Impl user::get() function 2023-05-07 11:32:11 +02:00
bitfl0wer df850b33d5 add test fn 2023-05-07 00:18:21 +02:00
bitfl0wer 3e6e8b7812 add users to mod.rs 2023-05-07 00:18:14 +02:00
bitfl0wer 45d5505e2c remove nesting layer 2023-05-07 00:18:06 +02:00
bitfl0wer 70a426c754 Add users to mod.rs 2023-05-07 00:17:54 +02:00
bitfl0wer 7211ff5eb3 add pronouns 2023-05-06 22:47:31 +02:00
bitfl0wer aa89168928 add mod.rs 2023-05-06 22:47:26 +02:00
bitfl0wer 7920dc62e6 Implement message sending (without attachments) 2023-05-06 22:24:23 +02:00
bitfl0wer 9855465fe4 change visibilities 2023-05-06 22:23:48 +02:00
bitfl0wer 4aaaee3e1e impl SendMessageSchema 2023-05-06 22:23:34 +02:00
bitfl0wer f943f57f03 rename user rate_limits to limits for consistency 2023-05-06 18:52:24 +02:00
bitfl0wer 0efdc8bfc2 Construct new message send method basics 2023-05-06 18:52:09 +02:00
bitfl0wer 63ece12636 change message to messagesendschema 2023-05-06 18:34:38 +02:00
kozabrada123 9f187b8864 Add a debug to heartbeat thread 2023-05-06 11:14:38 +02:00
kozabrada123 7d3077eec4 Pub mod everything so it can be used as a library 2023-05-06 11:13:07 +02:00
kozabrada123 172c000813 Update Websocket to fix premature closing w 1006 2023-05-06 10:39:58 +02:00
kozabrada123 6fdff97722 Update types to fix deserialization errors 2023-05-06 10:39:16 +02:00
kozabrada123 7dbdcf828d Slight code cleanup 2023-05-06 08:39:41 +02:00
kozabrada123 a4fdf18106 Fixed instance lifetime parameter 2023-05-05 22:46:00 +02:00
kozabrada123 22bfe1be07 Readd gateway to instance 2023-05-05 22:04:57 +02:00
bitfl0wer 00aa998ad0 remove redundant code 2023-05-05 22:00:37 +02:00
bitfl0wer e41563b101 start re-doing send() 2023-05-05 21:53:23 +02:00
bitfl0wer 9b5caf6392 Add DiscordFileAttachment, change visibilities 2023-05-05 21:53:00 +02:00
bitfl0wer abd555dfac Add MessageSendSchema 2023-05-05 21:52:27 +02:00
kozabrada123 7ac4da8482 Fix encoding wrong 2023-05-05 20:58:00 +02:00
kozabrada123 ab4c20562c Remove the dumb test stuff I left in 2023-05-05 20:28:47 +02:00
kozabrada123 47c38c5541 Give websocket a send and receive channel 2023-05-05 20:26:51 +02:00
kozabrada123 6a99129fe7 Add temp debug, remove unused token 2023-05-05 19:42:31 +02:00
kozabrada123 f6c9d5a807 Experimental sending to gateway 2023-05-05 19:23:57 +02:00
kozabrada123 85d79bb304 Experimental heartbeats 2023-05-05 18:38:04 +02:00
kozabrada123 23472d01d9 Update integers on some types 2023-05-05 18:37:52 +02:00
kozabrada123 ec2030794d Add gateway Ready event 2023-05-05 16:08:12 +02:00
kozabrada123 2dda6f767e Update data for existing events 2023-05-05 15:46:45 +02:00
kozabrada123 28f3312cac No need to serialize this 2023-05-05 15:39:11 +02:00
bitfl0wer a706341e36 handle attachment-messages seperately 2023-05-05 14:38:37 +02:00
bitfl0wer e4be9d49c2 change name type from String to i16 2023-05-05 14:38:22 +02:00
bitfl0wer 65480d51e6 Fix counter not being incremented 2023-05-05 14:19:38 +02:00
bitfl0wer 12c6efc72e Change HashMap to Map
Filenames can be non-unique, which could not be accurately represented using a HashMap.
2023-05-05 14:18:59 +02:00
bitfl0wer c90e8b62e8 Add new() DiscordFileAttachment 2023-05-05 14:16:09 +02:00
bitfl0wer d1f44aace3 Rename File to DiscordFileAttachment, work on that 2023-05-04 23:00:48 +02:00
kozabrada123 0ff3a21423 Add basic event receiving 2023-05-04 20:57:45 +02:00
kozabrada123 284073deeb Add WebSocketConnection to Gateway 2023-05-04 20:05:33 +02:00
bitfl0wer 28778f578f Add bearer auth for message sending 2023-05-03 23:13:12 +02:00