peterbuoy / abyssal-discord-bot Goto Github PK
View Code? Open in Web Editor NEWThis bot manages Abyssal / Azurlane guild activities. This bot is meant to replace the KCAZDiscord bot that originally supported the guild.
This bot manages Abyssal / Azurlane guild activities. This bot is meant to replace the KCAZDiscord bot that originally supported the guild.
Solution is to add error handling to not execute certain code if certain messages do not exist in #node-war-signup.
If you never need to move the bot this is a non-issue.
Hence, fairly low priority.
The current implementation of war-stats simply checks for ID's in the jsonb file.
We should make it so that the command only considers current members as valid data.
The bot logs that they are valid AB members that have clicked the sign up emoji, but they are not present in the jsonb file.
When a guild member is removed, try to only remove the values in column A to column W instead of deleting the entire row.
This is EXTREMELY low priority or potentially a nonissue.
Currently, there are formulas after row W that get deleted since we delete the entire row. These are nonessential columns that calculate ap/aap/dp/lvl gained since their first recorded gear update. These formulas can be manually inputted after.
These columns with formulas are only used with the unimplemented %info command, which may be implemented at a later date
To reiterate: not a big deal
Tagging a user as ab/az while already having them in the sheet causes them to be added twice.
This causes sheet operations to break.
This is extremely rare as detagging will remove them from the sheet. It's possible that someone can be detagged while the bot was down, but then retagged when the bot went up. This would result in user duplication.
Potential solution is to purge the sheet by id before adding them.
fixed in 1c9e94d
it should probably just be a self contained function with no arguments.
This will make it a lot easier to switch between databases/sheets when moving between development and production
Rewrite sheet operations to do cell level operations
When users use the %join command the bot should explicitly tell them that they just need their family between angle brackets, <family_name>.
If the name is incorrect, only apply a 5 second cooldown.
This likely requires significant logic changes in %join since it will likely have to bypass the 60 second per user cooldown. %join works on the assumption that the command can only be called every 60 seconds.
Likely need to just remove the global cooldown and implement your own.
Need to reproduce and check code
e.g. someone lists their class as Drakonia instead of Drakania
fixed in 89cbc45
This should inform us if for some reason the member has the ABAZ tag but is not in the google sheet.
Use supabase for persistence layer.
It should contain the user ID and the timestamp at which they received the tag.
Use application layer to periodically poll Supabase.
It should do a SQL delete query based on the timestamp, which will return the rows that have timestamps older than 72 hours (or whatever the number deletion date is declared as in the code (use a variable). These rows will contain the userID which can then be used to find the user and remove the pending AZ tag.
Not sure how it will handle multiple people clicking at once LOL
If embed values are empty it results in a Discord API error
Examples:
gear update and node war signups
use hard coded values for now instead of the google sheet values
GIVE THE PEOPLE WHAT THEY WANT!
This is intentional by design.
The bot should not need to be restarted that often and one can always check if there is an active gear request.
Adding a listener will lead to some indirection so that's a tradeoff for persistence.
Command should list all AB members ordered by the date of their most recent attended war and state how many wars they have attended in the past 30 days.
Refer to the SQL editor in supabase for implementation details. Once that is done we can use that query to get the data and send it as a discord message via the bot. This will likely take two queries due to the nature of the requirement.
this information should inform people trying to sign up as to why nothing happens when they click the emoji (could be low gs or no pvp proficiency)
Not important Anyone that wars is vetted anyway
This takes the load off of officers to check if the aforementioned information is missing from the gear request.
Also makes it less likely for undefined variables to affect other parts of the code base.
Hard code a maximum value of days such as 90 days.
Having an empty string in the Discord UserID column causes the bot to try to parse the empty string, which creates an undefined variable during code execution. Empty strings are created by deleting the cell values but not the rows themselves.
A temporary fix is deleting these rows. A better fix would be to fix the detection of a populated row, which would mean that a populated row must be defined as a row where the Discord UserID column has some kind of string in it (and not an empty string).
Potential solution: knowing that Discord UserID has a specific format (it's a snowflake), you can just check for a length of string and perhaps regex to only grab digits instead of just checking for an empty string.
try catch any bulk deletes and do a manual fetch and delete to make sure it doesn't crash the process
Have it poll the sheet infrequently, but work off of the GUILD_MEMBER_UPDATE event to change the count immediately upon tagging or untagging.
lol, going to have to paginate this and maybe add more list_msg_id columns to the database.
We're going to have 4 msgs for the war signup list, which can support around 108 signups. There can only be at most 100 signups so this is ok.
Likely can do something like, for the first 25 members, put them in the first message, for the next 25 members. put them in the 2nd message, etc. Have to keep track of how many members have been put into the list. This will determine when the pagination happens.
Editing will be the same.
"Is it possible to add an admin-only command that doesn't appear in %help that simple lists out who has NOT attended a war in 30 days?"
Note:
When the bot is restarted, the jsonb column, signuplist, in the warsignup table is mostly wiped clean.
extremely low priority. normal bot functionality doesn't really require a database. Any further edits can be unironically tested in production.
completed
2ed8d53
When a user signs up for war their gearscore, family name, and class values must be populated.
If they are empty, then there should be a message that indicates that they need to complete a gear update before signing up for nodewar.
Add AZ officer role to config.ts as role_az_officer
Mention AZ officer role in AZ member message in #welcome
It would be helpful to mention the user in the confirmation message.
Additionally, it would handle an edge case where the user deleted their %join
message, which would make it difficult for staff to determine who joined.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.