Git Product home page Git Product logo

sb-slash's Issues

[FEAT] /convertlinks

convert all strictly youtube links to sb.ltn.fi links & remove any additional parameters for a message

ShareUnsubmitted links don't work correctly when pasted into Discord

I used /shareunsubmitted and it generated this URL:

https://www.youtube.com/watch?v=56J0wOTll5c#segments=[%7B%22segment%22:[0,7.947],%22category%22:%22intro%22,%22actionType%22:%22skip%22%7D]

When this link is pasted into a discord channel, notice the white un-linked ] on the end:

image

Without that bracket, clicking the link doesn't correctly load the segment. This can be resolved in general without damaging the URL by appending an ampersand:

https://www.youtube.com/watch?v=56J0wOTll5c#segments=[%7B%22segment%22:[0,7.947],%22category%22:%22intro%22,%22actionType%22:%22skip%22%7D]&

So the bot should probably automatically add the & so that when it's pasted in discord it works correctly when clicked. It's easy to miss the white ]

Demo here: https://discord.com/channels/603643120093233162/603643205552177155/1014877479548227614

chapters support

  • add chapters type
  • add chapters category

commands

  • lockCategories
  • lockReason
  • searchSegments
  • segmentInfo
  • userStats (changes downstream)

downstream

  • sb-category-type
  • port matrix
  • wiki
  • openAPI

VIP utils

  • purgeSegments (purge)
  • clearCache (clearcache)
  • changeCategory (category)
  • downvote (downvote)
  • undoVote (undovote)
  • addTempVIP (addvip)

logging

  • downvote and undoVote attributed to user.

username#discriminator
downvote/undovote | UUID

example:

blabdude#9793
downvote | 8..6

Fix Nan%

if 0 segments, return 0% instead of NaN%

The bot ignores text messages

I'm trying to use the bot, but it doesn't give me commands to use

image

Since I can't send messages of type body.type == InteractionType.APPLICATION_COMMAND for some reason, the bot completely ignores me when I try to use commands.

The issue starts at the bottom of this code

// Process a Discord interaction POST request
const handleInteraction = async ({ request, wait }) => {
  // Get the body as a buffer and as text
  const bodyBuffer = await request.arrayBuffer();
  const bodyText = (new TextDecoder("utf-8")).decode(bodyBuffer);

  // Verify a legitimate request
  if (!handleInteractionVerification(request, bodyBuffer))
    return new Response(null, { status: 401 });

  // Work with JSON body going forward
  const body = JSON.parse(bodyText);

  // Handle a PING
  if (body.type === InteractionType.PING)
    return jsonResponse({
      type: InteractionResponseType.PONG
    });
  try {
    if (body.type == InteractionType.APPLICATION_COMMAND) { // handle commands

Lookup Segments message-command doesn't return all segments

Looks like the current implementation of the Lookup Segments message-command uses getSkipSegments(), which returns a random non-ignored segment in case of overlapping segments with the same category (basically the same as the extension).

I think using getSearchSegments() instead to show all segment versions would prove useful in situations like requests in the #incorrect-submissions channel, where there may be multiple versions of the same segment, some incorrect.
The implementation could just be copied from commands/searchsegments.js

Wrong regex

const isValidUserUUID = (str) => /^[a-f0-9]{64}$/.test(str);

Here, we have a regex that don't catch the userID in the command /userinfo :
image

image


Replacing with this work :
[a-f0-9]{64}
image

Lookup buttons give errors

As shown below whenever I click on either button "Lookup Last Submission" or "Lookup User" it results in an error. (Not tested on official sb server)
image

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.