Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: update readme, contributing.md, and fix typos #855

Open
wants to merge 6 commits into
base: develop
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 20 additions & 0 deletions .editorconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
root = true

[*]
indent_style = space
indent_size = 4
end_of_line = lf
charset = utf-8
trim_trailing_whitespace = true
insert_final_newline = true
curly_bracket_next_line = false
spaces_around_operators = true

[*.{js,ts}]
quote_type = double

[*.{markdown,md}]
trim_trailing_whitespace = false

[*.{yaml,yml}]
indent_size = 2
4 changes: 2 additions & 2 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,13 +15,13 @@ Primarily it syncs events and users from Matrix to Discord and vice versa.

While the bridge is constantly evolving and we can't keep this section updated
with each component, we follow the principle of handler and processor classes
and each part of the functionality of the bridge will be in a seperate class.
and each part of the functionality of the bridge will be in a separate class.
For example, the processing of Matrix events destined for Discord are handled
inside the `MatrixEventProcessor` class.

## Setting up

* You will need to [setup the bridge](https://github.com/Half-Shot/matrix-appservice-discord/tree/develop#setup-the-bridge) similarly to how we describe,
* You will need to [setup the bridge](https://github.com/Half-Shot/matrix-appservice-discord/tree/develop#set-up-the-bridge) similarly to how we describe,
but you should setup a homeserver locally on your development machine. We would recommend [Synapse](https://github.com/matrix-org/synapse).
* The bridge uses `yarn` for dependency management and package scripts instead of `npm`.
For details, view the full setup instructions in the [README](README.md#set-up-the-bridge).
Expand Down
2 changes: 1 addition & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
FROM node:16-slim AS BUILD
COPY . /tmp/src
# install some dependencies needed for the build process
RUN apt update && apt install -y build-essential make gcc g++ python3 ca-certificates libc-dev wget git
RUN apt-get update && apt-get install -y build-essential make gcc g++ python3 ca-certificates libc-dev wget git

RUN cd /tmp/src \
&& yarn
Expand Down
2 changes: 0 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -72,8 +72,6 @@ mkdir -p /matrix-appservice-discord
# Be sure to set the database paths to something like this:
# database:
# filename: "/data/discord.db"
# userStorePath: "/data/user-store.db"
# roomStorePath: "/data/room-store.db"
nano /matrix-appservice-discord/config.yaml

# Copy the registration file to the volume
Expand Down
1 change: 0 additions & 1 deletion src/clientfactory.ts
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,6 @@ export class DiscordClientFactory {
log.error("Could not login as the bot user. This is bad!", err);
throw err;
}

}

public async getDiscordId(token: string): Promise<string> {
Expand Down
5 changes: 2 additions & 3 deletions src/discordas.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*/
import { Appservice, IAppserviceRegistration, LogService, MatrixClient } from "matrix-bot-sdk";
import { Appservice, IAppserviceRegistration, LogService } from "matrix-bot-sdk";
import * as yaml from "js-yaml";
import * as fs from "fs";
import { DiscordBridgeConfig } from "./config";
Expand Down Expand Up @@ -112,7 +112,7 @@ async function run(): Promise<void> {
// eslint-disable-next-line no-console
console.log(usage([
{
content: "The matrix appservice for discord",
content: "The Matrix appservice for Discord",
header: "Matrix Discord Bridge",
},
{
Expand Down Expand Up @@ -227,7 +227,6 @@ async function run(): Promise<void> {

await appservice.begin();
log.info(`Started listening on port ${port}`);

}

run().catch((err) => {
Expand Down
2 changes: 1 addition & 1 deletion src/util.ts
Original file line number Diff line number Diff line change
Expand Up @@ -378,7 +378,7 @@ export class Util {
};
}

// Taken from https://github.com/matrix-org/matrix-appservice-bridge/blob/master/lib/models/users/matrix.js
// Taken from https://github.com/matrix-org/matrix-appservice-bridge/blob/master/src/models/users/matrix.ts
public static EscapeStringForUserId(localpart: string) {
// NOTE: Currently Matrix accepts / in the userId, although going forward it will be removed.
const badChars = new Set(localpart.replace(/([a-z]|[0-9]|-|\.|=|_)+/g, ""));
Expand Down