Giter VIP home page Giter VIP logo

discordmodbot's People

Stargazers

 avatar

Watchers

 avatar  avatar  avatar  avatar

discordmodbot's Issues

Language Filter Whitelist

Introduce a whitelist function to the language filter.

Some terms like "tard" make sense to place under the "ends with" filter as it's often use as a suffix to insult users.

However this can cause issues where a word like "bastard" will be flagged for removal. Being able to create a whitelist for specific exceptions would be very helpful in that regard

[Breaking change] Restructure warning points entities into single entity

Is your feature request related to a problem? Please describe.
Hibernate has some problems which have been introduced in hibernate 6, most issue are with object relations.

This prevents us from upgrading to Spring Boot 3 (#54)

Describe the solution you'd like
We keep JPA only and change the way we store the points without relations but a singular table that contains 3 ids:

  • the guild id
  • user id
  • warning id

Describe alternatives you've considered
Either we simplify the storage of warning points that users have and migrate it with the last version 2 of the bot.
We introduce version 3 which introduces a breaking change, we move this repository to JDBC, this means we will be using Redis, JPA and JDBC repositories.

This solution does not work because JDBC does not support multi id structures

Additional context
Unresolved hibernate bug HHH-15903
https://docs.spring.io/spring-data/jdbc/docs/current/reference/html/

Action Required: Fix Renovate Configuration

There is an error with this repository's Renovate configuration that needs to be fixed. As a precaution, Renovate will stop PRs until it is resolved.

Location: renovate.json
Error type: Invalid JSON (parsing failed)
Message: Syntax error: expecting end of expression or separator near ] "draf

[Bug] review emoji not working

Describe the bug
When a user has answered the member gate questions, an emote is added to the message that states user x is waiting for a review when pressing on the emote, no action is taken, instead !review needs to be used

To Reproduce
Press emoji on review message
Nothing happens

Expected behavior
The review process is started

Dependency Dashboard

This issue lists Renovate updates and detected dependencies. Read the Dependency Dashboard docs to learn more.

This repository currently has no open or pending branches.

Detected dependencies

github-actions
.github/workflows/builld.yml
  • actions/checkout v4.1.5@44c2b7a8a4ea60a981eaca3cf939b5f4305c123b
  • gradle/actions v3.3.2@db19848a5fa7950289d3668fb053140cf3028d43
  • actions/setup-java v4.2.1@99b8673ff64fbf99d8d325f52d9a5bdedb8483e9
  • gradle/actions v3.3.2@db19848a5fa7950289d3668fb053140cf3028d43
.github/workflows/dependency-submission.yml
  • actions/checkout v4.1.5@44c2b7a8a4ea60a981eaca3cf939b5f4305c123b
  • actions/setup-java v4.2.1@99b8673ff64fbf99d8d325f52d9a5bdedb8483e9
  • gradle/actions v3.3.2@db19848a5fa7950289d3668fb053140cf3028d43
.github/workflows/mariadb.yml
  • actions/checkout v4.1.5@44c2b7a8a4ea60a981eaca3cf939b5f4305c123b
  • gradle/actions v3.3.2@db19848a5fa7950289d3668fb053140cf3028d43
  • actions/setup-java v4.2.1@99b8673ff64fbf99d8d325f52d9a5bdedb8483e9
  • gradle/actions v3.3.2@db19848a5fa7950289d3668fb053140cf3028d43
  • mariadb 11.3.2@sha256:f0a6faee9d0e55492f238d1d11ff13d77616ea12d8c38bedf090da2ee05532be
.github/workflows/release.yml
  • google-github-actions/release-please-action v4.1.0@a37ac6e4f6449ce8b3f7607e4d97d0146028dc0b
.github/workflows/renovate-config-validator.yml
  • actions/checkout v4.1.5@44c2b7a8a4ea60a981eaca3cf939b5f4305c123b
  • actions/setup-node v4.0.2@60edb5dd545a775178f52524783378180af0d1f8
