Giter Club home page Giter Club logo

swan's Introduction

Imagine dragons

Wow! You imagined me right into being!

I am clragon (pronounced "dɹæɡən").
By injecting liquid coca cola zero into my veins,
I am able to stay up beyond recognition.

I like open source software, thats why I hang out on github:

stats

List of potential sins

e1547

e1547

e1547 is a mobile app for browsing e621.
Rumors say I wrote it. Thats of course slander. I will not elaborate.

swan's People

Contributors

abitofevrything avatar clragon avatar

Stargazers

 avatar  avatar  avatar

Watchers

 avatar  avatar

swan's Issues

handle weird text files in pastebin upload

if you paste a really long text into the input in discord, it will turn into a text file automatically.
this is really annoying because it ruins our pastebin uploads.
for example:

some preamble about my problem

\```dart
a really long piece of code
\```

this entire text will end up in the file, including the text block, which then breaks syntax highlighting.
it would be nice if we somehow detected this and threw away any text outside the code block.

however, we should be careful about this and only do it if it actually contains a single code block,
maybe even an open one, since the ending backticks might not be included.

fix language detection in pastebin plugin

the pastebin plugin right now uses an extremely crude method for language detection:
all text is dart. all pastes are therefore with dart highlights.

it would be nicer if we would actually try some detection.
we could use mime types.

however, we should still treat txt as dart, as some people will inevitably upload raw text files with dart code in them.

anti-spam plugin

since we are replacing flutterdocs functionality, its vital we also add an anti-spam plugin.

like flutterdoc, this includes:

  • warnings for duplicate messages (2+) in different channels
  • instant bans for duplicate messages in large quantities (5?)

the bot needs extra permissions for bans.

we can use a userid to message content hash map for this.

limit pub search result

searching the flutter docs sometimes leads to a very large emebed size that breaks sending the message

fix text detection in pastebin plugin

right now, the pastebin plugin uses mime types to detect text files.
other files are rejected.
this works poorly, as some desired files like pubspec.yml are definitely text and should be uploaded.
we have to find some other way to figure out if any given file is a raw text file.

Feature request: bot reply on common problems

Here's one idea:

When a user send a message containing this:

✗ Unable to find bundled Java version.

Reply with a common reply:

Java is already included in your installation of your Android Studio. If you encounter this problem, please don't install Java to fix it.
If you have Java installed and you don't have any reason to have it installed, you can uninstall Java to fix this problem.
If that doesn't fix your problem, run this following command:

flutter config --jdk-dir "path to your jdk"

You can find more information on that command and other configuration flags by running flutter config --help

fix anonymous functions in new swa parser

the new swa parser supports more syntax, including anonymous arrow functions, e.g.
() => a or (a, b) => c
however, currently the parser breaks on this input.

For reproduction:

A(() => b)

swa uses child count for child/children instead of input text

The command: .swa > Column > [ Row > [ Flexible(flex: 1), Flexible(flex: 4) ] ]
will produce

Column(
  child: Row( // uses `child`
    children: [
      Flexible(flex: 1),
      Flexible(flex: 4),
    ],
  ),
);

and I expect the content of the Column to be with children, not child like this:

Column(
  children: [ // uses `children`
    Row(
      children: [ 
        Flexible(flex: 1),
        Flexible(flex: 4),
      ]
    ),
  ]
);

fix bot status

the bot's status message somehow keeps turning off after a while.
I have no idea why.
There doesnt seem to be a duration setting on the status and I dont see why it would disappear.

it might be that discord applies the usual 24h decay to such a status as well, but again,
where is the option to turn that off?

Dartdoc: Showing wrong/unrelated documentation on important keywords search

There are few instances where documentation search returns a random unrelated documentation from a random package instead of the actual documentation page that should appear first. Here is a recent example:

Command:

![Visibility]

Expected result:

https://api.flutter.dev/flutter/widgets/Visibility-class.html

Actual result:

https://api.flutter.dev/flutter/package-material_color_utilities_scheme_variant/package-material_color_utilities_scheme_variant-library.html

Workaround:

![widgets.Visibility]

This isn't the case with the search feature in api.flutter.dev which has the correct top result. While having workaround isn't bad, the workaround isn't memorable enough to get use to, ended up trying bunch of commands to get it working, some times completely never return the intended documentation page.

introduce versioning in help

it would be useful if the help message of the bot somehow printed out its version.
we could probably do that easily by just adding a plugin that prints out the version in its help text.

however, I am not sure how we are gonna get the version. this is a pure dart program after all.
it would be nice if it was in sync with the pubspec.yaml somehow.

Remove dart doc disable

Since we are deploying Swan with search capabilites as of the sunset of flutterdoc, we no longer need this option.
However, we could bring it back as a server specific option instead.

improve stackoverflow mirror

Rough outline for the idea:

  1. check if text is over 2000 chars
  2. detect all codeblocks
  3. cut all code blocks to 200 chars, store full text in map
  4. cut the entire text to 2000 chars
  5. check which code blocks are still present
  6. upload the full text of all cut code blocks which are still present to pastebin
  7. add titles with links to all cut code blocks
  8. check if the message exceeds 2000, then cut the code blocks to reach 2000
  9. create files with the title and full text
  10. post message

empower help messages

it would be nice if plugin help messages could do both async work as well as server/channel dependant information.
this requires a refactor on how they are built.

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.