Previously SailDiscord
An unofficial SailfishOS Discord client
Very very WIP
By using this, you are breaking Discord Terms of Services! This app might even get you banned! It stores your token in plain text and it is really easy to hack you with it!
Join the Telegram channel for Sailcord development logs and releases.
Join SailfishOS Fan Club Discord server! Besides general SailfishOS discussion, it also has several Sailcord-related channels including info, discussion and major announcements like releases.
- Login using Discord
- Connect Python
- Servers
- Text channels
- Text
- Other types (photos, gifs, etc.)
- DMs
- Settings
- About page
- Caching
- Avatars
- References (forwarded, replies)
- Markdown
- Automate translating, maybe with something like weblate
- More features?
- Hourly cache updating is actually 35 seconds cache updating. A fix is coming in the next update
- App lags in a text channel sometimes. Very similar to the issue below except this one lags besides being slow
- App is very slow at loading almost everything. This is not fully fixable because app uses Python as the backend, which is slow
- When using server folders, they might not load sometimes
Update to 0.4.2. 0.4.2 might show you that you are using 0.4.1, but that is just a bug which you can safely ignore as long as everything works.
Check if you are able to open https://discord.com/login in the native browser. If you can't, here are the possible workarounds:
- Update to ESR91 beta
- Login using token (see below)
See discord.py-self docs page for up to date information. In short, you should:
- Login into discord with a desktop web browser
- Open developer tools (ctrl+shift+i on most browsers) and click on Console
- Type this code and press enter:
(webpackChunkdiscord_app.push([[''],{},e=>{m=[];for(let c in e.c)m.push(e.c[c])}]),m).find(m => m?.exports?.default?.getToken).exports.default.getToken()
- Copy the token it will show you without the quotes (
"
)
After obtaining you token, in Sailcord top menu, when logging in, choose Login with token. Then paste your token and click Accept.
Screenshots are for version 0.5.0
- Fork the repo from GitHub UI. When creating the fork, select the "Copy the
main
branch only" checkmark. Only needed once - If required, click on "Sync fork" on your fork.
- (Optional) You can create a new branch with your translation by selecting the
main
branch you forked -> "View all branches" -> "New branch" and typing whatever branch name you want. I recommendpatch-n
wheren
is 1 for the first branch, 2 for the second, etc. Then go to your branch on the GitHub. - Go to folder
SailDiscord
->translations
.- If there is a file with your language code, click on it and select the edit icon
- If not:
- Click on
harbour-saildiscord.ts
file - Select copy icon (Copy raw file)
- Go back, click Add file -> Create new file
- Enter
harbour-saildiscord-xx.ts
replacingxx
with your language code as the name. For example,ru
for Russian - Paste the copied file in the new file's contents
- Click on
- Make your changes. Note that:
-
Do not update Opal modules translations. They include About page translations, and their context name is prefixed with
Opal.
. Do it here instead. An example:<context> <name>Opal.About</name> ... </context>
-
When translating a string, read its comments if available. They include things which describe the context of the string (where it is used).
-
%1
,%2
,%3
, etc. parts will be replaced with additional data -
Parts starting with
&
and ending with;
mean that they'll be replaced with special characters. You can check the full list by googling "html entities list". The most common are:code rendered <
> >
< &
& "
" '
' -
To translate a string, modify the lines starting with
<translation
. Removetype="unfinished"
parts and insert your translation between>
and<
characters. As the source use the lines starting with<source>
, which are above the actual translation. Example:Original: <message> <location filename="../qml/pages/FirstPage.qml" line="62"/> <location filename="../qml/pages/LoginDialog.qml" line="20"/> <source>About</source> <comment>App</comment> <translation type="unfinished"></translation> </message> Modified: <message> <location filename="../qml/pages/FirstPage.qml" line="62"/> <location filename="../qml/pages/LoginDialog.qml" line="20"/> <source>About</source> <comment>App</comment> <translation>О программе</translation> </message>
-
- Click on Commit changes -> Commit changes. Leave the commit options default
- Go to the main page of your fork, select your branch if you created it
- Click on Contribute -> Open pull request -> Create pull request
Don't
Get Sailfish IDE, open the project, open Other Files -> rpm -> SailDiscord.spec
, then replace no
in the first line with yes
if you want to make a production package. Now just run or build.
If you didn't replace, you'll get faster build but aditional steps needed for phone. This is needed only once. Once the installation is completed, open Terminal from the developer options on your phone and type this command:
python3 -m pip install --user --upgrade "discord.py-self>=2.0" "requests" "Pillow"
Then open the app. If you ever want to switch back to the production version, type this command to undo:
python3 -m pip uninstall discord.py-self
SailJail will NOT work in this case
You might need to remove the build_folder/deps/google/_upb folderShould not be needed now.There's an issue that theBuildRequires: python3-pip;
line in the spec file throws an error. A workaround for now is to build these two awesome projects for the same target as for this project - harbour-moremahjong and sailfish-rpn-calculator.A fix could be to usepython3 -m ensurepip --default-pip
instead ofBuildRequires: python3-pip;
in the spec, but it might break the build vm/container so I am not recommending it. You can still do so by uncommenting a line in the spec file.- The fix has been found, and it turns out very simple. Open the project in Sailfish IDE, right click on it in the file structure and click Run QMake.
- You might need to
cd
into the build folder, runsfdk config target=<a target>
and thensfdk build-shell --maintain
, finally inside that shell runpython3 -m pip install --upgrade pip
.
- When sharing IDs between Python and QML, we convert them to strings. QML can mess up large integers so we use strings. We never really operate IDs in QML except for sending them back to Python in exchange for other data.
The code is based on:
-
a lot:
- SailfishOS telegram client Fernschreiber - most of the UI
-
a little:
- sailfish-rpn-calculator, and its @poetaster's fork - early packaging issues
- Rapptz/discord.py#9690 (comment) - going offline/closing connection
- https://github.com/ichthyosaurus/harbour-file-browser - zoom pictures
Core functionality:
- discord.py-self library
- Opal (About, LinkHandler, Tabs and the snippets)
Developers:
- @roundedrectangle (me)
Contributors (translations):
- @legacychimera247 - Italian
- @eson57 - Swedish