Skip to content

Commit

Permalink
Merge branch 'develop' into af/log-ignore-disabled
Browse files Browse the repository at this point in the history
  • Loading branch information
AndrewFerr authored Sep 15, 2023
2 parents 556bb69 + 92f528e commit bff6b0c
Show file tree
Hide file tree
Showing 28 changed files with 695 additions and 610 deletions.
3 changes: 1 addition & 2 deletions .github/workflows/sign-off.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,5 +6,4 @@ on:

jobs:
signoff:
uses: matrix-org/backend-meta/.github/workflows/[email protected]

uses: matrix-org/backend-meta/.github/workflows/sign-off.yml@v2
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ by running ``yarn set version classic`` in the directory where you cloned this r
homeserverUrl: "https://example.com"
```
* Run ``node build/src/discordas.js -r -u "http://localhost:9005" -c config.yaml``
* Run ``yarn start -r -u "http://localhost:9005"``
* Modify your HSs appservices config so that it includes the generated file.
* e.g. On synapse, adding to ``app_service_config_files`` array in ``homeserver.yaml``
Expand Down
1 change: 1 addition & 0 deletions changelog.d/898.misc
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Update the package registry for better-discord.js, and use its latest release.
1 change: 1 addition & 0 deletions changelog.d/900.misc
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Modify the "start" and "debug" package scripts to not trigger a TypeScript build, and to accept a user-supplied command line option for the path to the bridge configuration file.
1 change: 1 addition & 0 deletions changelog.d/901.misc
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Update the GitHub action used for checking pull requests for sign-off status.
8 changes: 4 additions & 4 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,8 @@
"coverage": "tsc && nyc mocha build/test/config.js build/test",
"build": "tsc",
"postinstall": "yarn build",
"start": "yarn build && node ./build/src/discordas.js -c config.yaml",
"debug": "yarn build && node --inspect ./build/src/discordas.js -c config.yaml",
"start": "node ./build/src/discordas.js",
"debug": "node --inspect ./build/src/discordas.js",
"addbot": "node ./build/tools/addbot.js",
"adminme": "node ./build/tools/adminme.js",
"usertool": "node ./build/tools/userClientTools.js",
Expand All @@ -40,8 +40,8 @@
},
"homepage": "https://github.com/Half-Shot/matrix-appservice-discord#readme",
"dependencies": {
"@mx-puppet/matrix-discord-parser": "0.1.10",
"better-discord.js": "github:matrix-org/better-discord.js#5024781db755259e88abe915630b7d5b3ba5f48f",
"@mx-puppet/better-discord.js": "^12.5.1",
"@mx-puppet/matrix-discord-parser": "^0.1.10",
"better-sqlite3": "^8.6.0",
"command-line-args": "^5.1.1",
"command-line-usage": "^6.1.0",
Expand Down
4 changes: 2 additions & 2 deletions src/bot.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,21 +14,21 @@ See the License for the specific language governing permissions and
limitations under the License.
*/

import * as Discord from "@mx-puppet/better-discord.js";
import { IDiscordMessageParserResult } from "@mx-puppet/matrix-discord-parser";
import { DiscordBridgeConfig } from "./config";
import { DiscordClientFactory } from "./clientfactory";
import { DiscordStore } from "./store";
import { DbEmoji } from "./db/dbdataemoji";
import { DbEvent } from "./db/dbdataevent";
import { DiscordMessageProcessor } from "./discordmessageprocessor";
import { IDiscordMessageParserResult } from "@mx-puppet/matrix-discord-parser";
import { MatrixEventProcessor, MatrixEventProcessorOpts, IMatrixEventProcessorResult } from "./matrixeventprocessor";
import { PresenceHandler } from "./presencehandler";
import { Provisioner } from "./provisioner";
import { UserSyncroniser } from "./usersyncroniser";
import { ChannelSyncroniser } from "./channelsyncroniser";
import { MatrixRoomHandler } from "./matrixroomhandler";
import { Log } from "./log";
import * as Discord from "better-discord.js";
import * as mime from "mime";
import { IMatrixEvent, IMatrixMediaInfo, IMatrixMessage } from "./matrixtypes";
import { Appservice, Intent, MatrixClient } from "matrix-bot-sdk";
Expand Down
2 changes: 1 addition & 1 deletion src/channelsyncroniser.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ See the License for the specific language governing permissions and
limitations under the License.
*/

import * as Discord from "better-discord.js";
import * as Discord from "@mx-puppet/better-discord.js";
import { DiscordBot } from "./bot";
import { Util } from "./util";
import { DiscordBridgeConfig, DiscordBridgeConfigChannelDeleteOptions } from "./config";
Expand Down
2 changes: 1 addition & 1 deletion src/clientfactory.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,9 @@ See the License for the specific language governing permissions and
limitations under the License.
*/

import { Client as DiscordClient, Intents, TextChannel } from "@mx-puppet/better-discord.js";
import { DiscordBridgeConfigAuth } from "./config";
import { DiscordStore } from "./store";
import { Client as DiscordClient, Intents, TextChannel } from "better-discord.js";
import { Log } from "./log";
import { MetricPeg } from "./metrics";

Expand Down
2 changes: 1 addition & 1 deletion src/discordcommandhandler.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,8 @@ See the License for the specific language governing permissions and
limitations under the License.
*/

import * as Discord from "@mx-puppet/better-discord.js";
import { DiscordBot } from "./bot";
import * as Discord from "better-discord.js";
import { Util, ICommandActions, ICommandParameters, CommandPermissonCheck } from "./util";
import { Log } from "./log";
import { Appservice } from "matrix-bot-sdk";
Expand Down
2 changes: 1 addition & 1 deletion src/discordmessageprocessor.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ See the License for the specific language governing permissions and
limitations under the License.
*/

import * as Discord from "better-discord.js";
import * as Discord from "@mx-puppet/better-discord.js";
import { DiscordBot } from "./bot";
import { Log } from "./log";
import {
Expand Down
2 changes: 1 addition & 1 deletion src/matrixcommandhandler.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,13 +14,13 @@ See the License for the specific language governing permissions and
limitations under the License.
*/

import * as Discord from "@mx-puppet/better-discord.js";
import { DiscordBot } from "./bot";
import { Log } from "./log";
import { DiscordBridgeConfig } from "./config";
import { IMatrixEvent } from "./matrixtypes";
import { Provisioner } from "./provisioner";
import { Util, ICommandActions, ICommandParameters, CommandPermissonCheck } from "./util";
import * as Discord from "better-discord.js";
import { Appservice } from "matrix-bot-sdk";
import { IRoomStoreEntry } from "./db/roomstore";
import * as markdown from "marked";
Expand Down
2 changes: 1 addition & 1 deletion src/matrixeventprocessor.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ See the License for the specific language governing permissions and
limitations under the License.
*/

import * as Discord from "better-discord.js";
import * as Discord from "@mx-puppet/better-discord.js";
import { DiscordBot } from "./bot";
import { DiscordBridgeConfig } from "./config";
import { Util, wrapError } from "./util";
Expand Down
2 changes: 1 addition & 1 deletion src/matrixmessageprocessor.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ See the License for the specific language governing permissions and
limitations under the License.
*/

import * as Discord from "better-discord.js";
import * as Discord from "@mx-puppet/better-discord.js";
import { IMatrixMessage } from "./matrixtypes";
import { Util } from "./util";
import { DiscordBot } from "./bot";
Expand Down
2 changes: 1 addition & 1 deletion src/matrixroomhandler.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ limitations under the License.
import { DiscordBot, IThirdPartyLookup } from "./bot";
import { DiscordBridgeConfig } from "./config";

import * as Discord from "better-discord.js";
import * as Discord from "@mx-puppet/better-discord.js";
import { Util } from "./util";
import { Log } from "./log";
const log = new Log("MatrixRoomHandler");
Expand Down
2 changes: 1 addition & 1 deletion src/presencehandler.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ See the License for the specific language governing permissions and
limitations under the License.
*/

import { User, Presence } from "better-discord.js";
import { User, Presence } from "@mx-puppet/better-discord.js";
import { DiscordBot } from "./bot";
import { Log } from "./log";
import { MetricPeg } from "./metrics";
Expand Down
2 changes: 1 addition & 1 deletion src/provisioner.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ See the License for the specific language governing permissions and
limitations under the License.
*/

import * as Discord from "better-discord.js";
import * as Discord from "@mx-puppet/better-discord.js";
import { DbRoomStore, RemoteStoreRoom, MatrixStoreRoom } from "./db/roomstore";
import { ChannelSyncroniser } from "./channelsyncroniser";
import { Log } from "./log";
Expand Down
2 changes: 1 addition & 1 deletion src/usersyncroniser.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ See the License for the specific language governing permissions and
limitations under the License.
*/

import { User, GuildMember, Message } from "better-discord.js";
import { User, GuildMember, Message } from "@mx-puppet/better-discord.js";
import { DiscordBot } from "./bot";
import { Util } from "./util";
import { DiscordBridgeConfig } from "./config";
Expand Down
2 changes: 1 addition & 1 deletion src/util.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,10 @@ See the License for the specific language governing permissions and
limitations under the License.
*/

import { Permissions } from "@mx-puppet/better-discord.js";
import * as http from "http";
import * as https from "https";
import { Buffer } from "buffer";
import { Permissions } from "better-discord.js";
import { DiscordBridgeConfig } from "./config";
import { IMatrixEvent } from "./matrixtypes";

Expand Down
2 changes: 1 addition & 1 deletion test/mocks/channel.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,9 @@ See the License for the specific language governing permissions and
limitations under the License.
*/

import {Permissions, PermissionResolvable, TextChannel} from "@mx-puppet/better-discord.js";
import {MockMember} from "./member";
import {MockCollection} from "./collection";
import {Permissions, PermissionResolvable, TextChannel} from "better-discord.js";
import { MockGuild } from "./guild";

// we are a test file and thus need those
Expand Down
2 changes: 1 addition & 1 deletion test/mocks/collection.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ See the License for the specific language governing permissions and
limitations under the License.
*/

import { Collection } from "better-discord.js";
import { Collection } from "@mx-puppet/better-discord.js";

export class MockCollection<T1, T2> extends Collection<T1, T2> {
public array(): T2[] {
Expand Down
2 changes: 1 addition & 1 deletion test/mocks/guild.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,10 @@ See the License for the specific language governing permissions and
limitations under the License.
*/

import {Channel} from "@mx-puppet/better-discord.js";
import {MockCollectionManager} from "./collection";
import {MockMember} from "./member";
import {MockEmoji} from "./emoji";
import {Channel} from "better-discord.js";
import {MockRole} from "./role";

// we are a test file and thus need those
Expand Down
2 changes: 1 addition & 1 deletion test/mocks/member.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,10 @@ See the License for the specific language governing permissions and
limitations under the License.
*/

import * as Discord from "@mx-puppet/better-discord.js";
import {MockCollectionManager} from "./collection";
import {MockUser} from "./user";
import {MockRole} from "./role";
import * as Discord from "better-discord.js";

// we are a test file and thus need those
/* tslint:disable:no-unused-expression max-file-line-count no-any */
Expand Down
2 changes: 1 addition & 1 deletion test/mocks/message.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ See the License for the specific language governing permissions and
limitations under the License.
*/

import * as Discord from "better-discord.js";
import * as Discord from "@mx-puppet/better-discord.js";
import { MockUser } from "./user";
import { MockCollection } from "./collection";

Expand Down
2 changes: 1 addition & 1 deletion test/mocks/user.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ See the License for the specific language governing permissions and
limitations under the License.
*/

import { Presence } from "better-discord.js";
import { Presence } from "@mx-puppet/better-discord.js";

// we are a test file and thus need those
/* tslint:disable:no-unused-expression max-file-line-count no-any */
Expand Down
2 changes: 1 addition & 1 deletion test/test_clientfactory.ts
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ import { DiscordBridgeConfigAuth } from "../src/config";
/* tslint:disable:no-unused-expression max-file-line-count no-any */

const DiscordClientFactory = Proxyquire("../src/clientfactory", {
"better-discord.js": { Client: require("./mocks/discordclient").MockDiscordClient },
"@mx-puppet/better-discord.js": { Client: require("./mocks/discordclient").MockDiscordClient },
}).DiscordClientFactory;

const STORE = {
Expand Down
2 changes: 1 addition & 1 deletion test/test_matrixeventprocessor.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,8 @@ limitations under the License.
*/

import { expect } from "chai";
import * as Discord from "better-discord.js";
import * as Proxyquire from "proxyquire";
import * as Discord from "@mx-puppet/better-discord.js";
import { MockMember } from "./mocks/member";
import { MatrixEventProcessor, MatrixEventProcessorOpts } from "../src/matrixeventprocessor";
import { DiscordBridgeConfig } from "../src/config";
Expand Down
Loading

0 comments on commit bff6b0c

Please sign in to comment.