Coder Social home page Coder Social logo

tylertian123 / ryver-latexbot Goto Github PK

View Code? Open in Web Editor NEW
2.0 2.0 0.0 474 KB

LaTeX Bot for Arctos' Ryver organization.

License: MIT License

Dockerfile 0.24% Python 96.15% JavaScript 2.59% HTML 1.03%
bot first-robotics-competition google-calendar latex ryver ryver-task

ryver-latexbot's Introduction

Hi, I'm Tyler

Third year Engineering Science student at UofT, Robotics Major (2T5).

Software Lead of the SAE Aero Design competition team at UTAT UAS (University of Toronto Aerospace Team, Unmanned Aerial Systems Division).

Ex-Software Lead for FRC Team Arctos 6135 from 2018-2020.

I've also made minor contributions to open source projects such as wpilibsuite/shuffleboard and naco-siren/vscode-gradle-language.

ryver-latexbot's People

Contributors

mincrmatt12 avatar tylertian123 avatar

Stargazers

 avatar  avatar

Watchers

 avatar  avatar  avatar

ryver-latexbot's Issues

Command aliases

Add support for potentially configurable command aliases to reduce verbosity. E.g. "answer" as an alias for "trivia answer", "count" as an alias for "countMessagesSince", etc. It should work like how aliases work in git.

checkiday.com integration

The API endpoint is at https://www.checkiday.com/api/3/?d=YYYY/MM/DD. This could be incorporated as a part of the daily message.

