aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--.vscode/extensions.json2
-rw-r--r--.yarn/sdks/integrations.yml4
-rw-r--r--.yarn/sdks/typescript/lib/tsserver.js8
-rw-r--r--.yarn/sdks/typescript/lib/tsserverlibrary.js8
-rw-r--r--.yarn/sdks/typescript/package.json2
-rw-r--r--src/commands/info/help.ts4
-rw-r--r--src/commands/info/userInfo.ts2
-rw-r--r--src/lib/extensions/discord.js/BushGuild.ts3
-rw-r--r--src/lib/models/Guild.ts6
-rw-r--r--src/lib/utils/BushConstants.ts3
-rw-r--r--src/tasks/updateCache.ts17
11 files changed, 38 insertions, 21 deletions
diff --git a/.vscode/extensions.json b/.vscode/extensions.json
index 5b6b367..2b70e67 100644
--- a/.vscode/extensions.json
+++ b/.vscode/extensions.json
@@ -11,4 +11,4 @@
"tobias-faller.vt100-syntax-highlighting",
"pkief.material-icon-theme"
]
-} \ No newline at end of file
+}
diff --git a/.yarn/sdks/integrations.yml b/.yarn/sdks/integrations.yml
index 76ed42b..aa9d0d0 100644
--- a/.yarn/sdks/integrations.yml
+++ b/.yarn/sdks/integrations.yml
@@ -1,5 +1,5 @@
-# This file is automatically generated by PnPify.
-# Manual changes will be lost!
+# This file is automatically generated by @yarnpkg/sdks.
+# Manual changes might be lost!
integrations:
- vscode
diff --git a/.yarn/sdks/typescript/lib/tsserver.js b/.yarn/sdks/typescript/lib/tsserver.js
index 1c0f94d..4d90f38 100644
--- a/.yarn/sdks/typescript/lib/tsserver.js
+++ b/.yarn/sdks/typescript/lib/tsserver.js
@@ -72,6 +72,14 @@ const moduleWrapper = tsserver => {
str = resolve(`zipfile:${str}`);
} break;
+ // Support neovim native LSP and [typescript-language-server](https://github.com/theia-ide/typescript-language-server)
+ // We have to resolve the actual file system path from virtual path,
+ // everything else is up to neovim
+ case `neovim`: {
+ str = normalize(resolved).replace(/\.zip\//, `.zip::`);
+ str = `zipfile:${str}`;
+ } break;
+
default: {
str = `zip:${str}`;
} break;
diff --git a/.yarn/sdks/typescript/lib/tsserverlibrary.js b/.yarn/sdks/typescript/lib/tsserverlibrary.js
index 77e7ef5..c3de4ff 100644
--- a/.yarn/sdks/typescript/lib/tsserverlibrary.js
+++ b/.yarn/sdks/typescript/lib/tsserverlibrary.js
@@ -72,6 +72,14 @@ const moduleWrapper = tsserver => {
str = resolve(`zipfile:${str}`);
} break;
+ // Support neovim native LSP and [typescript-language-server](https://github.com/theia-ide/typescript-language-server)
+ // We have to resolve the actual file system path from virtual path,
+ // everything else is up to neovim
+ case `neovim`: {
+ str = normalize(resolved).replace(/\.zip\//, `.zip::`);
+ str = `zipfile:${str}`;
+ } break;
+
default: {
str = `zip:${str}`;
} break;
diff --git a/.yarn/sdks/typescript/package.json b/.yarn/sdks/typescript/package.json
index 27270c7..fbe0980 100644
--- a/.yarn/sdks/typescript/package.json
+++ b/.yarn/sdks/typescript/package.json
@@ -1,6 +1,6 @@
{
"name": "typescript",
- "version": "4.2.4-pnpify",
+ "version": "0.0.0-sdk",
"main": "./lib/typescript.js",
"type": "commonjs"
}
diff --git a/src/commands/info/help.ts b/src/commands/info/help.ts
index 1786f8c..67ba8c0 100644
--- a/src/commands/info/help.ts
+++ b/src/commands/info/help.ts
@@ -60,10 +60,6 @@ export default class HelpCommand extends BushCommand {
]
: undefined;
- this.client.console.debug(!this.client.config.isDevelopment);
- this.client.console.debug(!this.client.guilds.cache.some((guild) => guild.ownerId === message.author.id));
- this.client.console.debug(components);
-
const isOwner = this.client.isOwner(message.author);
const isSuperUser = this.client.isSuperUser(message.author);
const command = args.command
diff --git a/src/commands/info/userInfo.ts b/src/commands/info/userInfo.ts
index 5e70323..7172c75 100644
--- a/src/commands/info/userInfo.ts
+++ b/src/commands/info/userInfo.ts
@@ -153,7 +153,7 @@ export default class UserInfoCommand extends BushCommand {
}
if (perms.length) userEmbed.addField('» Important Perms', perms.join(' '));
- if (emojis) userEmbed.setDescription(emojis.join(' '));
+ if (emojis) userEmbed.setDescription('​' /*zero width space*/ + emojis.join(' '));
return await message.util.reply({ embeds: [userEmbed] });
}
diff --git a/src/lib/extensions/discord.js/BushGuild.ts b/src/lib/extensions/discord.js/BushGuild.ts
index 8d3ae88..79f7c98 100644
--- a/src/lib/extensions/discord.js/BushGuild.ts
+++ b/src/lib/extensions/discord.js/BushGuild.ts
@@ -21,8 +21,7 @@ export class BushGuild extends Guild {
public async setSetting<K extends keyof GuildModel>(setting: K, value: GuildDB[K]): Promise<GuildDB> {
const row = (await GuildDB.findByPk(this.id)) ?? GuildDB.build({ id: this.id });
row[setting] = value;
- //@ts-ignore: idk why it thinks it doesn't exist
- this.client.cache.guilds.set(this.id, row.dataValues);
+ this.client.cache.guilds.set(this.id, row.toJSON() as GuildDB);
return await row.save();
}
diff --git a/src/lib/models/Guild.ts b/src/lib/models/Guild.ts
index 050b4c7..f8ebe46 100644
--- a/src/lib/models/Guild.ts
+++ b/src/lib/models/Guild.ts
@@ -4,7 +4,7 @@ import { BushClient } from '../extensions/discord-akairo/BushClient';
import { BaseModel } from './BaseModel';
export interface GuildModel {
- id: string;
+ id: Snowflake;
prefix: string;
autoPublishChannels: Snowflake[];
blacklistedChannels: Snowflake[];
@@ -17,7 +17,7 @@ export interface GuildModel {
}
export interface GuildModelCreationAttributes {
- id: string;
+ id: Snowflake;
prefix?: string;
autoPublishChannels?: Snowflake[];
blacklistedChannels?: Snowflake[];
@@ -30,7 +30,7 @@ export interface GuildModelCreationAttributes {
}
export class Guild extends BaseModel<GuildModel, GuildModelCreationAttributes> implements GuildModel {
- id!: string;
+ id!: Snowflake;
prefix!: string;
autoPublishChannels: Snowflake[];
blacklistedChannels: Snowflake[];
diff --git a/src/lib/utils/BushConstants.ts b/src/lib/utils/BushConstants.ts
index 3ca2e8c..5a99798 100644
--- a/src/lib/utils/BushConstants.ts
+++ b/src/lib/utils/BushConstants.ts
@@ -80,7 +80,8 @@ export class BushConstants {
USE_APPLICATION_COMMANDS: { name: 'Use Slash Commands', important: false },
REQUEST_TO_SPEAK: { name: 'Request to Speak', important: false },
USE_PUBLIC_THREADS: { name: 'Use public Threads', important: false },
- USE_PRIVATE_THREADS: { name: 'Use Private Threads', important: true }
+ USE_PRIVATE_THREADS: { name: 'Use Private Threads', important: false },
+ MANAGE_THREADS: { name: 'Manage Threads', important: true }
},
features: {
diff --git a/src/tasks/updateCache.ts b/src/tasks/updateCache.ts
index cfadeb5..404173b 100644
--- a/src/tasks/updateCache.ts
+++ b/src/tasks/updateCache.ts
@@ -1,6 +1,7 @@
import { BushClient } from '../lib/extensions/discord-akairo/BushClient';
import { BushTask } from '../lib/extensions/discord-akairo/BushTask';
import { Global } from '../lib/models/Global';
+import { Guild } from '../lib/models/Guild';
import config from './../config/options';
export class UpdateCacheTask extends BushTask {
@@ -12,18 +13,18 @@ export class UpdateCacheTask extends BushTask {
}
public async exec(): Promise<void> {
await UpdateCacheTask.updateGlobalCache(this.client);
- // await UpdateCacheTask.updateGuildCache(this.client);
+ await UpdateCacheTask.updateGuildCache(this.client);
await this.client.logger.verbose(`UpdateCache`, `Updated cache.`);
}
public static async init(client: BushClient): Promise<void> {
await UpdateCacheTask.updateGlobalCache(client);
- // await UpdateCacheTask.updateGuildCache(client);
+ await UpdateCacheTask.updateGuildCache(client);
}
private static async updateGlobalCache(client: BushClient): Promise<void> {
const environment = config.environment;
- const row =
+ const row = (
(await Global.findByPk(environment)) ||
(await Global.create({
environment,
@@ -32,14 +33,18 @@ export class UpdateCacheTask extends BushTask {
blacklistedGuilds: [],
blacklistedUsers: [],
disabledCommands: []
- }));
+ }))
+ ).toJSON();
for (const option in row) {
- if (client.cache[option]) client.cache[option] = row[option];
+ if (Object.keys(client.cache.global).includes(option)) client.cache.global[option] = row[option];
}
}
private static async updateGuildCache(client: BushClient): Promise<void> {
- // client.db.query(`SELECT * FROM 'Guilds'`)
+ const rows = await Guild.findAll();
+ for (const row of rows) {
+ client.cache.guilds.set(row.id, row.toJSON() as Guild);
+ }
}
}