Skip to content

Commit

Permalink
Update better-discord.js (#898)
Browse files Browse the repository at this point in the history
* Update yarn.lock

* Use the latest registry of better-discord.js
  • Loading branch information
AndrewFerr authored Sep 15, 2023
1 parent a46989a commit 29e4e2a
Show file tree
Hide file tree
Showing 24 changed files with 689 additions and 605 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
Loading

0 comments on commit 29e4e2a

Please sign in to comment.