Skip to content
This repository has been archived by the owner on Jul 11, 2022. It is now read-only.

Commit

Permalink
Attempt discord.js-light again.
Browse files Browse the repository at this point in the history
  • Loading branch information
SeraphimRP committed Feb 6, 2021
1 parent f648138 commit 15e89f6
Show file tree
Hide file tree
Showing 5 changed files with 13 additions and 18 deletions.
8 changes: 8 additions & 0 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@
"bufferutil": "^4.0.3",
"chalk": "^4.1.0",
"discord.js": "^12.5.1",
"discord.js-light": "^3.5.2",
"erlpack": "github:discord/erlpack",
"git-last-commit": "^1.0.0",
"ini": "^1.3.6",
Expand Down
15 changes: 1 addition & 14 deletions src/bot.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ import * as defaultGuildPreferences from './helpers/default_guild_preference.jso

import * as mongoose from 'mongoose';

import { Client, DMChannel } from 'discord.js';
import { Client, DMChannel } from 'discord.js-light';

const config = ini.parse(fs.readFileSync(`${__dirname}/config.ini`, 'utf-8'));

Expand Down Expand Up @@ -99,19 +99,6 @@ bot.on('message', async message => {
if (['110373943822540800', '264445053596991498'].includes(message.guild.id)) {
return;
}

if (!(message.channel instanceof DMChannel)) {
let shouldLog = false;

if (message.content == '+permcheck') {
shouldLog = true;
}

if (!checkBotPermissions(message.channel, message.guild, shouldLog)) {
// If the bot doesn't have the necessary permissions, don't pursue further.
return;
}
}

guildID = message.guild.id;
} else {
Expand Down
2 changes: 1 addition & 1 deletion src/init.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import * as fs from 'fs';
import * as ini from 'ini';

import { ShardingManager } from 'discord.js';
import { ShardingManager } from 'discord.js-light';
import { fetchBookNames } from './helpers/name_fetcher';
import { log } from './helpers/logger';

Expand Down
5 changes: 2 additions & 3 deletions src/routes/information/router.ts
Original file line number Diff line number Diff line change
Expand Up @@ -93,16 +93,15 @@ export class InformationRouter {

git.getLastCommit((err, commit) => {
const message = `**${lang.getString('shardcount')}** ${ctx.bot.shard.count}\n` +
`**${lang.getString('cachedguilds')}** ${guildCount}\n` +
`**${lang.getString('cachedchannels')}** ${channelCount}\n\n` +
`**${lang.getString('cachedguilds')}** ${guildCount}\n\n` +

`**${lang.getString('preferencecount')}** ${prefCount}\n` +
`**${lang.getString('guildprefcount')}** ${gPrefCount}\n` +
`**${lang.getString('versioncount')}** ${versionCount}\n` +
`**${lang.getString('languagecount')}** ${languageCount}\n\n` +

`**BibleBot:** ${process.env.npm_package_version} ([${commit.shortHash}](https://github.com/BibleBot/BibleBot/commit/${commit.hash}))\n` +
`**Discord.js:** ${packageJson.dependencies['discord.js'].slice(1)}\n` +
`**Discord.js:** ${packageJson.dependencies['discord.js-light'].slice(1)}\n` +
`**Mongoose:** ${packageJson.dependencies.mongoose.slice(1)}\n\n` +

`${platform}`;
Expand Down

0 comments on commit 15e89f6

Please sign in to comment.