Commit Graph

16 Commits

Author SHA1 Message Date
Luna Mendes de98d0f609 blueprints.guild: use EventDispatcher
- dispatcher: add sub_guild, unsub_guild, remove_guild, dispatch_guild
 - gateway.state_manager: fix fetch_states
 - gateway.websocket: add current_shard, shard_count to atributes
 - schema: add ON DELETE CASCADE to channel tables
2018-06-21 17:59:08 -03:00
Luna Mendes 183013f8f9 blueprints: add guilds blueprint
- gateway.websocket: merge get_guild and get_guild_extra
 - gateway.websocket: only apply too many shards close when
     guilds > 2500
 - storage: detach state usage
 - storage: fix large calc on get_guild_extra
2018-06-21 03:16:13 -03:00
Luna Mendes f5ea44c8d7 blueprints: add users.py blueprint
- errors: change AuthError to Unauthorized and Forbidden
 - auth: fix bug on token_check
 - storage: add Storage.get_user_guilds
2018-06-20 23:29:30 -03:00
Luna Mendes cb8ab6d836 gateway.websocket: remove comment about bots 2018-06-20 17:40:35 -03:00
Luna Mendes c477b2ed50 storage: add channel fetching logic
- litecord: add enums
 - storage: add get_user
 - storage: use column::text instead of str() in some cases
2018-06-20 17:39:21 -03:00
Luna Mendes 3eb6d5e60f litecord: add Storage
Storage serves as a way to reduce code repeatbility. So that we
don't need to keep repeating the same SQL statements over and over,
and to detach some SQL calls into their own code (like guild fetching)

 - gateway.websocket: add WebsocketObjects to hold db, state_manager,
    storage and loop

 - gateway.websocket: add _make_guild_list
 - schema: add members.deafened, members.muted
2018-06-20 16:53:22 -03:00
slice ab4857086a
migrate to logbook for logging 2018-06-19 18:04:17 -07:00
slice d1fad574c3
merge 2018-06-19 17:55:43 -07:00
slice 75c79a6503
add newline before constructor in classes
pep8
2018-06-19 17:55:12 -07:00
slice d41641929c
add ws stuff to example config 2018-06-19 17:52:25 -07:00
Luna Mendes 4de78a4e16 gateway.websocket: remove despacito 2018-06-19 21:46:57 -03:00
slice 7d64716487
tweak some logging calls 2018-06-19 17:46:44 -07:00
slice a6a4845778
fix NameError 2018-06-19 17:42:21 -07:00
Luna Mendes 6f0528eaec gateway.websocket: detach app object from GatewayWebsocket
It doesn't work since quart's objects only work with stuff
that is already from quart, e.g the current_app stuff
requires you to be inside a special hidden context
that only quart functions get.

Gateway code is detached from quart since quart's websocket
stuff can't handle custom error codes.

 - auth: optional db detach
 - gateway.errors: add InvalidShard, ShardingRequired
 - gateway.gateway: pass asyncpg connection and StateManager
 - gateway.state: add repr, etc
 - gateway.state_man: add remove(), fetch_states()
2018-06-19 21:05:26 -03:00
Luna Mendes 77c5a101c6 gateway.websocket: add basics of identify
- auth: add raw_token_check
 - gateway.gateway: pass the app object to GatewayWebsocket
 - gateway.state: add gen_session_id()
 - gateway: add state_man
2018-06-19 19:09:12 -03:00
Luna Mendes 32b9698ea7 add basic gateway logic 2018-06-19 04:06:01 -03:00