Skip to content

Commit

Permalink
Use the latest registry of better-discord.js
Browse files Browse the repository at this point in the history
  • Loading branch information
AndrewFerr committed Sep 11, 2023
1 parent 01827ea commit 2fd47c5
Show file tree
Hide file tree
Showing 24 changed files with 41 additions and 39 deletions.
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.
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -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
31 changes: 16 additions & 15 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -338,6 +338,21 @@
https-proxy-agent "^5.0.1"
node-downloader-helper "^2.1.5"

"@mx-puppet/better-discord.js@^12.5.1":
version "12.5.1"
resolved "https://gitlab.com/api/v4/projects/35796068/packages/npm/@mx-puppet/better-discord.js/-/@mx-puppet/better-discord.js-12.5.1.tgz#532e01241dbcb0f2769f1b9a7cde313d30101173"
integrity sha1-Uy4BJB28sPJ2nxuafN4xPTAQEXM=
dependencies:
"@discordjs/collection" "^0.1.6"
"@discordjs/form-data" "^3.0.1"
abort-controller "^3.0.0"
node-fetch "^2.6.1"
prism-media "^1.2.2"
setimmediate "^1.0.5"
tweetnacl "^1.0.3"
useragent-generator "^1.1.1-amkt-22079-finish.0"
ws "^7.3.1"

"@mx-puppet/discord-markdown@2.3.1":
version "2.3.1"
resolved "https://gitlab.com/api/v4/projects/35809145/packages/npm/@mx-puppet/discord-markdown/-/@mx-puppet/discord-markdown-2.3.1.tgz#52b0e8bb808a1202602899af67939b049dd42402"
Expand All @@ -347,7 +362,7 @@
node-emoji "^1.10.0"
simple-markdown "^0.7.2"

"@mx-puppet/matrix-discord-parser@0.1.10":
"@mx-puppet/matrix-discord-parser@^0.1.10":
version "0.1.10"
resolved "https://gitlab.com/api/v4/projects/35066311/packages/npm/@mx-puppet/matrix-discord-parser/-/@mx-puppet/matrix-discord-parser-0.1.10.tgz#0a37a3f9430ff7c29512d29882e25ae738a31283"
integrity sha1-Cjej+UMP98KVEtKYguJa5zijEoM=
Expand Down Expand Up @@ -931,20 +946,6 @@ bcrypt-pbkdf@^1.0.0:
dependencies:
tweetnacl "^0.14.3"

"better-discord.js@github:matrix-org/better-discord.js#5024781db755259e88abe915630b7d5b3ba5f48f":
version "12.5.1"
resolved "https://codeload.github.com/matrix-org/better-discord.js/tar.gz/5024781db755259e88abe915630b7d5b3ba5f48f"
dependencies:
"@discordjs/collection" "^0.1.6"
"@discordjs/form-data" "^3.0.1"
abort-controller "^3.0.0"
node-fetch "^2.6.1"
prism-media "^1.2.2"
setimmediate "^1.0.5"
tweetnacl "^1.0.3"
useragent-generator "^1.1.1-amkt-22079-finish.0"
ws "^7.3.1"

better-sqlite3@^8.6.0:
version "8.6.0"
resolved "https://registry.yarnpkg.com/better-sqlite3/-/better-sqlite3-8.6.0.tgz#a20717993742f816158f17e2cccd88a979e77e58"
Expand Down

0 comments on commit 2fd47c5

Please sign in to comment.