Commit Graph

72 Commits

Author SHA1 Message Date
Luna b0eb3247fd remove code from dispatcher
leftovers are TBD.

 - constrict Dispatcher.dispatch() to arity 3
 - add helper methods to Dispatcher
 - add EventType to Dispatcher

While fixing things, it was discovered that many of the things inside
LazyGuildDispatcher were just interfaces to GuildMemberList, in a very
weird way, just so it could be fitted inside the main Dispatcher. it was
decided to remove those unecessary interfaces, clients shall use the
manager directly.
2020-02-09 21:20:08 +00:00
Luna e0e59f8b63 fix types (big)
varied fixes across many, many files.
2020-02-06 21:10:51 +00:00
Luna e42aadb6d0 migration.command: dont split on migration 0
(it's a hack)
2020-02-04 20:50:40 +00:00
Luna a76460bea1 varied fixes due to sed fuckups 2020-01-06 22:55:20 -03:00
Luna 3481165bc5 everything: use winter 2020-01-06 21:38:29 -03:00
Luna ffa244173c messages: remove double import 2019-10-25 13:41:11 -03:00
Luna 2ebb94f476 messages: use common/utils functions 2019-10-25 13:36:02 -03:00
Luna a67b6580ba make other blueprints use common, etc 2019-10-25 13:33:52 -03:00
Luna 1efc65511c create litecord.common 2019-10-25 13:31:47 -03:00
Luna 2024c4bdf8 remove app parameters from embed functions 2019-10-25 10:40:26 -03:00
Luna 83a1c1ae29 black fmt pass 2019-10-25 07:27:50 -03:00
Luna fa1151c759 fix spawn_embed's app and remove where clauses for conflict row 2019-07-23 16:22:38 -03:00
Luna 39fd7577b8 channel.messages: add checks for Embed Links permission 2019-07-23 14:52:26 -03:00
Luna e68f212c9e channel.messages: simplify data.get call 2019-04-04 12:53:40 -03:00
Luna a93090ddbc handle nullable embeds when creating messages
somehow discordcr does that..
2019-04-04 12:52:41 -03:00
Luna 15fa2f3231 channel.messages: add foreign key deletions before message delete
- images: export try_unlink, and allow it to handle pathlib.Path
2019-03-23 21:19:30 -03:00
Luna 02c6741d74 webhooks: "finish" execution impl
it can do messages. but many things are still missing.

 - channel.messages: export msg_guild_text_mentions
 - storage: revamp Storage._inject_author
 - schema.sql: remove messages.webhook_id, add message_webhook_info
    table
 - add 16_messages_webhooks.sql migration
2019-03-18 22:47:59 -03:00
Luna 712f1d9ff2 webhooks: add drafts for execution impl
- channel.messages: export msg_create_request,
    msg_create_check_payload, msg_add_attachment
 - schemas: add WEBHOOK_MESSAGE_CREATE
2019-03-18 04:35:44 -03:00
Luna 7b4aaabcbf storage: better fix for message.webhook_id
the old fix only works for the return value in message create, where as
it should be in Storage.get_message instead so that the bug doesn't
happen to the other routes
2019-03-05 16:30:38 -03:00
Luna 67ae2385b5 Merge branch 'master' into voice 2019-03-05 16:27:31 -03:00
Luna 9dab5b20ae typing, episode 2 2019-03-04 15:48:51 -03:00
Luna d91030a2c1 typings, episode 1
(i installed mypy and its beautiful)
2019-03-04 05:09:04 -03:00
gabixdev a7dc9e01dc
Embed fixes 2019-03-01 21:08:58 +01:00
Luna f4f4a64e9f split process_url_embed into litecord.embed.message 2019-02-22 18:57:10 -03:00
Luna d9283c92df channel.messages: parse payload_json when creating message 2019-02-19 18:43:23 -03:00
Luna 56673f182a channel.messages: call process_url_embed on message updates 2019-02-05 17:41:42 -03:00
Luna f7ee9c70ae channel.messages: remove print-debug 2019-02-05 17:33:37 -03:00
Luna 9b76c472d0 embed.sanitizer: add log warn
- channel.messages: handle meta being None
 - schemas: add gift_code_sku_id
2019-02-01 20:57:12 -03:00
Luna 53d7515f8c all: update copyright year 2019-01-26 19:25:46 -03:00
Luna 307a22e135 channel.pins: deny pins from system messages
suggested by @Cynosphere
2019-01-25 19:40:56 -03:00
Luna d093e9c1ce channel.messages: remove unused import 2018-12-09 00:10:06 -03:00
Luna a8704f8176 attachments: add attachment fetch impl
- channel.messages: fix width/height switching
2018-12-08 23:59:45 -03:00
Luna 7e17b6965e channel.message: fix issues related to file stream
- storage: remove mime fetch
2018-12-08 23:49:46 -03:00
Luna 6c992588e9 channel.messages: fix insertion into attachments table
- channel.messages: add file write
 - images: make get_ext and get_mime public functions
 - storage: receive app instance instead of db
2018-12-08 23:38:52 -03:00
Luna 9ec8577b7f blueprints: add dummy attachment blueprint
- storage: add message attachment fetching (not working)
2018-12-08 23:12:43 -03:00
Luna ec062f75a8 channel.messages: add dummy implementation for attachment support 2018-12-08 23:01:07 -03:00
Luna 2632d033fa all: add GPL header 2018-12-07 02:14:58 -03:00
Luna 6defce0f9e channel.dm_checks: add friend check override
- user_storage: add UserStorage.are_friends_with
2018-12-06 17:09:40 -03:00
Luna d7bb5f9804 channel.dm_checks: add restricted_guilds checking 2018-12-06 16:47:21 -03:00
Luna 7e425229f9 channel: add dm_checks module
- channel.messages: check block state before message send
2018-12-05 23:41:08 -03:00
Luna 060f225189 channel.messages: add url autoembeds
related to #27

 - embed.sanitizer: handle external config and session objects
 - storage: add Storage.execute_with_json
2018-12-05 19:07:43 -03:00
Luna 75a7c4d83a channel.messages: use fill_embed
- embed.sanitizer: fix fetching of keys in app.config
2018-12-05 02:55:09 -03:00
Luna 5db633b797 channel.messages: use sanitize_embed
- embed: add sanitizer module
 - embed.schemas: add to_json to EmbedURL
 - utils: add custom JSON encoder
 - run: use custom JSON encoder
 - gateway.websocket: use custom JSON encoder
2018-12-04 21:45:14 -03:00
Luna 94fe51ac69 channel.messages: add embed insertion
- storage: move pg_set_json to litecord.utils to fix circular imports
 - storage: add embed fetch to get_message
 - embed.schemas: fix author.url's url
 - schemas: add EMBED_OBJECT to MESSAGE_CREATE
2018-12-04 18:37:42 -03:00
Luna 8b97195404 litecord: add embed namespace
- embed: add embed.schemas
 - channel.messages: split some functions for readability
2018-12-04 18:10:58 -03:00
Luna Mendes 2adc88e9e4 litecord: add system_messages module
- channel.pins: send a CHANNEL_PINNED_MESSAGE system message
2018-11-22 17:08:28 -03:00
Luna Mendes 7aff586790 channel.pins: use timestamp_ instead of .isoformat 2018-11-22 16:25:26 -03:00
Luna Mendes d376cb4fad channel.pins: change dispatch guild -> dispatch channel
this should fix pins in dms
2018-11-22 16:23:51 -03:00
Luna Mendes 50d177e04d channel.messages: fix possible bugs in extract_limit 2018-11-21 21:03:04 -03:00
Luna Mendes 4580aed97c channel.messages: simplify delete_message's check 2018-11-21 21:01:56 -03:00