#channel.isTextBased is not a function

1 messages · Page 1 of 1 (latest)

graceful pebble
#

working on debugging.

spiral hearth
#

it would be good to know what this function is supposed to do. if we could just patch something in as a quick fix so our shards don't keep crashing

graceful pebble
#

Added a console.log into the file

spiral hearth
#
  isTextBased() {
    return 'messages' in this;
  }
#

assuming it's this..?

graceful pebble
#
        type: 0,
        permissions: '1020091952705',
        parent_id: '776866311689994250',
        name: 'de_closed-5392',
        id: '1079804400308068352'
    }
winter wolf
#

The guard is checking whether this (the message) has the property "messages"

spiral hearth
#

yeah i'm trying to just quickly patch it in node_modules tbh so my users don't rage out... i think i will just change the function call to && !channel.messages

winter wolf
#

in my case a channel is needed since it's for a context menu message command

graceful pebble
#

removing partial channels intent, seeing if that helps.

graceful pebble
#

Possible fix

spiral hearth
#

discord saying they're reverting the change

winter wolf
graceful pebble
winter wolf
#

oof no access

spiral hearth
#

think we just hold out and wait boys

#

there is probably some propagation time for the revert to hit

winter wolf
#

even if there was no rollback it'd be wisest to wait anyway since d.js team would be working on a fix

spiral hearth
#

yeah depending on the bot size it was pretty bad though, shards crashing every 10 seconds over here

graceful pebble
#

We have no confirmation it's in progress, only that they need to revert it.

#

Seems it's not crashing anymore

winter wolf
graceful pebble
#

You are correct.. sorry

#

I just added a basic check to prevent the crash until discord fixes the api

#

but atleast I can start things up ahead of time.

spiral hearth
#

hey @graceful pebble, your fix working out? might implement if the crashes don't stop soon (they seem to have slowed down)

winter wolf
# graceful pebble

not really sure about the code tho, does the rest work fine with the return? Since you are prematurely ending the execution of the function

#

so the interactionclass is not defined

#

I'd prolly just add a check to see if isTextBased is defined
prolly something like channel && !channel.isTextBased?.() (not tested, going to sleep)

#

that's basically optional chaining for function calls (checks if the property is defined and tries to call it like a function if it's defined)

winter wolf
#

Oh nvm