Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

🐛 Channel length must be 18-19 #263

Open
FreshImmuc opened this issue Nov 26, 2024 · 2 comments
Open

🐛 Channel length must be 18-19 #263

FreshImmuc opened this issue Nov 26, 2024 · 2 comments
Labels
🐛 bug This is a bug 🏳️ help wanted Extra attention is needed

Comments

@FreshImmuc
Copy link
Contributor

Hey, i'm still using this bot :)

So discord updated their channel ids and now ids can be 18 but also 19 characters long.

The bot only accepts channel ids with length 18.

To fix this a simple fix in packages/backend/src/controllers/connectors/plugins/discordBot.class.ts is needed (i hope i'm right)

Code change is the following:
from:

private static readonly socketSchema = object<SocketSchema>({
    channel: string().alphanum().length(18).when(ref('$isRequired'), {
      is: boolean().invalid(false),
      then: required(),
    }),
    token: string().when(ref('$isRequired'), {
      is: boolean().invalid(false),
      then: required(),
    }),
  }).required();

to:

private static readonly socketSchema = object<SocketSchema>({
    channel: string().alphanum().min(18).max(19).when(ref('$isRequired'), {
      is: boolean().invalid(false),
      then: required(),
    }),
    token: string().when(ref('$isRequired'), {
      is: boolean().invalid(false),
      then: required(),
    }),
  }).required();

--> In this snipped, line 2 is updated

@FreshImmuc FreshImmuc added 🐛 bug This is a bug 🏳️ help wanted Extra attention is needed labels Nov 26, 2024
@tjarbo
Copy link
Owner

tjarbo commented Nov 27, 2024

Hi @FreshImmuc,
wow, I was not expecting to get see activity on this repository any more. But really cool to hear that it is somewhat, somewhere still in use - this must also mean that somehow this project is still working 😅

Unfortunately, for a couple of time now, I am not a Discord or Moodle user anymore. So I am not able to maintain this project. I was even thinking to archive this project, and leave the ability to fork it.

We can give your PR a try, but in case of any GitHub Actions failures, I won't be able to fix it. But in this case we can discuss alternatives.

best regards

@FreshImmuc
Copy link
Contributor Author

FreshImmuc commented Dec 2, 2024 via email

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🐛 bug This is a bug 🏳️ help wanted Extra attention is needed
Projects
None yet
Development

No branches or pull requests

2 participants