TheBastionBot / Bastion

🚀 Get an enhanced Discord experience!
https://bastion.traction.one
GNU General Public License v3.0
312 stars 246 forks source link

[BUG]: Install script fails on Ubuntu 22.04.2 LTS #1025

Closed rsoper closed 1 year ago

rsoper commented 1 year ago

Describe the bug Attempting to install Bastion on Ubuntu 22.04.2 LTS (GNU/Linux 5.15.0-1024-raspi aarch64) fails at the build stage stating multiple properties do not exist on "StageChannel"

To Reproduce Steps to reproduce the behavior:

  1. Run linux install command per documentation: curl -sL https://raw.github.com/TheBastionBot/BastionScripts/main/linux/apt.sh -o BastionInstaller.sh && chmod +x BastionInstaller.sh
  2. When the script reaches the Build stage the follow error occurs
src/commands/channel/update.ts:72:117 - error TS2339: Property 'nsfw' does not exist on type 'NewsChannel | StageChannel | TextChannel | VoiceChannel'.
  Property 'nsfw' does not exist on type 'StageChannel'.

72             nsfw: typeof isNSFW === "boolean" ? isNSFW : (channel as Exclude<GuildTextBasedChannel, ThreadChannel>).nsfw,
                                                                                                                       ~~~~

src/commands/channel/update.ts:74:78 - error TS2339: Property 'rateLimitPerUser' does not exist on type 'GuildTextBasedChannel'.
  Property 'rateLimitPerUser' does not exist on type 'StageChannel'.

74             rateLimitPerUser: slowmode ?? (channel as GuildTextBasedChannel).rateLimitPerUser,
                                                                                ~~~~~~~~~~~~~~~~

src/commands/config/select-roles/add.ts:94:50 - error TS2339: Property 'send' does not exist on type 'NewsChannel | StageChannel | TextChannel | PrivateThreadChannel | PublicThreadChannel<boolean> | VoiceChannel'.
  Property 'send' does not exist on type 'StageChannel'.

