mbosecke / seniorcommander Goto Github PK
View Code? Open in Web Editor NEWA Twitch bot
License: Other
A Twitch bot
License: Other
I suspect they are using the wrong timezone. Make sure we are storing dates in UTC and then research how to display it dynamically in the correct timezone for the end user.
If it's not clearing when using systemctl stop seniorcommander-bot
then maybe we want to clear it when the bot starts up which might be more reliable.
Don't yet know what they are
Exists both in SeniorCommander and SeniorCommanderWeb.
Per seniorcommander IP address
Users will set an A record
on their root domain (pointing to our elastic IP) or a CNAME record
on a subdomain (pointing to our domain name). They will then register their custom domain in their community settings.
Our root endpoint (/
) will look up the current domain in all community settings and will internally rewrite URLs from /(.*)
to /{communityName}/(?1)
Currently, one event handler (ex. ConversationalHandler
) can hold up all other event handlers. There should be some concurrency as well as some priority. As soon as we introduce moderation, the moderation handlers should take priority and any output events they produce (ex. /timeout) should also have priority.
Consider moving to Rabbitmq to facilitate the web application providing messages.
Support the following:
!quote add "Hello" - Mitchell
!quote add Mitchell Hello
Auction system
Multi-word prizes for the auction
As mentioned in #9, moderation message handling and outputs (ex. /timeout) should have higher priority than other event/message handling.
Keep it low, makes the points more valuable
Probably consists of storing an "enabled" flag in the database to persist across server restarts but the actual runtime changes will be triggered via messages.
Unable to build project without com.mitchellbosecke:twitchapi:1.0-SNAPSHOT. Are you planning to make it public to?
Perhaps change the UserService#findUser
method to findOrCreateUser
This will be hard. There will probably be lots of small strings and strings that are dynamically generated and users should be able to reset anything back to it's defaults
The ability to open an auction for a set amount of time and have it automatically close itself after that time.
A running timer checks the database if it is enabled or not upon each iteration. We also start a scheduled timer even if it disabled. This allows the runtime disabling/enabling of timers from the web app.
Idea: Write a memory-efficient database query that returns a list of all known follower names (just names, not full entities). Compare this with the list of names retrieved by the Twitch API and establish a "diff". Using only the list of names in the "diff" do we query CommunityUser
objects and update them accordingly (set followed date, set unfollowed date, etc).
We currently use one connection per channel (allowing use to use custom names for each channel), therefore each channel is rate limited to 20 messages every 30 seconds.
Looks weird otherwise
!giveaway open keyword=”GIMME” eligible=follower,regular,subscriber subscriberMultiplier=2 regularMultiplier=3
!giveaway close
!giveaway winner
Check if their last_chatted or last_online are within the past few hours (ex. 4 hours).
Simple variables in commands, ex. {{uptime}}
We get weird results otherwise. It appears to connect properly but the only thing that really works is the /mods
command.
Now that the bot messages are logged, the integration test is failing. It is including the bot's message from the last time the timer was executed as a chat line.
Ideally, it would ignore all logs from the bot but it would need access to the channels in order to find out their usernames. Keep in mind that maybe channels will be dynamically added/removed at some point?
50 joins per 15 seconds but as per https://discuss.dev.twitch.tv/t/simultaneous-connection-limits/4077, a new connection counts as an “auth” so having a connection-per-channel means we can only join 25 channels every 15 seconds. This limit is per IP address.
It will often be applied to the channel's owner to prevent them from showing up in the leaderboard.
Will need to improve the current "follower audit" to be way less resource intensive
Support the following:
!command add !foo this is the output
I'm guessing users can change it whenver so it will have to be a routine update.
It should be safe no matter which channel the bot is in and keep in mind that we want to support using custom usernames for channels. Perhaps a standard method on a channel to determine the bot's username which is checked in the CommandBroker?
Failed to insert a chat log message because the community_user did not exist and then all database activity ceased.
WARN: SQL Error: 0, SQLState: 23502
Oct 22 22:01:53 ip-172-30-4-189 java: Oct 22, 2016 10:01:53 PM org.hibernate.engine.jdbc.spi.SqlExceptionHelper logExceptions
Oct 22 22:01:53 ip-172-30-4-189 java: ERROR: ERROR: null value in column "community_user_id" violates not-null constraint
Oct 22 22:01:53 ip-172-30-4-189 java: Detail: Failing row contains (1684, 1, My dick wet, null, 2016-10-22 22:01:53.796-04).
Oct 22 22:01:53 ip-172-30-4-189 java: [ERROR] com.mitchellbosecke.seniorcommander.SeniorCommanderImpl - Error when handling message
Oct 22 22:01:53 ip-172-30-4-189 java: javax.persistence.PersistenceException: org.hibernate.exception.ConstraintViolationException: could not execute statement
Oct 22 22:01:53 ip-172-30-4-189 java: at org.hibernate.internal.ExceptionConverterImpl.convert(ExceptionConverterImpl.java:147)
Oct 22 22:01:53 ip-172-30-4-189 java: at org.hibernate.internal.ExceptionConverterImpl.convert(ExceptionConverterImpl.java:155)
Oct 22 22:01:53 ip-172-30-4-189 java: at org.hibernate.internal.ExceptionConverterImpl.convert(ExceptionConverterImpl.java:162)
Oct 22 22:01:53 ip-172-30-4-189 java: at org.hibernate.internal.SessionImpl.firePersist(SessionImpl.java:771)
Oct 22 22:01:53 ip-172-30-4-189 java: at org.hibernate.internal.SessionImpl.persist(SessionImpl.java:744)
Oct 22 22:01:53 ip-172-30-4-189 java: at org.hibernate.internal.SessionImpl.persist(SessionImpl.java:749)
Oct 22 22:01:53 ip-172-30-4-189 java: at sun.reflect.GeneratedMethodAccessor52.invoke(Unknown Source)
Oct 22 22:01:53 ip-172-30-4-189 java: at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
Oct 22 22:01:53 ip-172-30-4-189 java: at java.lang.reflect.Method.invoke(Method.java:498)
Oct 22 22:01:53 ip-172-30-4-189 java: at org.hibernate.context.internal.ThreadLocalSessionContext$TransactionProtectionWrapper.invoke(ThreadLocalSessionContext.java:355)
Oct 22 22:01:53 ip-172-30-4-189 java: at com.sun.proxy.$Proxy17.persist(Unknown Source)
Oct 22 22:01:53 ip-172-30-4-189 java: at com.mitchellbosecke.seniorcommander.extension.core.service.BaseService.persist(BaseService.java:33)
Oct 22 22:01:53 ip-172-30-4-189 java: at com.mitchellbosecke.seniorcommander.extension.core.event.LoggingHandler.handle(LoggingHandler.java:37)
Oct 22 22:01:53 ip-172-30-4-189 java: at com.mitchellbosecke.seniorcommander.SeniorCommanderImpl.lambda$run$6(SeniorCommanderImpl.java:109)
Oct 22 22:01:53 ip-172-30-4-189 java: at java.lang.Iterable.forEach(Iterable.java:75)
Oct 22 22:01:53 ip-172-30-4-189 java: at com.mitchellbosecke.seniorcommander.SeniorCommanderImpl.run(SeniorCommanderImpl.java:107)
Oct 22 22:01:53 ip-172-30-4-189 java: at com.mitchellbosecke.seniorcommander.SeniorCommander.main(SeniorCommander.java:24)
Oct 22 22:01:53 ip-172-30-4-189 java: Caused by: org.hibernate.exception.ConstraintViolationException: could not execute statement
Oct 22 22:01:53 ip-172-30-4-189 java: at org.hibernate.exception.internal.SQLStateConversionDelegate.convert(SQLStateConversionDelegate.java:112)
Oct 22 22:01:53 ip-172-30-4-189 java: at org.hibernate.exception.internal.StandardSQLExceptionConverter.convert(StandardSQLExceptionConverter.java:42)
Oct 22 22:01:53 ip-172-30-4-189 java: at org.hibernate.engine.jdbc.spi.SqlExceptionHelper.convert(SqlExceptionHelper.java:111)
Oct 22 22:01:53 ip-172-30-4-189 java: at org.hibernate.engine.jdbc.spi.SqlExceptionHelper.convert(SqlExceptionHelper.java:97)
Oct 22 22:01:53 ip-172-30-4-189 java: at org.hibernate.engine.jdbc.internal.ResultSetReturnImpl.executeUpdate(ResultSetReturnImpl.java:207)
Oct 22 22:01:53 ip-172-30-4-189 java: at org.hibernate.dialect.identity.GetGeneratedKeysDelegate.executeAndExtract(GetGeneratedKeysDelegate.java:57)
Oct 22 22:01:53 ip-172-30-4-189 java: at org.hibernate.id.insert.AbstractReturningDelegate.performInsert(AbstractReturningDelegate.java:42)
Oct 22 22:01:53 ip-172-30-4-189 java: at org.hibernate.persister.entity.AbstractEntityPersister.insert(AbstractEntityPersister.java:2840)
Oct 22 22:01:53 ip-172-30-4-189 java: at org.hibernate.persister.entity.AbstractEntityPersister.insert(AbstractEntityPersister.java:3411)
Oct 22 22:01:53 ip-172-30-4-189 java: at org.hibernate.action.internal.EntityIdentityInsertAction.execute(EntityIdentityInsertAction.java:81)
Oct 22 22:01:53 ip-172-30-4-189 java: at org.hibernate.engine.spi.ActionQueue.execute(ActionQueue.java:619)
Oct 22 22:01:53 ip-172-30-4-189 java: at org.hibernate.engine.spi.ActionQueue.addResolvedEntityInsertAction(ActionQueue.java:273)
Oct 22 22:01:53 ip-172-30-4-189 java: at org.hibernate.engine.spi.ActionQueue.addInsertAction(ActionQueue.java:254)
Oct 22 22:01:53 ip-172-30-4-189 java: at org.hibernate.engine.spi.ActionQueue.addAction(ActionQueue.java:299)
Oct 22 22:01:53 ip-172-30-4-189 java: at org.hibernate.engine.spi.ActionQueue.addResolvedEntityInsertAction(ActionQueue.java:273)
Oct 22 22:01:53 ip-172-30-4-189 java: at org.hibernate.engine.spi.ActionQueue.addInsertAction(ActionQueue.java:254)
Oct 22 22:01:53 ip-172-30-4-189 java: at org.hibernate.engine.spi.ActionQueue.addAction(ActionQueue.java:299)
Oct 22 22:01:53 ip-172-30-4-189 java: at org.hibernate.event.internal.AbstractSaveEventListener.addInsertAction(AbstractSaveEventListener.java:318)
Oct 22 22:01:53 ip-172-30-4-189 java: at org.hibernate.event.internal.AbstractSaveEventListener.performSaveOrReplicate(AbstractSaveEventListener.java:275)
Oct 22 22:01:53 ip-172-30-4-189 java: at org.hibernate.event.internal.AbstractSaveEventListener.performSave(AbstractSaveEventListener.java:182)
Oct 22 22:01:53 ip-172-30-4-189 java: at org.hibernate.event.internal.AbstractSaveEventListener.saveWithGeneratedId(AbstractSaveEventListener.java:113)
Oct 22 22:01:53 ip-172-30-4-189 java: at org.hibernate.event.internal.DefaultPersistEventListener.entityIsTransient(DefaultPersistEventListener.java:189)
Oct 22 22:01:53 ip-172-30-4-189 java: at org.hibernate.event.internal.DefaultPersistEventListener.onPersist(DefaultPersistEventListener.java:132)
Oct 22 22:01:53 ip-172-30-4-189 java: at org.hibernate.event.internal.DefaultPersistEventListener.onPersist(DefaultPersistEventListener.java:58)
Oct 22 22:01:53 ip-172-30-4-189 java: at org.hibernate.internal.SessionImpl.firePersist(SessionImpl.java:764)
Oct 22 22:01:53 ip-172-30-4-189 java: ... 13 more
Oct 22 22:01:53 ip-172-30-4-189 java: Caused by: org.postgresql.util.PSQLException: ERROR: null value in column "community_user_id" violates not-null constraint
Oct 22 22:01:53 ip-172-30-4-189 java: Detail: Failing row contains (1684, 1, My dick wet, null, 2016-10-22 22:01:53.796-04).
Oct 22 22:01:53 ip-172-30-4-189 java: at org.postgresql.core.v3.QueryExecutorImpl.receiveErrorResponse(QueryExecutorImpl.java:2284)
Oct 22 22:01:53 ip-172-30-4-189 java: at org.postgresql.core.v3.QueryExecutorImpl.processResults(QueryExecutorImpl.java:2003)
Oct 22 22:01:53 ip-172-30-4-189 java: at org.postgresql.core.v3.QueryExecutorImpl.execute(QueryExecutorImpl.java:200)
Oct 22 22:01:53 ip-172-30-4-189 java: at org.postgresql.jdbc.PgStatement.execute(PgStatement.java:424)
Oct 22 22:01:53 ip-172-30-4-189 java: at org.postgresql.jdbc.PgPreparedStatement.executeWithFlags(PgPreparedStatement.java:161)
Oct 22 22:01:53 ip-172-30-4-189 java: at org.postgresql.jdbc.PgPreparedStatement.executeUpdate(PgPreparedStatement.java:133)
Oct 22 22:01:53 ip-172-30-4-189 java: at org.hibernate.engine.jdbc.internal.ResultSetReturnImpl.executeUpdate(ResultSetReturnImpl.java:204)
Oct 22 22:01:53 ip-172-30-4-189 java: ... 30 more
Oct 22 22:01:53 ip-172-30-4-189 java: [ERROR] com.mitchellbosecke.seniorcommander.SeniorCommanderImpl - Error when handling message
Oct 22 22:01:53 ip-172-30-4-189 java: org.hibernate.HibernateException: find is not valid without active transaction
Oct 22 22:01:53 ip-172-30-4-189 java: at org.hibernate.context.internal.ThreadLocalSessionContext$TransactionProtectionWrapper.invoke(ThreadLocalSessionContext.java:351)
Oct 22 22:01:53 ip-172-30-4-189 java: at com.sun.proxy.$Proxy17.find(Unknown Source)
Oct 22 22:01:53 ip-172-30-4-189 java: at com.mitchellbosecke.seniorcommander.extension.core.service.BaseService.find(BaseService.java:20)
Oct 22 22:01:53 ip-172-30-4-189 java: at com.mitchellbosecke.seniorcommander.extension.core.service.UserService.setUserOnline(UserService.java:41)
Oct 22 22:01:53 ip-172-30-4-189 java: at com.mitchellbosecke.seniorcommander.extension.core.event.UserChatHandler.handle(UserChatHandler.java:30)
Oct 22 22:01:53 ip-172-30-4-189 java: at com.mitchellbosecke.seniorcommander.SeniorCommanderImpl.lambda$run$6(SeniorCommanderImpl.java:109)
Oct 22 22:01:53 ip-172-30-4-189 java: at java.lang.Iterable.forEach(Iterable.java:75)
Oct 22 22:01:53 ip-172-30-4-189 java: at com.mitchellbosecke.seniorcommander.SeniorCommanderImpl.run(SeniorCommanderImpl.java:107)
Oct 22 22:01:53 ip-172-30-4-189 java: at com.mitchellbosecke.seniorcommander.SeniorCommander.main(SeniorCommander.java:24)
Oct 22 22:01:53 ip-172-30-4-189 java: [ERROR] com.mitchellbosecke.seniorcommander.SeniorCommanderImpl - Error when handling message
Oct 22 22:01:53 ip-172-30-4-189 java: org.hibernate.HibernateException: find is not valid without active transaction
Oct 22 22:01:53 ip-172-30-4-189 java: at org.hibernate.context.internal.ThreadLocalSessionContext$TransactionProtectionWrapper.invoke(ThreadLocalSessionContext.java:351)
Oct 22 22:01:53 ip-172-30-4-189 java: at com.sun.proxy.$Proxy17.find(Unknown Source)
Oct 22 22:01:53 ip-172-30-4-189 java: at com.mitchellbosecke.seniorcommander.extension.core.service.BaseService.find(BaseService.java:20)
Oct 22 22:01:53 ip-172-30-4-189 java: at com.mitchellbosecke.seniorcommander.extension.core.service.BaseService.findCommunity(BaseService.java:37)
Oct 22 22:01:53 ip-172-30-4-189 java: at com.mitchellbosecke.seniorcommander.extension.core.event.CommandBroker.handle(CommandBroker.java:49)
Oct 22 22:01:53 ip-172-30-4-189 java: at com.mitchellbosecke.seniorcommander.SeniorCommanderImpl.lambda$run$6(SeniorCommanderImpl.java:109)
Oct 22 22:01:53 ip-172-30-4-189 java: at java.lang.Iterable.forEach(Iterable.java:75)
Oct 22 22:01:53 ip-172-30-4-189 java: at com.mitchellbosecke.seniorcommander.SeniorCommanderImpl.run(SeniorCommanderImpl.java:107)
Oct 22 22:01:53 ip-172-30-4-189 java: at com.mitchellbosecke.seniorcommander.SeniorCommander.main(SeniorCommander.java:24)
Oct 22 22:01:53 ip-172-30-4-189 java: [ERROR] com.mitchellbosecke.seniorcommander.SeniorCommanderImpl - Error when handling message
Oct 22 22:01:53 ip-172-30-4-189 java: org.hibernate.HibernateException: find is not valid without active transaction
Oct 22 22:01:53 ip-172-30-4-189 java: at org.hibernate.context.internal.ThreadLocalSessionContext$TransactionProtectionWrapper.invoke(ThreadLocalSessionContext.java:351)
Oct 22 22:01:53 ip-172-30-4-189 java: at com.sun.proxy.$Proxy17.find(Unknown Source)
Oct 22 22:01:53 ip-172-30-4-189 java: at com.mitchellbosecke.seniorcommander.extension.core.service.BaseService.find(BaseService.java:20)
Oct 22 22:01:53 ip-172-30-4-189 java: at com.mitchellbosecke.seniorcommander.extension.core.service.BaseService.findCommunity(BaseService.java:37)
Oct 22 22:01:53 ip-172-30-4-189 java: at com.mitchellbosecke.seniorcommander.extension.core.event.GiveawayKeywordHandler.handle(GiveawayKeywordHandler.java:33)
Oct 22 22:01:53 ip-172-30-4-189 java: at com.mitchellbosecke.seniorcommander.SeniorCommanderImpl.lambda$run$6(SeniorCommanderImpl.java:109)
Oct 22 22:01:53 ip-172-30-4-189 java: at java.lang.Iterable.forEach(Iterable.java:75)
Oct 22 22:01:53 ip-172-30-4-189 java: at com.mitchellbosecke.seniorcommander.SeniorCommanderImpl.run(SeniorCommanderImpl.java:107)
Oct 22 22:01:53 ip-172-30-4-189 java: at com.mitchellbosecke.seniorcommander.SeniorCommander.main(SeniorCommander.java:24)
Oct 22 22:01:53 ip-172-30-4-189 java: Exception in thread "main" org.hibernate.TransactionException: Transaction was marked for rollback only; cannot commit
Oct 22 22:01:53 ip-172-30-4-189 java: at org.hibernate.resource.transaction.backend.jdbc.internal.JdbcResourceLocalTransactionCoordinatorImpl$TransactionDriverControlImpl.commit(JdbcResourceLocalTransactionCoordinatorImpl.java:217)
Oct 22 22:01:53 ip-172-30-4-189 java: at org.hibernate.engine.transaction.internal.TransactionImpl.commit(TransactionImpl.java:68)
Oct 22 22:01:53 ip-172-30-4-189 java: at com.mitchellbosecke.seniorcommander.SeniorCommanderImpl.run(SeniorCommanderImpl.java:115)
Oct 22 22:01:53 ip-172-30-4-189 java: at com.mitchellbosecke.seniorcommander.SeniorCommander.main(SeniorCommander.java:24)
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.