StampyAI / stampy

A Discord bot for the Robert Miles AI server

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Pull unasked questions from coda to ask on Discord

plexish opened this issue · comments

commented

We'd like the bot to pull unasked questions from coda to prompt discussions.

Unstarted from this table: https://coda.io/d/AI-Safety-Info_dfau7sl2hmG/Write-answers_suuwH#Write-answers_tu4_x/r54

Pull the question with the oldest AskedOnDiscord field (random if multiple), post the title of Edit Answer to #general along with the Gdocs link which is the link of Edit Answer, then set that AskedOnDiscord to Today(). I can make a new view on the data which provides Name and Link easily enough if that's helpful.

For context, we want the discord bot to regularly post questions into discord, to stimulate discussion and collaboration. This used to be done using questions from youtube and from the wiki, but that functionality is currently disabled. Also it was some of the first functionality the bot ever had so it is not implemented in the way modern bot functionality is meant to be implemented. Specifically it doesn’t really use the module system, most of the code is in utilities.py (functions like get_question), and in discord.py (on_socket_raw_receive has functionality about when to post new questions), neither of which places it really belongs. Most of this should live in a new module, QuestionManager, using the module’s tick function with utils.rate_limit() etc to decide when to post, and handling interacting with coda’s API internally. This is basically a total replacement for the current QuestionQueueManager, so it can replace it in questions.py. Also, wikiUtilities.py and wikiUpdate.py can go away in favor of new coda stuff.

Functionality it should have:

  1. Can be asked for a new question to answer
  2. Will post new questions autonomously if nothing has been said in #general for long enough (and people have said something since the last time it asked a question). This functionality should be the same as the code in on_socket_raw_receive in discord.py
  3. Posts a link to the Gdoc along with the title
  4. Stretch: Asking for specific types of question, like “answer in progress”
  5. Related to 4: Can post In-progress answers (https://coda.io/d/AI-Safety-Info_dfau7sl2hmG/Improve-answers_suxEW#_lu2ln) and include the current text of the answer
  6. Stretch: Can give stats about how many questions there are etc. QuestionQueueManager could do this, but it’s not a key feature