mirror of https://gitlab.com/litecord/litecord.git
SQL for instances:
```sql
ALTER TABLE messages
ADD CONSTRAINT messages_channels_fkey
FOREIGN KEY (channel_id)
REFERENCES channels (id)
ON DELETE CASCADE;
ALTER TABLE channel_pins ADD CONSTRAINT pins_channels_fkey
FOREIGN KEY (channel_id)
REFERENCES channels (id)
ON DELETE CASCADE;
ALTER TABLE channel_pins ADD CONSTRAINT pins_messages_fkey
FOREIGN KEY (message_id)
REFERENCES messages (id)
ON DELETE CASCADE;
```
After that, rerun `schema.sql`.
blueprints.channels:
- check dms on channel_check
- add DELETE /api/v6/channels/<int:channel_id>
blueprints.users:
- add event dispatching for leaving guilds
- add GET /api/v6/users/@me/channels, for DM fetching
- add POST /api/v6/users/@me/channels, for DM creation
- add POST /api/v6/users/<int:user_id>/channels for DM / Group DM
creation
- schemas: add CREATE, CREATE_GROUP_DM
- storage: add last_message_id fetching for channels
- storage: add support for DMs in get_channel
- storage: add Storage.get_dm, Storage.get_dms, Storage.get_all_dms
- schema.sql: add dm_channel_state table
- schema.sql: add constriants for messages.channel_id and channel_pins
|
||
|---|---|---|
| litecord | ||
| utils | ||
| .gitignore | ||
| LICENSE | ||
| Pipfile | ||
| Pipfile.lock | ||
| README.md | ||
| config.example.py | ||
| nginx.conf | ||
| run.py | ||
| schema.sql | ||
README.md
litecord
Litecord is an open source implementation of Discord's backend and API in Python.
This project is a rewrite of litecord-reference.
Install
- Python 3.6 or higher
- PostgreSQL
- Pipenv
$ git clone https://gitlab.com/luna/litecord.git && cd litecord
# Setup the database:
# don't forget that you can create a specific
# postgres user just for the litecord database
$ createdb litecord
$ psql -f schema.sql litecord
# Configure litecord:
# edit config.py as you wish
$ cp config.example.py config.py
# Install all packages:
$ pipenv install --dev
Running
Hypercorn is used to run litecord. By default, it will bind to 0.0.0.0:5000.
You can use the -b option to change it (e.g. -b 0.0.0.0:45000).
Use --access-log - to output access logs to stdout.
$ pipenv run hypercorn run:app