Git Product home page Git Product logo

git-the-lines's Introduction

Git the lines

Codacy Badge Build Status Up Status Servers inviteme

A Discord bot that prints out the lines referenced in a Git snippet link (e.g. https://github.com/dolphingarlic/git-the-lines/blob/master/bot.py#L30-L34)

Usage

Just send the link to the snippet - no need for extra commands! Git the lines even highlights the code for you

The bot in action

Features

  • GitHub
    • Public repos
    • Private repos*
    • Gists
  • GitLab
    • Public repos
    • Private repos*
  • BitBucket
    • Public repos
  • Heptapod
    • Public repos

*Private repos are only supported if self-hosted

Commands

Ping

Command: g;ping.

Action: Pings bot, returns bot delay in ms.

About

Command: g;about.

Aliases: g;stats.

Action: Shows bot statistics and technical data.

Help

Command: g;help.

Action: Shows help information.

Invite

Command: g;invite.

Aliases: g;topgg.

Action: Sends a bot invite link.

GitHub Repo

Command: g;github.

Aliases: g;source.

Action: Sends the bot GitHub repo link

Get the bot

Use this link to add the bot to your server

Deploy

Alternatively, you can self-host the bot using Heroku, pythonanywhere, or any other hosting service. Simply create a file named .env and set DISCORD_TOKEN to your Discord bot token

Contribute

We gladly accept any (constructive) contributions. Feel free to open issues and pull requests!

git-the-lines's People

Contributors

codacy-badger avatar dependabot[bot] avatar dolphingarlic avatar imgbotapp avatar matejmecka avatar mukundan314 avatar rohinivsenthil avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

git-the-lines's Issues

Bot sometimes fails to delete original embed of posted github links

Sometimes posting a link to github stuff still leaves the embed of the user posted message, while I understand that this bot tries to remove it since it proposes it's own embeds.
Example:
image

This makes some of the features of this bot a feel redundant and messy at times.

Unwanted quoting when links are followed by comma

We found this instance where posting a link to a file followed by a comma , it would quote line 1 of the file which is probably not what the user wanted:
eg: https://github.com/ModOrganizer2/modorganizer/blob/master/src/mainwindow.ui,

image

Extrapolate and post filename and line of the snippet.

Thanks for the nice bot, it helps when using discord as the main development discussion platform.

I wanted to propose the addition of the filename and displayed lines in the bot message, in a more readable way than what is contained in the link.

For example here
image
the bot doesn't currently give any context of where the lines are from and the users need to extrapolate it from the link, which makes it more difficult at a glance.

In comparison this is how github renders the link:

async def fetch_http(session, url, response_format="text", **kwargs):
"""Uses aiohttp to make http GET requests"""
async with session.get(url, **kwargs) as response:
if response_format == "text":
return await response.text()
elif response_format == "json":
return await response.json()

Regarding how to show the information, I was thinking of something simple like this:
image

Where the filename is in bold and the line number/numbers are in normal text.

I work on an opensource project with a pretty sizable codebase and being able to see at a glance which file is being snipped would be very helpful.
In my opinion the repository name isn't necessary since it's usually clear from the context or from the filename itself. In case it's needed the developer can still get the info from the link, although less conveniently. Also adding that would risk in my opinion cluttering the extracted information too much, reducing it's readability at a glance.

Add option to collapse lines

Since many people aren't fans of lines interrupting conversations, it would be nice to be able to collapse lines using reactions

Also, the bot should probably not send messages about lines being too long (to limit spam)

Too many embeds

Hey, it's me again.

After a few weeks of using the bot on our development server the other developers asked me to kick it since there were too many embeds for all kinds of links.

The general consensus was that the line quoting feature is useful, while the other embeds like gists, commits and PR embeds are annoying and cumbersome. They might offer some info, but usually these links are posted to be clicked on in the first place so the embed isn't really that useful, they take too much space for what they offer ad interrupt the flow of the conversation with big bulky info.

So basically the feedback is that the line quoting feature is neat but all the other embeds make it annoying enough for people to not want it on the server.

If you remove those things and just keep the core feature of quoting lines I would be very happy so we can keep the bot, but I can understand if you don't want to cut features you have worked on.

I personally feel they would be good as optional additions, but since the bot doesn't have a database, you either get all the features or nothing, so in this case I would gravitate towards making the bot only do one thing well.

Let me know what you think

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.