94         const selectRolesMessage = await channel.send({
                                                    ~~~~

src/commands/config/votingChannels.ts:61:55 - error TS2339: Property 'rateLimitPerUser' does not exist on type 'GuildTextBasedChannel'.
  Property 'rateLimitPerUser' does not exist on type 'StageChannel'.

61             if ((addChannel as GuildTextBasedChannel).rateLimitPerUser < 5 ) {
                                                         ~~~~~~~~~~~~~~~~

src/commands/config/votingChannels.ts:62:61 - error TS2339: Property 'setRateLimitPerUser' does not exist on type 'GuildTextBasedChannel'.
  Property 'setRateLimitPerUser' does not exist on type 'StageChannel'.

62                 await (addChannel as GuildTextBasedChannel).setRateLimitPerUser(5, "Voting Channel");
                                                               ~~~~~~~~~~~~~~~~~~~

src/commands/message/clear.ts:55:50 - error TS2339: Property 'messages' does not exist on type 'GuildTextBasedChannel'.
  Property 'messages' does not exist on type 'StageChannel'.

55         let messages = await interaction.channel.messages.fetch({ limit, before: interaction.id });
                                                    ~~~~~~~~

src/commands/message/clear.ts:73:59 - error TS2339: Property 'bulkDelete' does not exist on type 'GuildTextBasedChannel'.
  Property 'bulkDelete' does not exist on type 'StageChannel'.

73         const deletedMessages = await interaction.channel.bulkDelete(messages, true);
                                                             ~~~~~~~~~~

src/commands/music/play.ts:87:47 - error TS2339: Property 'send' does not exist on type 'GuildTextBasedChannel'.
  Property 'send' does not exist on type 'StageChannel'.

87                     await interaction.channel.send(`Now playing **${ song.name }**.`);
                                                 ~~~~

src/commands/music/play.ts:89:47 - error TS2339: Property 'send' does not exist on type 'GuildTextBasedChannel'.
  Property 'send' does not exist on type 'StageChannel'.

89                     await interaction.channel.send(`I couldn't play **${ song.name }**.`);
                                                 ~~~~

src/commands/report.ts:43:113 - error TS2339: Property 'send' does not exist on type 'GuildTextBasedChannel'.
  Property 'send' does not exist on type 'StageChannel'.

43             await (interaction.guild.channels.cache.get(guildDocument.reportsChannel) as GuildTextBasedChannel).send({
                                                                                                                   ~~~~

src/commands/search/movie.ts:71:95 - error TS2339: Property 'nsfw' does not exist on type 'NewsChannel | StageChannel | TextChannel | VoiceChannel'.
  Property 'nsfw' does not exist on type 'StageChannel'.

71         const movies = (interaction.channel as Exclude<GuildTextBasedChannel, ThreadChannel>).nsfw ? results?.results : results?.results?.filter(movie => !movie.adult);
                                                                                                 ~~~~

src/commands/search/tv.ts:70:96 - error TS2339: Property 'nsfw' does not exist on type 'NewsChannel | StageChannel | TextChannel | VoiceChannel'.
  Property 'nsfw' does not exist on type 'StageChannel'.

70         const tvShows = (interaction.channel as Exclude<GuildTextBasedChannel, ThreadChannel>).nsfw ? results?.results : results?.results?.filter(tv => !tv.adult);
                                                                                                  ~~~~

src/commands/suggest.ts:36:133 - error TS2339: Property 'send' does not exist on type 'GuildTextBasedChannel'.
  Property 'send' does not exist on type 'StageChannel'.

36             const message = await (interaction.guild.channels.cache.get(guildDocument.suggestionsChannel) as GuildTextBasedChannel).send({
                                                                                                                                       ~~~~

src/components/SelectRolesUpdateSelect.ts:41:132 - error TS2339: Property 'messages' does not exist on type 'GuildTextBasedChannel'.
  Property 'messages' does not exist on type 'StageChannel'.

41         const selectRolesMessage = await (interaction.guild.channels.cache.get(selectRoleGroup.channel) as GuildTextBasedChannel)?.messages.fetch(selectRoleGroup.id).catch(Logger.ignore);
                                                                                                                                      ~~~~~~~~

src/listeners/guildMemberAdd.ts:50:25 - error TS2339: Property 'send' does not exist on type 'NewsChannel | StageChannel | TextChannel | PrivateThreadChannel | PublicThreadChannel<boolean> | VoiceChannel'.
  Property 'send' does not exist on type 'StageChannel'.

50         greetingChannel.send({
                           ~~~~

src/listeners/guildMemberRemove.ts:35:25 - error TS2339: Property 'send' does not exist on type 'NewsChannel | StageChannel | TextChannel | PrivateThreadChannel | PublicThreadChannel<boolean> | VoiceChannel'.
  Property 'send' does not exist on type 'StageChannel'.

35         farewellChannel.send({
                           ~~~~

src/listeners/messageCreate.ts:92:26 - error TS2339: Property 'send' does not exist on type 'GuildTextBasedChannel'.
  Property 'send' does not exist on type 'StageChannel'.

92                         .send(`${ message.author }, ${ gamificationMessage }`)
                            ~~~~

src/listeners/messageCreate.ts:164:30 - error TS2339: Property 'rateLimitPerUser' does not exist on type 'GuildTextBasedChannel'.
  Property 'rateLimitPerUser' does not exist on type 'StageChannel'.

164         if (!message.channel.rateLimitPerUser) return;
                                 ~~~~~~~~~~~~~~~~

src/listeners/messageReactionAdd.ts:53:32 - error TS2339: Property 'send' does not exist on type 'GuildTextBasedChannel'.
  Property 'send' does not exist on type 'StageChannel'.

53         await starboardChannel.send({
                                  ~~~~

src/schedulers/giveaways.ts:44:59 - error TS2339: Property 'messages' does not exist on type 'GuildTextBasedChannel'.
  Property 'messages' does not exist on type 'StageChannel'.

44                     const giveawayMessage = await channel.messages.fetch(giveawayDocument._id).catch(Logger.ignore);
                                                             ~~~~~~~~

src/schedulers/liveStreams.ts:60:149 - error TS2339: Property 'send' does not exist on type 'GuildTextBasedChannel'.
  Property 'send' does not exist on type 'StageChannel'.

60                         await (this.client.guilds.cache.get(guild.id).channels.cache.get(guild.twitchNotificationChannel) as GuildTextBasedChannel).send({
                                                                                                                                                       ~~~~

src/schedulers/polls.ts:43:55 - error TS2339: Property 'messages' does not exist on type 'GuildTextBasedChannel'.
  Property 'messages' does not exist on type 'StageChannel'.

43                     const pollMessage = await channel.messages.fetch(pollDocument.id).catch(Logger.ignore);
                                                         ~~~~~~~~

src/utils/guilds.ts:25:20 - error TS2339: Property 'send' does not exist on type 'NewsChannel | StageChannel | TextChannel | PrivateThreadChannel | PublicThreadChannel<boolean> | VoiceChannel'.
  Property 'send' does not exist on type 'StageChannel'.

25         logChannel.send({
                      ~~~~

src/utils/guilds.ts:50:20 - error TS2339: Property 'send' does not exist on type 'NewsChannel | StageChannel | TextChannel | PrivateThreadChannel | PublicThreadChannel<boolean> | VoiceChannel'.
  Property 'send' does not exist on type 'StageChannel'.

50         logChannel.send({
                      ~~~~

Found 24 errors in 18 files.

Errors  Files
     2  src/commands/channel/update.ts:72
     1  src/commands/config/select-roles/add.ts:94
     2  src/commands/config/votingChannels.ts:61
     2  src/commands/message/clear.ts:55
     2  src/commands/music/play.ts:87
     1  src/commands/report.ts:43
     1  src/commands/search/movie.ts:71
     1  src/commands/search/tv.ts:70
     1  src/commands/suggest.ts:36
     1  src/components/SelectRolesUpdateSelect.ts:41
     1  src/listeners/guildMemberAdd.ts:50
     1  src/listeners/guildMemberRemove.ts:35
     2  src/listeners/messageCreate.ts:92
     1  src/listeners/messageReactionAdd.ts:53
     1  src/schedulers/giveaways.ts:44
     1  src/schedulers/liveStreams.ts:60
     1  src/schedulers/polls.ts:43
     2  src/utils/guilds.ts:25

Environment:

atlanna[bot] commented 1 year ago

Thank you for opening this issue. A maintainer will get by as soon as practical to address this issue.

Since this is your first time here, please check the contributing guidelines to see other ways you can get involved.

If this is a support question and not really an issue or suggestion, then please ask it in our Discord Server instead.

iamtraction commented 1 year ago

You can ignore it and configure bastion's settings and boot it up. It should run without any issues.

But anyways, this shouldn't be happening. I just tested it on my system. And automated tests are successful in the latest build too. I'll try to reproduce the issue and close it. image

gOOvER commented 1 year ago

i can confirm this Error on Debian 11 in a Docker Container.

Error comes on build

iamtraction commented 1 year ago

I've found the cause: image

atlanna[bot] commented 1 year ago

If you think this was a mistake, feel free to reopen this isssue.