gradle
settings.gradle.kts
build.gradle.kts
  • org.springframework.boot 3.2.5
  • io.spring.dependency-management 1.1.5
  • org.jetbrains.kotlin.jvm 1.9.24
  • org.jetbrains.kotlin.plugin.spring 1.9.24
  • org.jetbrains.kotlin.plugin.jpa 1.9.24
  • org.jetbrains.kotlin.kapt 1.9.24
  • net.dv8tion:JDA 5.0.0-beta.23
  • org.apache.commons:commons-collections4 4.4
  • org.json:json 20240303
  • org.mockito.kotlin:mockito-kotlin 5.3.1
gradle-wrapper
gradle/wrapper/gradle-wrapper.properties
  • gradle 8.7

  • Check this box to trigger a request for Renovate to run again on this repository

Entry gate reminder DM

Send a reminder DM to users that have been at the entry gate for 7 days and still have no role. Alerting them that if they do not complete the entry process they will be kicked after 24 hours and linking them to the entry instructions in the entry channel.

Saving guildWarnPoints causes SQLIntegrityConstraintViolationException

After we upgraded to Spring Boot 3 saving guildWarnPoints causes a database exception.

org.springframework.dao.DataIntegrityViolationException: could not execute statement; SQL [n/a]; constraint [null]
	at org.springframework.orm.jpa.vendor.HibernateJpaDialect.convertHibernateAccessException(HibernateJpaDialect.java:270) ~[spring-orm-6.0.2.jar:6.0.2]
	at org.springframework.orm.jpa.vendor.HibernateJpaDialect.translateExceptionIfPossible(HibernateJpaDialect.java:233) ~[spring-orm-6.0.2.jar:6.0.2]
	at org.springframework.orm.jpa.JpaTransactionManager.doCommit(JpaTransactionManager.java:566) ~[spring-orm-6.0.2.jar:6.0.2]
	at org.springframework.transaction.support.AbstractPlatformTransactionManager.processCommit(AbstractPlatformTransactionManager.java:743) ~[spring-tx-6.0.2.jar:6.0.2]
	at org.springframework.transaction.support.AbstractPlatformTransactionManager.commit(AbstractPlatformTransactionManager.java:711) ~[spring-tx-6.0.2.jar:6.0.2]
	at org.springframework.transaction.interceptor.TransactionAspectSupport.commitTransactionAfterReturning(TransactionAspectSupport.java:654) ~[spring-tx-6.0.2.jar:6.0.2]
	at org.springframework.transaction.interceptor.TransactionAspectSupport.invokeWithinTransaction(TransactionAspectSupport.java:407) ~[spring-tx-6.0.2.jar:6.0.2]
	at org.springframework.transaction.interceptor.TransactionInterceptor.invoke(TransactionInterceptor.java:119) ~[spring-tx-6.0.2.jar:6.0.2]
	at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:184) ~[spring-aop-6.0.2.jar:6.0.2]
	at org.springframework.dao.support.PersistenceExceptionTranslationInterceptor.invoke(PersistenceExceptionTranslationInterceptor.java:137) ~[spring-tx-6.0.2.jar:6.0.2]
	at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:184) ~[spring-aop-6.0.2.jar:6.0.2]
	at org.springframework.data.jpa.repository.support.CrudMethodMetadataPostProcessor$CrudMethodMetadataPopulatingMethodInterceptor.invoke(CrudMethodMetadataPostProcessor.java:163) ~[spring-data-jpa-3.0.0.jar:3.0.0]
	at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:184) ~[spring-aop-6.0.2.jar:6.0.2]
	at org.springframework.aop.interceptor.ExposeInvocationInterceptor.invoke(ExposeInvocationInterceptor.java:97) ~[spring-aop-6.0.2.jar:6.0.2]
	at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:184) ~[spring-aop-6.0.2.jar:6.0.2]
	at org.springframework.data.repository.core.support.MethodInvocationValidator.invoke(MethodInvocationValidator.java:94) ~[spring-data-commons-3.0.0.jar:3.0.0]
	at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:184) ~[spring-aop-6.0.2.jar:6.0.2]
	at org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:218) ~[spring-aop-6.0.2.jar:6.0.2]
	at jdk.proxy2/jdk.proxy2.$Proxy136.save(Unknown Source) ~[na:na]
	at be.duncanc.discordmodbot.bot.sequences.AddWarnPoints$AddPointsSequence.processSequence(AddWarnPoints.kt:198) ~[classes!/:na]
	at be.duncanc.discordmodbot.bot.sequences.AddWarnPoints$AddPointsSequence.onMessageReceivedDuringSequence(AddWarnPoints.kt:174) ~[classes!/:na]
	at be.duncanc.discordmodbot.bot.sequences.Sequence.onMessageReceived(Sequence.kt:107) ~[classes!/:na]
	at net.dv8tion.jda.api.hooks.ListenerAdapter.onEvent(ListenerAdapter.java:483) ~[JDA-4.4.0_350.jar:4.4.0_350]
	at net.dv8tion.jda.api.hooks.InterfacedEventManager.handle(InterfacedEventManager.java:96) ~[JDA-4.4.0_350.jar:4.4.0_350]
	at net.dv8tion.jda.internal.hooks.EventManagerProxy.handleInternally(EventManagerProxy.java:88) ~[JDA-4.4.0_350.jar:4.4.0_350]
	at net.dv8tion.jda.internal.hooks.EventManagerProxy.handle(EventManagerProxy.java:70) ~[JDA-4.4.0_350.jar:4.4.0_350]
	at net.dv8tion.jda.internal.JDAImpl.handleEvent(JDAImpl.java:160) ~[JDA-4.4.0_350.jar:4.4.0_350]
	at net.dv8tion.jda.internal.handle.MessageCreateHandler.handleInternally(MessageCreateHandler.java:123) ~[JDA-4.4.0_350.jar:4.4.0_350]
	at net.dv8tion.jda.internal.handle.SocketHandler.handle(SocketHandler.java:36) ~[JDA-4.4.0_350.jar:4.4.0_350]
	at net.dv8tion.jda.internal.requests.WebSocketClient.onDispatch(WebSocketClient.java:952) ~[JDA-4.4.0_350.jar:4.4.0_350]
	at net.dv8tion.jda.internal.requests.WebSocketClient.onEvent(WebSocketClient.java:839) ~[JDA-4.4.0_350.jar:4.4.0_350]
	at net.dv8tion.jda.internal.requests.WebSocketClient.handleEvent(WebSocketClient.java:817) ~[JDA-4.4.0_350.jar:4.4.0_350]
	at net.dv8tion.jda.internal.requests.WebSocketClient.onBinaryMessage(WebSocketClient.java:991) ~[JDA-4.4.0_350.jar:4.4.0_350]
	at com.neovisionaries.ws.client.ListenerManager.callOnBinaryMessage(ListenerManager.java:385) ~[nv-websocket-client-2.14.jar:na]
	at com.neovisionaries.ws.client.ReadingThread.callOnBinaryMessage(ReadingThread.java:276) ~[nv-websocket-client-2.14.jar:na]
	at com.neovisionaries.ws.client.ReadingThread.handleBinaryFrame(ReadingThread.java:996) ~[nv-websocket-client-2.14.jar:na]
	at com.neovisionaries.ws.client.ReadingThread.handleFrame(ReadingThread.java:755) ~[nv-websocket-client-2.14.jar:na]
	at com.neovisionaries.ws.client.ReadingThread.main(ReadingThread.java:108) ~[nv-websocket-client-2.14.jar:na]
	at com.neovisionaries.ws.client.ReadingThread.runMain(ReadingThread.java:64) ~[nv-websocket-client-2.14.jar:na]
	at com.neovisionaries.ws.client.WebSocketThread.run(WebSocketThread.java:45) ~[nv-websocket-client-2.14.jar:na]
