zumito-framework 1.9.0 → 1.10.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,7 +1,7 @@
1
1
  import { REST } from '@discordjs/rest';
2
2
  import { Routes } from 'discord-api-types/v9';
3
3
  import { CommandType } from "../definitions/commands/CommandType";
4
- import { SlashCommandBuilder } from "discord.js";
4
+ import { InteractionContextType, SlashCommandBuilder } from "discord.js";
5
5
  export class SlashCommandRefresher {
6
6
  framework;
7
7
  constructor(framework) {
@@ -34,6 +34,13 @@ export class SlashCommandRefresher {
34
34
  slashCommand
35
35
  .setName(command.name)
36
36
  .setDescription(this.framework.translations.get('command.' + command.name + '.description', 'en'));
37
+ if (slashCommand instanceof SlashCommandBuilder) {
38
+ slashCommand.setContexts([
39
+ InteractionContextType.BotDM,
40
+ InteractionContextType.Guild,
41
+ InteractionContextType.PrivateChannel,
42
+ ]);
43
+ }
37
44
  if (command.args) {
38
45
  command.args.forEach((arg) => {
39
46
  let method;
@@ -30,7 +30,6 @@ export class GuildDataGetter {
30
30
  async getGuildSettings(guildId) {
31
31
  const collection = this.framework.database.collection('guilds');
32
32
  let guild = await collection.findOne({ guild_id: guildId });
33
- console.log(guild);
34
33
  if (!guild) {
35
34
  guild = {
36
35
  _id: new ObjectId(),
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "zumito-framework",
3
- "version": "1.9.0",
3
+ "version": "1.10.0",
4
4
  "description": "Discord.js bot framework",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",