makigas / makibot Goto Github PK
View Code? Open in Web Editor NEWBot de Discord para moderar y mejorar nuestra comunidad en línea.
Home Page: https://makigas.github.io/makibot
License: ISC License
Bot de Discord para moderar y mejorar nuestra comunidad en línea.
Home Page: https://makigas.github.io/makibot
License: ISC License
dsc.gg cloaks Discord invites. They use JavaScript redirection rather than a 302, so it might not trigger the antispam system.
Add it here to this array
Caso de uso 1: un usuario no quiere participar en el sistema karma, de modo que lo desactiva para que no se cuenten sus mensajes.
Caso de uso 2: moderación desactiva el sistema karma a una cuenta si considera que está utilizando de forma sospechosa el sistema de karma para abusar de sus mecánicas.
En ambos casos,
I mean, clearly there is a pattern. 👋
Is your feature request related to a problem? Please describe.
After merging #151, the bot is more resilient to errors. Whenever the bot disconnects, the Docker engine will restart the bot very soon in order to make it work again. However, this doesn't mean that users are automatically approved. If the user attempts to type !accept during the downtime of the bot, the user won't be accepted yet. At the moment, this is solved by manually approving the user after the bot gets alive again.
Describe the solution you'd like
The bot should look for recent messages received in the captchas channel and approve those users who verify the following rules:
!accept
, as usual, or whatever keyword in use.Describe alternatives you've considered
Doing this manually, but it is pain.
Commit 7bdd695 added logic to the antispam system so that it would delete messages sent by members with the links-disabled role containing links.
The next step is to automatically add members to this role if they match some criteria. It is always possible to remove this role later if they are found to be safe. Automatic karma could even do this once a member reaches level 2. Interesting heuristics to use:
twitch
, YT
, YouTube
.Dockerfile is currently a mess, basically because I built it back when I did not know much about Dockerfiles. Known issues:
The goal is to have a way to let users know that:
It is important to make clear that opening a PR for features that hasn't been priorly discussed yet and that they come as surprise presents is unpleaseant because someone will have to maintain that code and it may be outside the project roadmap.
Words opress me.
Also should follow my default conventions at danirod/dotfiles@cfd44da.
Tracking issue. Requires reading.
When the 🗑️ emoji is used to delete a priorly wanned message, the bot should send anotice into the private moderation log to mark the warned message as deleted. This should be done to indicate other moderators that the message was deleted, to avoid having them click the message and wonder where it is, or to avoid them spending time thinking if it's worth keeping the warned message or not if another moderator has already chosen so.
Related to #35.
Add a system to godfather trusted accounts (based on tags or roles). Let the bot look away when inspecting a message if the poster is a trusted account.
Example use case: someone who has been in the server for a month and that is very active may post a link to a Facebook page organically rather than for purposes of doing spam. In such case, having a way to tag (either manually or as part of the karma system) a user as a trusted one so that the message can be posted anyway would be good.
tslint is deprecated.
Currently work is done in Makibot.js. Although this made a great proof of concept, if the bot has to pass the PoC stage, commands should be split in class objects, and there should be some structure so that new commands can easily be added and existing commands can be modified as well.
Useful patterns:
If a moderator kicks an user, Clank should send a ModlogEvent into the private modlog channel indicating that the user has been kicked from the server. Additionally, if the mod provided a reason to Discord when issuing the kick, the reason should be logged in the message as well.
The reason is that, seeing why a user was kicked is difficult because it requires opening the audit log in the server settings, plus it is difficult by itself because you might not know that an user was kicked unless you actually reviewed the audit log itself.
Se sigue haciendo el INSERT como siempre, pero en el SELECT COUNT se cambiará la query SQL por una que limite el puntaje máximo a sumar en el COUNT a 100 por día, reiniciando en la medianoche UTC.
To avoid being very noisy, Clank should reply the user using DMs instead of publicly mentioning the user in the channel the user typed the message in.
In some cases, such as when triggering the !helper
command, Clank may attempt to automatically delete the triggering message to clean up the conversation.
Discord.js-Commando provides a settings provider based in a JSON schema that is dumped into a row of an SQLite database.
This is good but I'm cheating a lot by adding a lot of keys, thus it is difficult to scan the JSON document.
This may be better in a custom Setting Provider that stores each item in a database row, maybe allowing for the extra cheats that I use.
An example schema:
Bot presence is a debug command that should be removed once it's not needed. The bot should always be available in production. There are better ways to mark the bot as in maintenance mode, which should be explored.
A command may query for videos added to the database.
!videos [query] (see examples 1, 2)
!video [videoID] (see example 2)
An alternate representation for makigas:video, makigas:playlist and makigas:topic objects was proposed on makigas/makigas.es#75. Although the permalinks are not clear at this moment, it would be possible to get feeds and structured metadata about items on URLs such as https://www.makigas.es/videos.json or https://api.makigas.es/v1/videos.json. This permalink would emit a JSON object the bot can digest. All the heavy load of the query is done by makigas/makigas. This command's scope is limited to sending the proper query to the website and rendering the results.
danirod: !videos flatmap
Clank: Here are the videos about flatmap I found on makigas.es
- Scala: flatten y flatMap: www.makigas.es/series/scala/flatten-y-flatmap
danirod: !videos flatmap
Clank: Here are the videos about flatmap I found on makigas.es
- Scala: flatten y flatMap: #183 (use !video 183 for info)
danirod: !video 183
Clank: 183 · flatten y flatMap
Playlist: Scala. Episode: 18. Length: 8:54
El flatten permite aplastar los elementos de una lista de listas para crear
una lista única. Por otra parte, con flatMap podemos combinar un map y un
flatten: primero aplicamos map a los elementos de una colección de entrada
y luego le hacemos un flatMap.
URL: www.makigas.es/series/scala/flatten-y-flatmap
YouTube ID: youtu.be/JFv9THj85yE
Recientemente un usuario de Discord, no consciente del funcionamiento del sistema de captchas de nuestro servidor, intentó mandar un mensaje al canal de validaciones antes de validar su cuenta.
Posteriormente a este hecho, mandó un copia y pega del mensaje a un canal real y fue capturado por el sistema antiflood:
Este comportamiento es inconsistente, porque el mensaje original no forma parte de uno de los canales reales del servidor. Mientras un usuario no tenga la cuenta verificada por el sistema de captchas, no está terminado de unir, por lo que ese tipo de mensajes no deben ser tenidos en cuenta para el sistema antiflood.
Solución: el sistema antiflood no debe incluir en su memoria parcial mensajes de miembros no verificados.
Yes I am being serious.
If a member deletes a message, the antiflood system should forget about the original message, so that pasting it again (for instance, the member got a channel wrong and decided to fix it) do not triggers the antiflood system.
The command !alert
allows members with good karma level to report messages. Clank will manage reports and warn or ban users.
Usage spec: !alert <member> [<reason>]
. Examples:
!alert @danirod
: signal an alert for danirod. No specified reason or comment.!alert @danirod spam
: signal an alert for danirod, adding spam as a comment reason.When an alert is received, the following happens:
The alert queue is a tag attached to a member. It is a list of timestamps at which an alert has been received.
It is acceptable for multiple people to issue multiple warns when a message should clearly be reported (such as spam). This pushes multiple timestamps into the alert queue of a member. Example:
@BadUser1: join my discord server! https://discord.gg/Mq7TBAB
@VeteranUser1: !alert @BadUser1
@VeteranUser2: !alert @BadUser1 spam
@VeteranUser3: !alert @BadUser1
An automatic warn is issued if a member receives more than N alerts for a 30 minute interval, or more than P alerts for a 4 hour interval. N and P are values that should not be considered hardcoded because they may be tweaked, either algorithmically or manually. Let it be initially N = 3 and P = 7.
An automatic ban is issued if an automatic warn is issued for a member that is already warned.
The bot sometimes disconnects from the network but doesn't attempt to reconnect when the network is available again.
Members would like to know which level they have, or how many points they have.
Can the bot notify the people when they type the !accept / !acepto command wrong?
Es estúpido que diga "tienes que esperar unos minutos" pero no diga cuántos.
Have a blocklist based on user IDs, which are assumed to be owned by people with a spammy record, even if they haven’t joined the server yet.
Have the server check the ID of a member that joins the guild against the blocklist. Autoban any member whose ID is contained in the blocklist as soon as they join.
Additional patterns to detect:
instagram.com/[a-zA-Z0-9._]+
=> detect links to instagram profilesfacebook.com/groups/[0-9]+
=> detect links to Facebook groupsfacebook.com/pages/[0-9a-zA-Z._]+/[0-9]+/
=> detect links to Facebook pages!horn command will be removed because it is not widely used and it causes a dependency hell with node-opus. !horn command may be reintroduced later on.
Idea pool:
Spammy regex list:
Si se publica un mensaje en un servidor que contiene un link a un mensaje del mismo servidor, el bot debería retirar cualquier posible embed genérico Open Graph que se haya podido presentar a partir del link e incrustar en su defecto un embed que contenga una cita del mensaje publicado.
Because verified users have already got a role, Discord's prune tool will not include them when pruning inactive users, which is something that every few months I do for users that haven't logged in, in a long time.
The reason I prune inactive users is that it provides a skewed statistic over the amount of users the server has. Plus, you never know when an inactive account may become a zombie account: it gets compromised and a bad actor uses it to send malware or spam.
The bot should log the last time an user goes available or unavailable in order to remove the verified badge, or at least mark the user as inactive, if the user has not logged in in three months.
Clank has a lot of wrapping classes built on top of Discord.js in the lib/ directory.
Reorganize this repository so that the lib/ directory can be easier to re-use.
If a moderator bans an user, Clank should send a ModlogEvent into the private modlog channel indicating that the user has been banned from the server. Additionally, if the mod provided a reason to Discord when issuing the ban, the reason should be logged in the message as well.
The reason is that, seeing why a user was banned is difficult because it requires opening the audit log in the server settings, plus it is difficult by itself because you might not know that an user was banned unless you actually reviewed the audit log itself.
Something more friendly, in the style of the KCD bot:
yes/no
answers or maybe using the Y / N reactions.Look how to do this.
TypeError: Cannot read property 'getTime' of null
at requiresCooldown (/clank/dist/hooks/verify.js:11:61)
at VerifyService.handleMessage (/clank/dist/hooks/verify.js:42:13)
at Makibot.<anonymous> (/clank/dist/hooks/verify.js:22:48)
at Makibot.emit (events.js:327:22)
at MessageCreateHandler.handle (/clank/node_modules/discord.js/src/client/websocket/packets/handlers/MessageCreate.js:9:34)
at WebSocketPacketManager.handle (/clank/node_modules/discord.js/src/client/websocket/packets/WebSocketPacketManager.js:108:65)
at WebSocketConnection.onPacket (/clank/node_modules/discord.js/src/client/websocket/WebSocketConnection.js:336:35)
at WebSocketConnection.onMessage (/clank/node_modules/discord.js/src/client/websocket/WebSocketConnection.js:299:17)
at WebSocket.onMessage (/clank/node_modules/ws/lib/event-target.js:120:16)
at WebSocket.emit (events.js:315:20)
Describe the bug
When you make use of the !primo command it can be broked
To Reproduce
Send the message !primo Text`outcuote
Expected behavior
Put the ` charter by first putting a backslash
Additional context
Its on the server Message
Describe the bug
Discord if you left a server your roles get reset and if a user lefts it can get back on the server verificate and isnt warned
To Reproduce
As an administrator warn a account you own and left the server and then go back into the server with an invite link
you have veen reseted the roles. If the server has a verification role verify yourself and you are no longer warned
Expected behavior
The bot add the warned role back
If the system detects the same message being posted in multiple channels by the same user in a very short amount of time, it should mark the message as flooded.
Caveats:
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.