mayudev / revcord

A bridge for Discord and Revolt with easy setup through commands
MIT License
64 stars 9 forks source link

Can't build Revcord #23

Closed amethyze closed 1 year ago

amethyze commented 1 year ago

Whenever I try to run "npm run build", I just get a message saying there were 13 errors. What does all of this mean?

app/Bot.ts:1:47 - error TS2460: Module '"discord.js"' declares 'GatewayIntentBits' locally, but it is exported as 'Snowflake'.

1 import { Client as DiscordClient, Collection, GatewayIntentBits } from "discord.js";
                                                ~~~~~~~~~~~~~~~~~

  node_modules/discord.js/typings/index.d.ts:105:3
    105   GatewayIntentBits,
          ~~~~~~~~~~~~~~~~~
    'GatewayIntentBits' is declared here.

app/Bot.ts:176:46 - error TS2551: Property 'get' does not exist on type 'Channels'. Did you mean '$get'?

176         const channel = this.revolt.channels.get(mapping.revolt);
                                                 ~~~

  node_modules/revolt.js/dist/maps/Channels.d.ts:398:5
    398     $get(id: string, data?: ChannelI): Channel;
            ~~~~
    '$get' is declared here.

app/discord.ts:276:10 - error TS2551: Property 'get' does not exist on type 'Channels'. Did you mean '$get'?

276         .get(target.revolt)
             ~~~

  node_modules/revolt.js/dist/maps/Channels.d.ts:398:5
    398     $get(id: string, data?: ChannelI): Channel;
            ~~~~
    '$get' is declared here.

app/discord.ts:343:47 - error TS2551: Property 'get' does not exist on type 'Channels'. Did you mean '$get'?

343         const channel = await revolt.channels.get(target.revolt);
                                                  ~~~

  node_modules/revolt.js/dist/maps/Channels.d.ts:398:5
    398     $get(id: string, data?: ChannelI): Channel;
            ~~~~
    '$get' is declared here.

app/discord.ts:375:47 - error TS2551: Property 'get' does not exist on type 'Channels'. Did you mean '$get'?

375         const channel = await revolt.channels.get(target.revolt);
                                                  ~~~

  node_modules/revolt.js/dist/maps/Channels.d.ts:398:5
    398     $get(id: string, data?: ChannelI): Channel;
            ~~~~
    '$get' is declared here.

app/discord/allowBots.ts:5:41 - error TS2724: '"discord.js"' has no exported member named 'PermissionFlagsBits'. Did you mean 'PermissionFlags'?

5 import { CommandInteraction, CacheType, PermissionFlagsBits } from "discord.js";
                                          ~~~~~~~~~~~~~~~~~~~

app/discord/connect.ts:4:30 - error TS2724: '"discord.js"' has no exported member named 'PermissionFlagsBits'. Did you mean 'PermissionFlags'?

4 import { CommandInteraction, PermissionFlagsBits } from "discord.js";
                               ~~~~~~~~~~~~~~~~~~~

app/discord/disconnect.ts:4:30 - error TS2724: '"discord.js"' has no exported member named 'PermissionFlagsBits'. Did you mean 'PermissionFlags'?

4 import { CommandInteraction, PermissionFlagsBits } from "discord.js";
                               ~~~~~~~~~~~~~~~~~~~

app/discord/listConnections.ts:3:44 - error TS2724: '"discord.js"' has no exported member named 'PermissionFlagsBits'. Did you mean 'PermissionFlags'?

3 import { CommandInteraction, EmbedBuilder, PermissionFlagsBits } from "discord.js";
                                             ~~~~~~~~~~~~~~~~~~~

app/revolt.ts:171:47 - error TS2551: Property 'get' does not exist on type 'Channels'. Did you mean '$get'?

171               const channel = revolt.channels.get(target.revolt);
                                                  ~~~

  node_modules/revolt.js/dist/maps/Channels.d.ts:398:5
    398     $get(id: string, data?: ChannelI): Channel;
            ~~~~
    '$get' is declared here.

app/universalExecutor.ts:32:46 - error TS2551: Property 'get' does not exist on type 'Channels'. Did you mean '$get'?

32     let revoltChannel = this.revolt.channels.get(revoltTarget);
                                                ~~~

  node_modules/revolt.js/dist/maps/Channels.d.ts:398:5
    398     $get(id: string, data?: ChannelI): Channel;
            ~~~~
    '$get' is declared here.

app/universalExecutor.ts:39:28 - error TS2339: Property 'forEach' does not exist on type 'Channels'.

39       this.revolt.channels.forEach((channel) => {
                              ~~~~~~~

app/util/permissions.ts:1:19 - error TS2724: '"discord.js"' has no exported member named 'PermissionFlagsBits'. Did you mean 'PermissionFlags'?

1 import { Channel, PermissionFlagsBits, TextChannel } from "discord.js";
                    ~~~~~~~~~~~~~~~~~~~

Found 13 errors in 9 files.

Errors  Files
     2  app/Bot.ts:1
     3  app/discord.ts:276
     1  app/discord/allowBots.ts:5
     1  app/discord/connect.ts:4
     1  app/discord/disconnect.ts:4
     1  app/discord/listConnections.ts:3
     1  app/revolt.ts:171
     2  app/universalExecutor.ts:32
     1  app/util/permissions.ts:1
mayudev commented 1 year ago

Please make sure your node version is v16.9 or higher. Also make sure you have the latest version of revcord by doing git checkout main && git pull

If yes, then remove the node_modules directory, do npm install and then npm run build again. If that doesn't work, please give me some information about your system (operating system, architecture, specific version of node)

amethyze commented 1 year ago

I was able to fix this by deleting and cloning the repo again. Thanks for the help!