Caused by: org.hibernate.exception.ConstraintViolationException: could not execute statement
	at org.hibernate.exception.internal.SQLExceptionTypeDelegate.convert(SQLExceptionTypeDelegate.java:60) ~[hibernate-core-6.1.5.Final.jar:6.1.5.Final]
	at org.hibernate.exception.internal.StandardSQLExceptionConverter.convert(StandardSQLExceptionConverter.java:56) ~[hibernate-core-6.1.5.Final.jar:6.1.5.Final]
	at org.hibernate.engine.jdbc.spi.SqlExceptionHelper.convert(SqlExceptionHelper.java:109) ~[hibernate-core-6.1.5.Final.jar:6.1.5.Final]
	at org.hibernate.engine.jdbc.spi.SqlExceptionHelper.convert(SqlExceptionHelper.java:95) ~[hibernate-core-6.1.5.Final.jar:6.1.5.Final]
	at org.hibernate.engine.jdbc.internal.ResultSetReturnImpl.executeUpdate(ResultSetReturnImpl.java:200) ~[hibernate-core-6.1.5.Final.jar:6.1.5.Final]
	at org.hibernate.engine.jdbc.batch.internal.NonBatchingBatch.addToBatch(NonBatchingBatch.java:39) ~[hibernate-core-6.1.5.Final.jar:6.1.5.Final]
	at org.hibernate.persister.collection.AbstractCollectionPersister.recreate(AbstractCollectionPersister.java:1478) ~[hibernate-core-6.1.5.Final.jar:6.1.5.Final]
	at org.hibernate.action.internal.CollectionRecreateAction.execute(CollectionRecreateAction.java:47) ~[hibernate-core-6.1.5.Final.jar:6.1.5.Final]
	at org.hibernate.engine.spi.ActionQueue.executeActions(ActionQueue.java:612) ~[hibernate-core-6.1.5.Final.jar:6.1.5.Final]
	at org.hibernate.engine.spi.ActionQueue.lambda$executeActions$1(ActionQueue.java:483) ~[hibernate-core-6.1.5.Final.jar:6.1.5.Final]
	at java.base/java.util.LinkedHashMap.forEach(LinkedHashMap.java:721) ~[na:na]
	at org.hibernate.engine.spi.ActionQueue.executeActions(ActionQueue.java:480) ~[hibernate-core-6.1.5.Final.jar:6.1.5.Final]
	at org.hibernate.event.internal.AbstractFlushingEventListener.performExecutions(AbstractFlushingEventListener.java:329) ~[hibernate-core-6.1.5.Final.jar:6.1.5.Final]
	at org.hibernate.event.internal.DefaultFlushEventListener.onFlush(DefaultFlushEventListener.java:39) ~[hibernate-core-6.1.5.Final.jar:6.1.5.Final]
	at org.hibernate.event.service.internal.EventListenerGroupImpl.fireEventOnEachListener(EventListenerGroupImpl.java:107) ~[hibernate-core-6.1.5.Final.jar:6.1.5.Final]
	at org.hibernate.internal.SessionImpl.doFlush(SessionImpl.java:1422) ~[hibernate-core-6.1.5.Final.jar:6.1.5.Final]
	at org.hibernate.internal.SessionImpl.managedFlush(SessionImpl.java:476) ~[hibernate-core-6.1.5.Final.jar:6.1.5.Final]
	at org.hibernate.internal.SessionImpl.flushBeforeTransactionCompletion(SessionImpl.java:2233) ~[hibernate-core-6.1.5.Final.jar:6.1.5.Final]
	at org.hibernate.internal.SessionImpl.beforeTransactionCompletion(SessionImpl.java:1929) ~[hibernate-core-6.1.5.Final.jar:6.1.5.Final]
	at org.hibernate.engine.jdbc.internal.JdbcCoordinatorImpl.beforeTransactionCompletion(JdbcCoordinatorImpl.java:439) ~[hibernate-core-6.1.5.Final.jar:6.1.5.Final]
	at org.hibernate.resource.transaction.backend.jdbc.internal.JdbcResourceLocalTransactionCoordinatorImpl.beforeCompletionCallback(JdbcResourceLocalTransactionCoordinatorImpl.java:183) ~[hibernate-core-6.1.5.Final.jar:6.1.5.Final]
	at org.hibernate.resource.transaction.backend.jdbc.internal.JdbcResourceLocalTransactionCoordinatorImpl$TransactionDriverControlImpl.commit(JdbcResourceLocalTransactionCoordinatorImpl.java:281) ~[hibernate-core-6.1.5.Final.jar:6.1.5.Final]
	at org.hibernate.engine.transaction.internal.TransactionImpl.commit(TransactionImpl.java:101) ~[hibernate-core-6.1.5.Final.jar:6.1.5.Final]
	at org.springframework.orm.jpa.JpaTransactionManager.doCommit(JpaTransactionManager.java:562) ~[spring-orm-6.0.2.jar:6.0.2]
	... 37 common frames omitted
