Git Product home page Git Product logo

sili-telegram-bot's Introduction

Hi there 👋 I'm Tobias 👨‍💻

A fullstack developer and devops guy from Germany.

 

🔑 GPG: 0x4b7228cfe59b7380

📃 Resume

sili-telegram-bot's People

Contributors

1joghurt avatar cormochamelion avatar dependabot[bot] avatar eixix avatar hansliboy avatar jonasfreimuth avatar mrsonjoe avatar sirtrisdem avatar themrjonny avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar

Watchers

 avatar

sili-telegram-bot's Issues

Auf den einzelnen Spieler herumhacken

Bsp.:
Michi spielt oracle ---> "hat die Flexibilität einer Tomate bewiesen"
Cormo spielt Jakiro --> " - üüüüberraaaschung - " + Punchline
Cormo spielt Ogre ---> " ist doch auch nur nen Jakiro "

Debugging match data

I feel for doing delicate little changes there should be a straightforward way to create debugging matches to use methods on...

Voicelines are not delivered in group chats

After entering a valid voiceline command, the command message is deleted, however the actual voiceline is not actually delivered. Other behaviour such as the help messages are not affected.

My theory is this has todo with the message deletion...

Heldenspezifische Punchlines

evtl in Abhängigkeit der Spielleistung
Bsp.: Omniknight: "hat die Gegner in den Boden gehämmert"
Lion: "mehr gefingert als im Puff"
Riki: "hat nochmal versucht, cloak and Dagger zu lernen"
"hat verschwindent impact gehabt"
"die Gegner haben ihren Tod nie kommen sehen"

Voicelines may break soon, wiki has been migrated

The DotA2 wiki has migrated to liquipedia (Official announcement).

Retrieving voicelines works by finding the appropriate voiceline on the wiki page of the hero in question, scanning the html of that page for the voiceline text, and then delivering a link to the corresponding audio file. With the new host and possibly changed html layout, changes will be necessary to continue this feature.

Hard-coded host:

base_url = "https://dota2.fandom.com/wiki"

Indiviual hero url:

self.response_url = f"{base_url}/{self.hero}/Responses"

CSS selector for finding voiceline text:

self.vl_tags = self.soup.select("#mw-content-text h2~ ul li")

Pun line "nicht schlecht gespielt. ich sags wies Is." has issues

Wrong section

The punline is currently in section for meme constant "1" but describes a positive outcome. It should probably go in section "2".

Ends in period

This doesn't match with how the punlines are integrated into the message, as currently punlines are not supposed to be separate sentences.

Missing capitalization

Start of second sentence is not capitalized.

Besondere Erwähnung bei einer Rampage

einfach eine besondere Erwähnung bei einer Rampage!
Wie z.B.:
" hat das ganze gegnerische Team im alleingang in Grund und Boden gestampft! Warum ist er nur Crusader?"
" hat allein alle fünf Gegner zu Kleinholz verarbeitet!"

Voiceline matching fails when vl text contains links

When the text tag being matched contains a link, the heuristic for getting the voiceline no longer works as the text is broken up by a link element.

if regex.search(line_re, tag.contents[-1].text.strip()):

Reprodicible example

/voiceline Rubick: Oh. Shitty wizard! (Link)

--> No voiceline will be found.

Proposed solution

Use all text in the tag in question for matching. Slight performance penalty because we have to potentially do this for each voiceline tag of a hero, but necessary I think.

Users without a (public) telegram user name cannot use voicelines

The voiceline command attempts to send a message of the initiating user's telegram username in order to let others know who came up with the masterpiece of comedic timing in question while not polluting the chat with ugly commands.

context.bot.send_message(
chat_id=chat_id, text=update.message.from_user.username + ":"
)

However the update.message.from_user.username field may be empty when a user has no user name (or possibly is choosing to keep it private). In that case update.message.from_user.username is None, and the operation fails, aborting the whole voiceline operation.

Proposed solution

Have a hierarchy of fallback options for attributing the voiceline, so that if one is unavailable, we can still have the attribution.

I'd go with: username > first name (maybe last name, if available) > User ID > "Unknown User".

Obviously I don't know which of these are available when, so I need to double check the docs. If I did, this problem wouldn't exist.

MemeTeamGenerator

Für DoDos oder DOMiNas der einem coole meme strats vorschlägt. Die Captains schreibt ihm dann privat und er antwortet mit entsprechender Strategie oder halt öffentlich in der SiliGruppe. Der Bot müsste halt dann auch darauf achten kein hero doppelt zu vergeben oder die strat ein bisschen aufzuweichen

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.