404 Not Found sometimes when attempting to get the chat message by ID

  File "./latexbot.py", line 1221, in _on_chat
    result = await command_processors[command][0](to, msg['key'], args)
  File "./latexbot.py", line 1009, in _importconfig
    msg = (await chat.get_message_from_id(msg_id))[0]
  File "/usr/local/lib/python3.8/site-packages/pyryver/objects.py", line 451, in get_message_from_id
    async with self._ryver._session.get(url) as resp:
  File "/usr/local/lib/python3.8/site-packages/aiohttp/client.py", line 1012, in __aenter__
    self._resp = await self._coro
  File "/usr/local/lib/python3.8/site-packages/aiohttp/client.py", line 588, in _request
    resp.raise_for_status()
  File "/usr/local/lib/python3.8/site-packages/aiohttp/client_reqrep.py", line 941, in raise_for_status
    raise ClientResponseError(
aiohttp.client_exceptions.ClientResponseError: 404, message='Not Found', url=URL('https://arctos6135.ryver.com/api/1/odata.svc/forums(1241536)/Chat.History.Message(id='00735081593093242880',before=0,after=0)?$format=json')

First occurred when processing this command:

@latexbot importConfig {
"admins": [
1311906,
1605991
],
"organizationTimeZone": "EST5EDT",
"homeChat": "Test",
"announcementsChat": "Test",
"messagesChat": "Test",
"googleCalendarId": "[email protected]",
"dailyMessageTime": "23:28",
"lastXKCD": 2304,
"commandPrefixes": [
"@latexbot ",
"!l "
]
}

Add a moveConversation command

A new "move conversation" command should be added. This should take a number of messages, and "move" those messages to another forum or team. The messages can be sent with the creator overridden so the sender info can be kept.

Re-design sleep command

The sleep command should not simply use time.sleep() as this suspends the entire program, making latexbot unable to do other tasks such as daily message processing. The sleep command should utilize the enable/disable features instead, and feature more control over the sleeping, with a potential wakeup command.

Role-based access control

Add the ability to give certain users access to commands by having a specific role. It would be nice if this could fit into the current strictly hierarchical access control system, but if not it contains enough functionality to replicate this behavior.

moveMessages cannot move more than 25 messages at a time

When attempting to use @latexbot moveMessages to move more than 25 messages at a time, the request to get the messages results in a 400 Bad Request, with the message

39: This value should be 25 or less. (code 2d28afcb-e32e-45fb-a815-01c431a86a69)

This should be fixed or at least documented.

covid command

The covid command should display COVID info such as total cases, daily cases and maybe a graph of cases.

Shorter help

Shorten the output of the help command (general) because no one has the time to read through an entire page of output. Perhaps only show commands that the user has access to.

Optimize deleteMessages

deleteMessages could use the power of asyncio with multiple tasks to be significantly faster.

Add roles

Roles should be ping-able through LaTeX bot.

Twitter scraper

It'd be nice for the bot to automatically detect new tweets from @FIRSTweets and @CanFirst and send a message to Off-Topic for each tweet.

whatIs command

The whatIs command should pull the first paragraph of the Wikipedia page for a given thing.

Scouting organization helper

What if we assigned each scout their teams beforehand and somehow get latex bot to connect to blue alliance and grab the matches and each scout can take like a 5 second data thing (a lot of people probably have personal data just not a lot) and they could do something like scoutMatches and it gives you your matches and u can screenshot ur matches and now u have it for the entire comp

Potential bug with moving messages and images

An exception occurred while processing command !l moveMessages 14 +OffTopic in General:

Traceback (most recent call last):
  File "/usr/src/latexbot/latexbot/latexbot.py", line 615, in _on_chat
    if not await self.commands.process(command, args, self, to, from_user, msg.message_id):
  File "/usr/src/latexbot/latexbot/command.py", line 163, in process
    await cmd.execute(args, bot, chat, user, msg_id)
  File "/usr/src/latexbot/latexbot/command.py", line 131, in execute
    await self._processor(bot, chat, user, msg_id, args)
  File "/usr/src/latexbot/latexbot/commands.py", line 1224, in command_move_messages
    await to.send_message(current_message, current_creator, msg.get_attached_file())
  File "/usr/local/lib/python3.8/site-packages/pyryver/objects.py", line 1189, in send_message
    async with self._ryver._session.post(url, json=data) as resp:
  File "/usr/local/lib/python3.8/site-packages/aiohttp/client.py", line 1124, in __aenter__
    self._resp = await self._coro
  File "/usr/local/lib/python3.8/site-packages/aiohttp/client.py", line 632, in _request
    resp.raise_for_status()
  File "/usr/local/lib/python3.8/site-packages/aiohttp/client_reqrep.py", line 1000, in raise_for_status
    raise ClientResponseError(
aiohttp.client_exceptions.ClientResponseError: 400, message='Bad Request', url=URL('https://arctos6135.ryver.com/api/1/odata.svc/forums(1059415)/Chat.PostMessage()?$format=json')

It seemed to have died on a message with an attached image. Further investigation is required.

Use file attachments to import/export JSONs

Configurations and roles JSONs could get long enough to exceed Ryver's message character limit. it would be nice to import/export them through file attachments instead of plaintext message to get around this limit. However, this relies on pyryver to add this functionality first.

dailyMessage command

Add a command that performs the daily message routine in case it was missed for whatever reason.

pin command

A command to "pin" messages by remembering them and sending them back again when requested.

poll command

Add a new command poll <endtime> <description> <option1> <emoji1> [<option2> <emoji2> [<option3> <emoji3> ...]] which creates a poll. At the end of the poll the result should be reported via a message to the original chat the poll was in and a DM should be sent to the poll creator about the poll result as well.

Add configurable opinons

Add an "opinions" object in the JSON config, which allows the overriding of whatDoYouThink for specific things.

Avatars getting reset

Cached user avatars sometimes get reset to None after a while. This only seems to be an issue in 0.9.

Render command broken

Render command breaks with @latexbot render \displaystyle\int_a^x f'(t) dt = f(x) + C:

  File "./latexbot.py", line 1187, in _on_chat
    result = await command_processors[command][0](to, msg['key'], args)
  File "./latexbot.py", line 115, in _render
    img = quicklatex_render.ql_render(formula)
  File "/usr/src/latexbot/quicklatex_render.py", line 8, in ql_render
    return p.stdout.read().decode("ascii").split()[1]
IndexError: list index out of range

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.