Caused by: java.sql.SQLIntegrityConstraintViolationException: (conn=28447) Cannot add or update a child row: a foreign key constraint fails (`discordmodbot`.`user_has_warn_points`, CONSTRAINT `FKc40ohaed91dh2r2rak16229ps` FOREIGN KEY (`guild_warn_points_user_id`, `guild_warn_points_guild_id`) REFERENCES `guild_warn_points` (`user_i)
	at org.mariadb.jdbc.export.ExceptionFactory.createException(ExceptionFactory.java:290) ~[mariadb-java-client-3.0.9.jar:na]
	at org.mariadb.jdbc.export.ExceptionFactory.create(ExceptionFactory.java:370) ~[mariadb-java-client-3.0.9.jar:na]
	at org.mariadb.jdbc.message.ClientMessage.readPacket(ClientMessage.java:137) ~[mariadb-java-client-3.0.9.jar:na]
	at org.mariadb.jdbc.client.impl.StandardClient.readPacket(StandardClient.java:840) ~[mariadb-java-client-3.0.9.jar:na]
	at org.mariadb.jdbc.client.impl.StandardClient.readResults(StandardClient.java:779) ~[mariadb-java-client-3.0.9.jar:na]
	at org.mariadb.jdbc.client.impl.StandardClient.readResponse(StandardClient.java:698) ~[mariadb-java-client-3.0.9.jar:na]
	at org.mariadb.jdbc.client.impl.StandardClient.execute(StandardClient.java:641) ~[mariadb-java-client-3.0.9.jar:na]
	at org.mariadb.jdbc.ClientPreparedStatement.executeInternal(ClientPreparedStatement.java:95) ~[mariadb-java-client-3.0.9.jar:na]
	at org.mariadb.jdbc.ClientPreparedStatement.executeLargeUpdate(ClientPreparedStatement.java:334) ~[mariadb-java-client-3.0.9.jar:na]
	at org.mariadb.jdbc.ClientPreparedStatement.executeUpdate(ClientPreparedStatement.java:311) ~[mariadb-java-client-3.0.9.jar:na]
	at com.zaxxer.hikari.pool.ProxyPreparedStatement.executeUpdate(ProxyPreparedStatement.java:61) ~[HikariCP-5.0.1.jar:na]
	at com.zaxxer.hikari.pool.HikariProxyPreparedStatement.executeUpdate(HikariProxyPreparedStatement.java) ~[HikariCP-5.0.1.jar:na]
	at org.hibernate.engine.jdbc.internal.ResultSetReturnImpl.executeUpdate(ResultSetReturnImpl.java:197) ~[hibernate-core-6.1.5.Final.jar:6.1.5.Final]
	... 56 common frames omitted

We should add a new database test to replicate the problem and fix the bug.

Message to manually review a user needs to be manually removed

We should store the message id of the message that informs the user of an incorrect answer and requests a user to be manually reviewed by the mods, then we should delete it after we receive an answer from one of the mods.

The best option would most likely be storing it in the object that is currently stored in a the hash map we use.

#rezero_news WN chapter announcement feature

The idea that was previously discussed:

Once there has been an update of a certain size (~4k characters) to Tappei's WN site ( https://ncode.syosetu.com/n2267be/ ) the bot leaves a message in the rezero_news channel saying there was an update.

Once the chapter gets published the bot posts the link to the chapter in the channel with a message and pings the WN updates role.

[Bug] revoking points is broken

Describe the bug
Revoking warnings is broken and always states the user has no warnings

To Reproduce
use !revokepoints on any user

Expected behavior
An option is given to revoke warnings

!warnlist can become too big

The !warnlist command can become so long that it takes extremely long to post all the messages.

Possible solution might be adding pagination, by creating some sort of pagination message with reactions.

Incorrect logging of kick

There's seems to be an issue that causes users that have been kicked and leave afterwards triggering a message they have been kicked again with the same exact reason.

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.