Giter Site home page Giter Site logo

spritebot's Introduction

spritebot

SpriteBot

Setup

This project uses poetry to handle dependencies

Make sure you have python installed. Then, in a terminal window, run:

pip install poetry

Then install the dependencies with poetry:

poetry install

Next make a file at the root of this project called .env file to store the bot secret in (instructions on how to set up a bot and get the bot secret here). The contents of the file should look like this:

BOT_SECRET=SECRET-GOES-HERE

Also, make sure that the intents are enabled on the bot (or else it will be grumpy and die when it tries to run):

Running

Run the following command in terminal:

poetry run python src/bot.py

Troubleshooting

(todo: add troubleshooting section)

spritebot's People

Contributors

greystorm101 avatar matirko avatar

Stargazers

 avatar

Watchers

 avatar  avatar

spritebot's Issues

[style/doc] Update README.md

The readme is bad. Needs:

  • Better documentation on what spritebot is/capabilities
  • Setup
  • Maybe contributing guidelines/links?

[feature] implement command tree and slash commands

Like in this example, implement command tree into the bot. This will give us a bunch of benefits:

  • slash command integration that will allow users to autocomplete commands
  • ability to send messages ephemerally
  • ability to display help for commands easily (will need to be restricted so only certain roles can see the command)

Cache managment

For performance reasons we cache gallery posts in a list so that finding matching (or no matching) gallery posts is not slow. It takes about 2 minutes to fill the cache, but depends based on the number of posts in the given timeframe.

We want to figure out a way to maximise time saved and space used

[feature] Add spritetrades/mini contest support

Add a bot command that facilitates a sprite trade between users.

Ideally, one user would initiate the command, another would react to "accept" it, then zigzag would prompt both users to enter their fusion to trade.

[fix] Fix spritebot's thread fetching algorithm

Unfortunately, discord.py's API does not allow us to fetch archived threads from oldest to newest (i.e. oldest_first is not a valid argument). This limitation looks like it comes from discord's api directly, so I don't think we can work around this. However, we could make use of the before field, which only fetches threads before a certain date.

Additionally, for performance reasons, the bot only fetches 100 archived threads at a time. Those threads may or may not have a "needs feedback" tag. This means running the command could return anywhere from 0 to 100 threads.

The scraping algorithm should be updated to something like this:

start_before = SOME_DATE #This could be an optional input arg
archived_threads =spritework.archived_threads(limit=100, before=start_before)

num_feedback_threads = 0
for thread in archived thread:
      if needsfeedback in thread.applied_tags:
            num_feedback_threads += 1
            .....
      if num_feedback_threads == 10:
            print("Found 10 threads")
            break

if num_feedback_thread == 0:
     print("No threads found, run again to search farther back")
     
start_before = thread.created_at #Cache this date for the next run

[feature] add swablu warning command

Add a command that sends a DM to a user with the below content. It should take the username and a link to the sprite gallery post as an input.

The command will need to make sure the DM was able to be sent (in case the user has Zigzag DM immunity/blocked Zigzag/is a deleted user), and alert the command issuer if there was an issue.


Hello,

We were unable to find a feedback post in https://discord.com/channels/302153478556352513/1050404143807873157 for your sprite-gallery post: .

If this is a mistake:

Please ping Swablu (spritework checker) in the corresponding spritework post.

If this is NOT a mistake:

This message is considered an official warning. You must make spritework posts for sprites before you post them in the gallery. Repeate offenses may result in the loss of your spriter role


[feature] Add stale thread refresher for pinned guides

The following pinned threads all archive after ~30 days of inactivity, and then they no longer show up as pins. Make a periodic job that runs every ~20 days (or some similar interval) to refresh the thread.

Sprite resources:
https://discord.com/channels/302153478556352513/1051343819314053160

PIF project hub:
https://discord.com/channels/302153478556352513/1110680705018646658

Spriter app guidelines:

https://discord.com/channels/302153478556352513/1136803101655969904

Sprite error guidelines:

https://discord.com/channels/302153478556352513/1054132557702246461

Showdown bugs pin:

https://discord.com/channels/302153478556352513/1175120308445909063

[enhancement] Respect Yanmega Immunity

Currently, users who do not want their sprites to be harvested can give themselves the "Yanmega Immunity"role (Yanmega being the name of the YAGPDB bot currently in the server) and the gallery posting/harvesting bot will not be able to post their sprites.

Spritebot should not harvest/post sprites from anyone with a "Yanmega Immunity" role, and the sprite manager/zigzagoon should be made aware that they will be unable to post that user's sprites on ZigZag's initial dig results.

Additionally, as a longer term nice-to-have, it would be nice to add a react-for-role feature to allow users to have a "Harvest Immunity" role, since "Yanmegga Immunity" covers every interaction with the YAGPDB bot and not just sprite harvesting.

[request] Dockerize project

Based off of the general scope of this project (a bot for the sprite channel on Discord) it would be helpful if this was available in an easily-accessible docker container. This would avoid installing any dependencies other than docker, and provide a quick way to get up and running with the project.

(raising this issue as a TODO marker so that we don't forget)

Allow manual galpost/noqa commands

Similar to the current galpost and noqa commands.

  • galpost imgnum FusionHead FusionBody OptionalDesc
  • noqa imgnum FusionHead FusionBody OptionalDesc

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.