armandbriere / archy Goto Github PK
View Code? Open in Web Editor NEWServerless discord Bot in Golang and Python with Google Cloud
Home Page: https://archybot.web.app/
License: GNU General Public License v3.0
Serverless discord Bot in Golang and Python with Google Cloud
Home Page: https://archybot.web.app/
License: GNU General Public License v3.0
Is your feature request related to a problem? Please describe.
The bot is on multiple servers but there is no way to see that on the web page
Describe the solution you'd like
Python is slow, golang is better
Refactor the python src/functions/help
cloud function to Golang.
Is your feature request related to a problem? Please describe.
The !
is nice but the future of discord bot is in the slash commands
Describe the solution you'd like
We need to modify the main node to use slash command:
Python is slow, golang is better
Refactor the python src/functions/hello
cloud function to Golang.
A good .vscode/extensions.json
would help new developers to work on the project
We need extensions for the following thing :
Is your feature request related to a problem? Please describe.
Python testing and mock is complete, we need the same for Golang
Describe the solution you'd like
exp
function has some tests, but we are not mocking Firestore callsPython is slow, golang is better
Refactor the python src/functions/describe
cloud function to Golang.
Is your feature request related to a problem? Please describe.
We have ranks and level, we want to associate special role to a level
Describe the solution you'd like
We have cloud functions that are written in Golang, we need to add unit test and run those test in the CI
Golang mock needs to be looked at
Right now, we only have a few integrations tests to run manually
Is your feature request related to a problem? Please describe.
The rank is the core feature of the bot right now, having a nice image to display instead of the text from the level
command would be nice
Describe the solution you'd like
Generate dynamic image from the firestore data, should be done in python with PIL or using image2PDF (or something like this, the project is no longer maintained I think)
https://github.com/vgalin/html2image
Some design template could be done before starting this feature, the work would be considered a POC if done before the design template
Is your feature request related to a problem? Please describe.
We have a list of all functions in the firebase with a active
boolean var, we want to use it in the main node to activate/deactivate command
Describe the solution you'd like
Python is slow, golang is better
Refactor the python src/functions/answer
cloud function to Golang.
Is your feature request related to a problem? Please describe.
The database that we used had message_count
attribute before, the exp function should increment this variable only once every minute
Describe the solution you'd like
add this code to the exp
function at the proper place
batch.update(doc_ref, ({"message_count": Increment(1)}))
Python is slow, golang is better
Refactor the python src/functions/exam
cloud function to Golang.
Is your feature request related to a problem? Please describe.
Right now, when we use !gif cute cat
it only uses cute
as the search param and not cat
Describe the solution you'd like
Concat the params in the gif
fonction code with space and url-encode it
A new command that returns all currently enabled commands would help user interaction
We need to find a way to check what functions are deployed and which one are not, this can be done via Firebase or just in code
In the long term it would be good to enable and disable commands using an admin panel in the web page. You can keep that in mind while thinking of a solution
We want Archy to greets new users
Is your feature request related to a problem? Please describe.
We need a dev env to test code before merging it to prod
Describe the solution you'd like
dev env is the development server
prod is the other servers
We need a new git flow to code, merge and contribute to the project
Update terraform to create dev functions and prod functions by using prefix name
Auto deploy to dev
on merge to that branch (same for prod and the main
branch)
Concerning the main node, we might need a new Discord token to create Archy-dev
or we can just rely on the server ID before calling cloud functions
Add translations in french and english to accomodate our target audience.
Documentation available here.
Is your feature request related to a problem? Please describe.
Exp function is a http one, we need it to be a pubsub
Describe the solution you'd like
Change exp/main.py
, unit tests, terraform and main node code
Is your feature request related to a problem? Please describe.
The !froge
command return a random froge, a gif can be selected and the current .png
extension breaks it
Describe the solution you'd like
Change the code to identify if the selected froge emoji is a gif
or a png
and change the image extension
A default integration test could be added with a small gif in base64, like the image
Describe alternatives you've considered
Maybe the extension isn't required, maybe check that first
Is your feature request related to a problem? Please describe.
Those are the action needed when Archy is added to a new server:
/serverList
collection
member_count
server_icon
server_id
server_name
Describe the solution you'd like
Find a way to automate all those steps
Since we are using python typing to improve code quality, it would be good to have tox
notifying developers when typing is missing
Pylint or maybe some other python module could provide that
Example:
def hello(name):
return f"Hello {name}"
This code should look like this:
def hello(name: str) -> str:
return f"Hello {name}"
Is your feature request related to a problem? Please describe.
!level @userwithoutavatar
-> This is broken
Describe the solution you'd like
The level.go
file is the problem on the regex
re := regexp.MustCompile("avatars/(.*).png")
var subMatch = re.FindStringSubmatch(user.AvatarUrl)
if len(subMatch) < 2 {
re := regexp.MustCompile("avatars/(.*).gif")
subMatch = re.FindStringSubmatch(user.AvatarUrl)
}
user.AvatarId = subMatch[1]
The subMatch[1]
result in an index out of bound, this need to be fix
The "describe" function is a small python code that needs testing
Read the testing documentation in src/README.md
, these tests would be similar to test_hello.py
Is your feature request related to a problem? Please describe.
We write more and more Golang but we are not that good. A linter in ci will make the code better
Describe the solution you'd like
Add this to the project https://github.com/marketplace/actions/run-golangci-lint
We want to use their runner directly
We also want to have a link in our readme on how to run the linter locally
Python is slow, golang is better
Refactor the python src/functions/generateWelcomeImage
cloud function to Golang.
The web part was done as an example and a template
We need a good documentation on how it works and how to contribute
Is your feature request related to a problem? Please describe.
Right now we have one scheduler per server on Google cloud, we want the same scheduler for the whole bot with only one Froge of the Day
Describe the solution you'd like
Is your feature request related to a problem? Please describe.
The nextJS handling dynamic image generation isn't linked to terraform
Describe the solution you'd like
terraform plan
Python is slow, golang is better
Refactor the python src/functions/frogeOfTheDay
cloud function to Golang.
This command will translate the desired sentence in the language indicated.
Ex.: !translate French Hello, How are you?
-> Bonjour, Comment vas-tu?
Should use the google translate api or the DeepL Api.
Is your feature request related to a problem? Please describe.
We need an admin panel to interact with Firestore database
Describe the solution you'd like
Is your feature request related to a problem? Please describe.
Right now we are using discord CDN of their emoji, if the emoji is modified on the discord server it belongs to, we lose it
Describe the solution you'd like
We need a solution to store image in the cloud that can be pull easily without a download process like what's available on Firebase Storage
Command that returns a custom generated meme from user selected parameters.
This command will use the IMGFLIP API.
Is your feature request related to a problem? Please describe.
A clear and concise description of what the problem is. Ex. I'm always frustrated when [...]
Most students are only interested in the course channels related to the course they are taking. Showing up in a server with tons of channels and having to mute all of unwanted channels might discourage newcomers to engage in the server.
Describe the solution you'd like
Describe alternatives you've considered
None
Additional context
Example
Is your feature request related to a problem? Please describe.
!level function is really slow because we start a headless chrome with the html content and then take a screenshot
Describe the solution you'd like
We might be able to use https://vercel.com/docs/concepts/functions/edge-functions/og-image-generation
This will allow us to have a dynamic url link where we just need to pass the data and retrieve the image in base64 or the link directly
Is your feature request related to a problem? Please describe.
We need a way to know when a cloud function or any ressource is being deployed
Describe the solution you'd like
Let's create a cloud function like cloudErrorLog
that will track deployments log on the cloud and send us a discord message on the dev server
Is your feature request related to a problem? Please describe.
We have no way to know what are the role to level value on a given server
Describe the solution you'd like
A go function that returns the list in a formatted way, something like the !help command
Is your feature request related to a problem? Please describe.
There is no current way to get the leaderboard URL
Describe the solution you'd like
New cloud function written in Python with unit test that returns the current server leaderboard url
Command could be !leaderboard
Describe alternatives you've considered
The URL could also be added to the !level
command but it wouldn't be nice
Python is slow, golang is better
Refactor the python src/functions/gif
cloud function to Golang.
The exp
function trigger pub/sub
event when a user level up
The server name should be added to the message
Is your feature request related to a problem? Please describe.
We want user to login with Discord on the web page
If they are admin of the server, they can modify some of the bot behavior
Describe the solution you'd like
Implement Oauth2 of discord and store user info in the cookies/session storage
Command that returns an insult to the user tagged or the author using this Insult API.
This command will ultimately be able to insult multiple people at a time and will support custom insults.
Python is slow, golang is better
Refactor the python src/functions/flag
cloud function to Golang.
Is your feature request related to a problem? Please describe.
Level returns an URL to og-vercel cloud function.
Download the image inside the cloud function and returns the base64 image to the main node
This will decrease the number of call to the og-vercel function
Describe the solution you'd like
og-vercel
function from level
functionIs your feature request related to a problem? Please describe.
The current implementation doesn't allow for multiword parameters. This is blocking progress for #64.
Describe the solution you'd like
Is your feature request related to a problem? Please describe.
We need a pub/sub cloud function that add a Discord role to a user
We need a pub/sub cloud function that remove a Discord role to a user
Describe the solution you'd like
Golang cloud function with cmd/main.go
for manual integration test
Is your feature request related to a problem? Please describe.
We need a way to activate or deactivate a command by switching the boolean value in firebase
Describe the solution you'd like
A new command that would take a command name and a boolean (admin only)
We will also need an other command to disable all specified commands. In case a new deployment breaks a specific command, we need a fast way to disable that specific command on all the server
This command should only be working on the development server and only by contributors
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.