├── .gitattributes ├── .gitignore ├── Dockerfile ├── LICENSE ├── README.md ├── docker-compose.yml ├── docs ├── Configuration.md └── Setting-Up.md └── src ├── .editorconfig ├── DevChatter.Bot.Core ├── Automation │ ├── AutomationSystem.cs │ ├── CurrencyUpdate.cs │ ├── DelayedMessageAction.cs │ ├── IAutomatedActionSystem.cs │ ├── IIntervalAction.cs │ ├── OneTimeCallBackAction.cs │ └── RepeatingCallbackAction.cs ├── BotMain.cs ├── BotModules │ ├── DuelingModule │ │ ├── AcceptChallengeOperation.cs │ │ ├── Duel.cs │ │ ├── DuelCommand.cs │ │ ├── DuelingSystem.cs │ │ └── StartChallengeOperation.cs │ └── VotingModule │ │ ├── DelayableCallbackAction.cs │ │ ├── StartVoteOperation.cs │ │ ├── VoteCommand.cs │ │ ├── VoteInfoDto.cs │ │ └── VotingSystem.cs ├── Caching │ └── ICacheLayer.cs ├── ChatUserCollection.cs ├── Commands │ ├── AliasCommand.cs │ ├── BaseCommand.cs │ ├── BlastCommand.cs │ ├── BonusCommand.cs │ ├── CoinsCommand.cs │ ├── CommandsCommand.cs │ ├── GiveCommand.cs │ ├── HelpCommand.cs │ ├── IBotCommand.cs │ ├── Operations │ │ ├── AddAliasOperation.cs │ │ ├── AddCommandOperation.cs │ │ ├── AddQuoteOperation.cs │ │ ├── AddStreamOperation.cs │ │ ├── BaseCommandOperation.cs │ │ ├── DeleteAliasOperation.cs │ │ ├── DeleteCommandOperation.cs │ │ ├── DeleteStreamOperation.cs │ │ ├── GenericDeleteOperation.cs │ │ ├── ICommandOperation.cs │ │ └── TopCommandsOperation.cs │ ├── QuoteCommand.cs │ ├── ScheduleCommand.cs │ ├── ShoutOutCommand.cs │ ├── SimpleCommand.cs │ ├── StreamsCommand.cs │ ├── TaxCommand.cs │ ├── TopCommand.cs │ ├── Trackers │ │ ├── CommandCooldownTracker.cs │ │ ├── CommandList.cs │ │ ├── CommandUsage.cs │ │ └── ICommandUsageTracker.cs │ ├── UptimeCommand.cs │ └── ViewersCommand.cs ├── CoreRegistrationModule.cs ├── Data │ ├── IRepository.cs │ ├── ISettingsFactory.cs │ ├── Model │ │ ├── AliasArgumentEntity.cs │ │ ├── AliasEntity.cs │ │ ├── BlastTypeEntity.cs │ │ ├── CanvasDimensions.cs │ │ ├── ChatUser.cs │ │ ├── CommandEntity.cs │ │ ├── CommandSettingsEntity.cs │ │ ├── CommandUsageEntity.cs │ │ ├── DataEntity.cs │ │ ├── HangmanWord.cs │ │ ├── IntervalMessage.cs │ │ ├── QuizQuestion.cs │ │ ├── QuoteEntity.cs │ │ ├── ScheduleEntity.cs │ │ ├── StreamerEntity.cs │ │ ├── TimezoneEntity.cs │ │ └── UserRole.cs │ ├── SettingsFactory.cs │ └── Specifications │ │ ├── BlastTypeEntityPolicy.cs │ │ ├── ChatUserPolicy.cs │ │ ├── CommandPolicy.cs │ │ ├── CommandSettingsPolicy.cs │ │ ├── DataItemPolicy.cs │ │ ├── HangmanWordPolicy.cs │ │ ├── ISpecification.cs │ │ ├── IntervalMessagePolicy.cs │ │ ├── QuoteEntityPolicy.cs │ │ ├── SimpleCommandPolicy.cs │ │ ├── StreamerEntityPolicy.cs │ │ └── TimezonePolicy.cs ├── DevChatter.Bot.Core.csproj ├── Events │ ├── Args │ │ ├── CommandAliasModifiedEventArgs.cs │ │ ├── CommandReceivedEventArgs.cs │ │ ├── NewFollowersEventArgs.cs │ │ ├── NewSubscriberEventArgs.cs │ │ ├── UserNoticedEventArgs.cs │ │ └── WhisperReceivedEventArgs.cs │ ├── CommandHandler.cs │ ├── CommandHandlerSettings.cs │ ├── Cooldown.cs │ ├── CurrencyGenerator.cs │ ├── ICommandHandler.cs │ ├── ICurrencyGenerator.cs │ └── ISubscriberHandler.cs ├── Exceptions │ └── RetryException.cs ├── Extensions │ ├── ListOfStringExtensions.cs │ ├── StringExtensions.cs │ ├── TaskExtensions.cs │ └── TimeSpanExtensions.cs ├── Games │ ├── Hangman │ │ ├── AddHangmanWordOperation.cs │ │ ├── HangmanCommand.cs │ │ ├── HangmanGame.cs │ │ ├── HangmanGuess.cs │ │ └── HangmanSettings.cs │ ├── Heist │ │ ├── HeistCommand.cs │ │ ├── HeistGame.cs │ │ ├── HeistMission.cs │ │ └── HeistRoles.cs │ ├── IGame.cs │ ├── IGameCommand.cs │ ├── JoinGameResult.cs │ ├── Quiz │ │ ├── GuessQuizOperation.cs │ │ ├── JoinQuizOperation.cs │ │ ├── LeaveQuizOperation.cs │ │ ├── QuizCommand.cs │ │ └── QuizGame.cs │ ├── RockPaperScissors │ │ ├── RockPaperScissors.cs │ │ ├── RockPaperScissorsCommand.cs │ │ ├── RockPaperScissorsGame.cs │ │ └── RockPaperScissorsSettings.cs │ └── Roulette │ │ ├── RouletteCommand.cs │ │ └── RouletteSettings.cs ├── GoogleApi │ ├── CachedTimezoneLookup.cs │ ├── ITimezoneLookup.cs │ ├── PlaceResponse.cs │ ├── TimezoneLookupResult.cs │ └── TimezoneResponse.cs ├── GoogleCloudSettings.cs ├── IChatUserCollection.cs ├── Messaging │ ├── IntervalMessageCoordinator.cs │ └── Tokens │ │ └── SimpleToken.cs ├── Settings │ └── CurrencySettings.cs ├── Streaming │ ├── IAnimationDisplay.cs │ ├── IHangmanDisplay.cs │ └── IVotingDisplay.cs ├── Systems │ ├── Chat │ │ ├── IChatClient.cs │ │ └── IMessageSender.cs │ └── Streaming │ │ ├── IAnimationDisplayNotification.cs │ │ ├── IFollowableSystem.cs │ │ ├── IFollowerService.cs │ │ ├── IHangmanDisplayNotification.cs │ │ ├── IStreamingInfoService.cs │ │ ├── IStreamingPlatform.cs │ │ ├── IVotingDisplayNotification.cs │ │ └── StreamingSystem.cs └── Util │ ├── IClock.cs │ ├── ILoggerAdapter.cs │ ├── IWeightedItem.cs │ ├── LoggerAdapter.cs │ └── MyRandom.cs ├── DevChatter.Bot.Infra.Ef ├── AppDataContext.cs ├── DevChatter.Bot.Infra.Ef.csproj ├── EfCacheLayer.cs ├── EfGenericRepo.cs └── Migrations │ ├── 20180323030224_InitialCreate.Designer.cs │ ├── 20180323030224_InitialCreate.cs │ ├── 20180327190522_StreamerData.Designer.cs │ ├── 20180327190522_StreamerData.cs │ ├── 20180403184339_AddingHelpText.Designer.cs │ ├── 20180403184339_AddingHelpText.cs │ ├── 20180408041601_AbstractedCommandWords.Designer.cs │ ├── 20180408041601_AbstractedCommandWords.cs │ ├── 20180426202937_HangmanWords.Designer.cs │ ├── 20180426202937_HangmanWords.cs │ ├── 20180503185218_CreateScheduleEntity.Designer.cs │ ├── 20180503185218_CreateScheduleEntity.cs │ ├── 20180505175350_Create-CommandUsageEntities.Designer.cs │ ├── 20180505175350_Create-CommandUsageEntities.cs │ ├── 20180505181259_Add-UserIdColumn.Designer.cs │ ├── 20180505181259_Add-UserIdColumn.cs │ ├── 20180505183605_Add-ChatClientUsedColumn.Designer.cs │ ├── 20180505183605_Add-ChatClientUsedColumn.cs │ ├── 20180512180351_CreateQuizQuestionsTable.Designer.cs │ ├── 20180512180351_CreateQuizQuestionsTable.cs │ ├── 20180609054837_Add-CommandSettings.Designer.cs │ ├── 20180609054837_Add-CommandSettings.cs │ ├── 20180609190031_RenameColumnToSettingsTypeName.Designer.cs │ ├── 20180609190031_RenameColumnToSettingsTypeName.cs │ ├── 20180721184245_CreateTimezonesTable.Designer.cs │ ├── 20180721184245_CreateTimezonesTable.cs │ ├── 20180816164558_AddLastSentColumn.Designer.cs │ ├── 20180816164558_AddLastSentColumn.cs │ ├── 20180908194947_AddAliasArgumentsTable.Designer.cs │ ├── 20180908194947_AddAliasArgumentsTable.cs │ ├── 20180914171143_AddUniqueIndex-CommandWords.Designer.cs │ ├── 20180914171143_AddUniqueIndex-CommandWords.cs │ ├── 20180915190758_AddBlastTypeTable.Designer.cs │ ├── 20180915190758_AddBlastTypeTable.cs │ ├── 20180920181900_AddAliasTable.Designer.cs │ ├── 20180920181900_AddAliasTable.cs │ ├── 20180920190708_AddIsEnabledToCommandTable.Designer.cs │ ├── 20180920190708_AddIsEnabledToCommandTable.cs │ ├── 20180920195333_AddRoleRequiredToCommandTable.Designer.cs │ ├── 20180920195333_AddRoleRequiredToCommandTable.cs │ ├── 20180922185822_AddCooldownAndHelpTextColumns.Designer.cs │ ├── 20180922185822_AddCooldownAndHelpTextColumns.cs │ ├── 20180927171659_AddCanvasPropertiesTable.Designer.cs │ ├── 20180927171659_AddCanvasPropertiesTable.cs │ ├── 20181013180243_AddingWeightColumnToIntervalMessages.Designer.cs │ ├── 20181013180243_AddingWeightColumnToIntervalMessages.cs │ ├── 20181013183736_RemoveDelayInMinutesFromIntervalMessages.Designer.cs │ ├── 20181013183736_RemoveDelayInMinutesFromIntervalMessages.cs │ ├── 20181030182612_AddGameEndRecordTable.Designer.cs │ ├── 20181030182612_AddGameEndRecordTable.cs │ ├── 20181030195300_AddSurvivorAndTeamTables.Designer.cs │ ├── 20181030195300_AddSurvivorAndTeamTables.cs │ ├── 20181106192726_RemoveGameDataTables.Designer.cs │ ├── 20181106192726_RemoveGameDataTables.cs │ └── AppDataContextModelSnapshot.cs ├── DevChatter.Bot.Infra.GoogleApi ├── DevChatter.Bot.Infra.GoogleApi.csproj └── GoogleApiTimezoneLookup.cs ├── DevChatter.Bot.Infra.Twitch ├── DevChatter.Bot.Infra.Twitch.csproj ├── Events │ ├── TwitchFollowerService.cs │ └── TwitchSubscriberHandler.cs ├── Extensions │ ├── EventArgsExtensions.cs │ └── ModelExtensions.cs ├── TwitchChatClient.cs ├── TwitchClientSettings.cs └── TwitchStreamingInfoService.cs ├── DevChatter.Bot.Infra.Web ├── AnimationDisplayNotification.cs ├── DevChatter.Bot.Infra.Web.csproj ├── DevChatterBotBackgroundWorker.cs ├── HangmanDisplayNotification.cs ├── Hubs │ ├── BotHub.cs │ ├── HangmanHub.cs │ └── VotingHub.cs └── VotingDisplayNotification.cs ├── DevChatter.Bot.Modules.WastefulGame ├── Commands │ ├── InventoryCommand.cs │ ├── Operations │ │ ├── BaseGameCommandOperation.cs │ │ ├── BuyShopItemOperation.cs │ │ ├── IGameCommandOperation.cs │ │ ├── JoinTeamOperation.cs │ │ ├── LeaveTeamOperation.cs │ │ ├── ListTeamsOperation.cs │ │ ├── RankTeamsOperation.cs │ │ └── SellShopItemOperation.cs │ ├── ShopCommand.cs │ ├── TeamCommand.cs │ ├── WastefulMoveCommand.cs │ ├── WastefulRankCommand.cs │ └── WastefulStartCommand.cs ├── Data │ ├── EfGameRepository.cs │ ├── GameDataContext.cs │ └── IGameRepository.cs ├── DevChatter.Bot.Modules.WastefulGame.csproj ├── GameScheduler.cs ├── GameStates │ ├── BetweenGames.cs │ ├── GameStateInfo.cs │ ├── IGameState.cs │ ├── OpenGame.cs │ └── RunningGame.cs ├── Hubs │ ├── Dtos │ │ ├── HeldItemDto.cs │ │ ├── SurvivorRankingDataDto.cs │ │ └── SurvivorRecordDto.cs │ └── WastefulHub.cs ├── IWastefulDisplay.cs ├── IWastefulDisplayNotification.cs ├── Migrations │ ├── 20181106191126_InitialCreate.Designer.cs │ ├── 20181106191126_InitialCreate.cs │ ├── 20181106191308_CreateInitialTables.Designer.cs │ ├── 20181106191308_CreateInitialTables.cs │ ├── 20181106213627_AddMoneyColumnToSurvivor.Designer.cs │ ├── 20181106213627_AddMoneyColumnToSurvivor.cs │ ├── 20181110200254_AddEndTypeAndInventory.Designer.cs │ ├── 20181110200254_AddEndTypeAndInventory.cs │ ├── 20181112193900_MakeGameEndTypeNonNullable.Designer.cs │ ├── 20181112193900_MakeGameEndTypeNonNullable.cs │ ├── 20181115190756_CreateShopItemTable.Designer.cs │ ├── 20181115190756_CreateShopItemTable.cs │ ├── 20181115195731_AddUsesColumnToShopItem.Designer.cs │ ├── 20181115195731_AddUsesColumnToShopItem.cs │ ├── 20181127193116_AddLocationsTable.Designer.cs │ ├── 20181127193116_AddLocationsTable.cs │ ├── 20181127193934_AddLocationIdToSurvivorTable.Designer.cs │ ├── 20181127193934_AddLocationIdToSurvivorTable.cs │ ├── 20181127201348_AddEscapeTypeToLocation.Designer.cs │ ├── 20181127201348_AddEscapeTypeToLocation.cs │ ├── 20181127201917_UniqueIndexOnEscapeType.Designer.cs │ ├── 20181127201917_UniqueIndexOnEscapeType.cs │ └── GameDataContextModelSnapshot.cs ├── Model │ ├── Enums │ │ └── EndTypes.cs │ ├── GameData.cs │ ├── GameEndRecord.cs │ ├── InventoryItem.cs │ ├── Location.cs │ ├── ShopItem.cs │ ├── Specifications │ │ ├── GameDataPolicy.cs │ │ ├── LocationSpecification.cs │ │ ├── ShopItemPolicy.cs │ │ ├── SurvivorPolicy.cs │ │ └── TeamPolicy.cs │ ├── Survivor.cs │ └── Team.cs ├── Startup │ ├── SetUpGameDatabase.cs │ └── WastefulAutofacModule.cs ├── SurvivorRepo.cs ├── WastefulDisplayNotification.cs ├── WastefulGame.cs └── WastefulMoveController.cs ├── DevChatter.Bot.Web ├── BotConfiguration.cs ├── DefaultData │ ├── DefaultCommandData.cs │ └── DefaultCommandData.json ├── DevChatter.Bot.Web.csproj ├── Extensions │ ├── ContainerBuilderExtensions.cs │ └── GameRegistrationExtensions.cs ├── Modules │ ├── CurrencyModule.cs │ └── TwitchModule.cs ├── Pages │ ├── Commands │ │ ├── Index.cshtml │ │ ├── Index.cshtml.cs │ │ ├── Manage │ │ │ ├── Details.cshtml │ │ │ ├── Details.cshtml.cs │ │ │ ├── Edit.cshtml │ │ │ ├── Edit.cshtml.cs │ │ │ ├── Index.cshtml │ │ │ └── Index.cshtml.cs │ │ └── Quotes │ │ │ ├── Create.cshtml │ │ │ ├── Create.cshtml.cs │ │ │ ├── Delete.cshtml │ │ │ ├── Delete.cshtml.cs │ │ │ ├── Details.cshtml │ │ │ ├── Details.cshtml.cs │ │ │ ├── Edit.cshtml │ │ │ ├── Edit.cshtml.cs │ │ │ ├── Index.cshtml │ │ │ └── Index.cshtml.cs │ ├── Error.cshtml │ ├── Error.cshtml.cs │ ├── Games │ │ ├── Hangman │ │ │ ├── Create.cshtml │ │ │ ├── Create.cshtml.cs │ │ │ ├── Delete.cshtml │ │ │ ├── Delete.cshtml.cs │ │ │ ├── Details.cshtml │ │ │ ├── Details.cshtml.cs │ │ │ ├── Edit.cshtml │ │ │ ├── Edit.cshtml.cs │ │ │ ├── Index.cshtml │ │ │ └── Index.cshtml.cs │ │ ├── Index.cshtml │ │ ├── Index.cshtml.cs │ │ └── QuizQuestions │ │ │ ├── Create.cshtml │ │ │ ├── Create.cshtml.cs │ │ │ ├── Delete.cshtml │ │ │ ├── Delete.cshtml.cs │ │ │ ├── Details.cshtml │ │ │ ├── Details.cshtml.cs │ │ │ ├── Edit.cshtml │ │ │ ├── Edit.cshtml.cs │ │ │ ├── Index.cshtml │ │ │ └── Index.cshtml.cs │ ├── Index.cshtml │ ├── Index.cshtml.cs │ ├── ManageOverlay │ │ ├── Create.cshtml │ │ ├── Create.cshtml.cs │ │ ├── Delete.cshtml │ │ ├── Delete.cshtml.cs │ │ ├── Details.cshtml │ │ ├── Details.cshtml.cs │ │ ├── Edit.cshtml │ │ ├── Edit.cshtml.cs │ │ ├── Index.cshtml │ │ └── Index.cshtml.cs │ ├── Overlay.cshtml │ ├── Overlay.cshtml.cs │ ├── Privacy.cshtml │ ├── Privacy.cshtml.cs │ ├── Schedule │ │ ├── Create.cshtml │ │ ├── Create.cshtml.cs │ │ ├── Delete.cshtml │ │ ├── Delete.cshtml.cs │ │ ├── Details.cshtml │ │ ├── Details.cshtml.cs │ │ ├── Edit.cshtml │ │ ├── Edit.cshtml.cs │ │ ├── Index.cshtml │ │ └── Index.cshtml.cs │ ├── Shared │ │ ├── _CookieConsentPartial.cshtml │ │ ├── _Layout.cshtml │ │ └── _ValidationScriptsPartial.cshtml │ ├── _ViewImports.cshtml │ └── _ViewStart.cshtml ├── Program.cs ├── Setup │ ├── CommandDataInitializer.cs │ └── SetUpDatabase.cs ├── Startup.cs ├── ViewModels │ └── ScheduleViewModel.cs ├── appsettings.Development.json ├── appsettings.json └── wwwroot │ ├── css │ ├── site.css │ └── site.min.css │ ├── favicon.ico │ ├── images │ ├── BibleThump.png │ ├── DevchaDerpEmote.png │ ├── DevchaFailEmote.png │ ├── DevchaHypeEmote.png │ └── ZedChatter │ │ ├── Axe-0.png │ │ ├── Axe-1.png │ │ ├── Barrel-0.png │ │ ├── BarrelFires-0.png │ │ ├── BaseballBat-0.png │ │ ├── BaseballBat-1.png │ │ ├── BlackCan-0.png │ │ ├── BlueCan-0.png │ │ ├── BluePotion-0.png │ │ ├── Campfire-0.png │ │ ├── CoinPile-0.png │ │ ├── CoinStack-0.png │ │ ├── ExitTile-0.png │ │ ├── Flooring │ │ └── Metal │ │ │ ├── MetalPlateFloor-0.png │ │ │ ├── MetalRivetTileFloor-0.png │ │ │ ├── MetalTileFloor-0.png │ │ │ └── MetalTileFloor-1.png │ │ ├── Fresh-Gravestone-0.png │ │ ├── Fresh-Gravestone-1.png │ │ ├── GreenPotion-0.png │ │ ├── Hat-YellowShirt-Player-Idle-0.png │ │ ├── HeliPad-0.png │ │ ├── NailBat-0.png │ │ ├── Pizza-0.png │ │ ├── Player-Idle-0.png │ │ ├── Player-Step-0.png │ │ ├── Player-StepContact-0.png │ │ ├── Player-Sure-0.png │ │ ├── PlayerWalk-SpriteSheet0.png │ │ ├── RedPotion-0.png │ │ ├── RockyGroundTile-0.png │ │ ├── RockyGroundTile-1.png │ │ ├── RockyGroundTile-2.png │ │ ├── Skelly-ArmsUp.png │ │ ├── StonePath-0.png │ │ ├── Sword-0.png │ │ ├── Sword-1.png │ │ ├── Taco-0.png │ │ ├── Taco-1.png │ │ ├── Tires-0.png │ │ ├── TiresFire-0.png │ │ ├── TiresFire-1.png │ │ ├── TrashCanLid-0.png │ │ ├── UndergroundEscape-0.png │ │ ├── Walls │ │ ├── ExteriorWall-Blue-Door-0.png │ │ ├── ExteriorWall-Blue-Left-0.png │ │ ├── ExteriorWall-Blue-Middle-0.png │ │ ├── ExteriorWall-Blue-MiddleWindow-0.png │ │ ├── ExteriorWall-Blue-Right-0.png │ │ ├── ExteriorWall-Wood-Middle-0.png │ │ ├── InteriorWall-A-LBlock-0.png │ │ ├── InteriorWall-A-Left-0.png │ │ ├── InteriorWall-A-Lower-0.png │ │ ├── InteriorWall-A-LowerLeft-0.png │ │ ├── InteriorWall-A-LowerRight-0.png │ │ ├── InteriorWall-A-Middle-0.png │ │ ├── InteriorWall-A-Nothing-0.png │ │ ├── InteriorWall-A-ReverseLBlock-0.png │ │ ├── InteriorWall-A-Right-0.png │ │ ├── InteriorWall-A-TopLeft-0.png │ │ ├── InteriorWall-A-TopRight-0.png │ │ ├── Room-PoC.pdn │ │ └── Room-PoC.png │ │ ├── WoodenBoardNail-0.png │ │ ├── Yellow-Hat-PlayerWalk-SpriteSheet0.png │ │ ├── Yellow-PlayerWalk-SpriteSheet0.png │ │ ├── Yellow-PlayerWalk-SpriteSheet1.png │ │ ├── Zombie-0.png │ │ ├── Zombie-Gravestone-0.png │ │ └── Zombie-Gravestone-1.png │ ├── js │ ├── animations.js │ ├── hangman.js │ ├── overlay.js │ ├── site.js │ ├── site.min.js │ ├── sprite.js │ ├── voting.js │ └── wasteful-game │ │ ├── background.js │ │ ├── entity │ │ ├── abstracts │ │ │ └── enemy.js │ │ ├── components │ │ │ ├── attackableComponent.js │ │ │ ├── attackingComponent.js │ │ │ ├── autonomousComponent.js │ │ │ ├── component.js │ │ │ ├── movableComponent.js │ │ │ └── spawnableComponent.js │ │ ├── enemies │ │ │ └── simple-zombie.js │ │ ├── entity.js │ │ ├── items │ │ │ ├── effect-item.js │ │ │ ├── escape-item.js │ │ │ ├── exit-item.js │ │ │ └── item.js │ │ ├── obstacles.js │ │ ├── player.js │ │ ├── sprite.js │ │ └── structure │ │ │ ├── ex-wall.js │ │ │ └── wall.js │ │ ├── entityManager.js │ │ ├── grid.js │ │ ├── helpers │ │ └── mediator.js │ │ ├── inventory.js │ │ ├── level-building │ │ ├── item-builder.js │ │ └── layouts.js │ │ ├── level.js │ │ ├── metadata.js │ │ ├── screen-display.js │ │ └── wasteful.js │ └── lib │ ├── awesome-notifications │ └── dist │ │ ├── index.js │ │ ├── index.var.js │ │ └── style.css │ ├── bootstrap │ ├── .bower.json │ ├── LICENSE │ └── dist │ │ ├── css │ │ ├── bootstrap-theme.css │ │ ├── bootstrap-theme.css.map │ │ ├── bootstrap-theme.min.css │ │ ├── bootstrap-theme.min.css.map │ │ ├── bootstrap.css │ │ ├── bootstrap.css.map │ │ ├── bootstrap.min.css │ │ └── bootstrap.min.css.map │ │ ├── fonts │ │ ├── glyphicons-halflings-regular.eot │ │ ├── glyphicons-halflings-regular.svg │ │ ├── glyphicons-halflings-regular.ttf │ │ ├── glyphicons-halflings-regular.woff │ │ └── glyphicons-halflings-regular.woff2 │ │ └── js │ │ ├── bootstrap.js │ │ ├── bootstrap.min.js │ │ └── npm.js │ ├── chartjs │ ├── Chart.bundle.js │ ├── Chart.bundle.min.js │ ├── Chart.js │ └── Chart.min.js │ ├── jquery-validation-unobtrusive │ ├── .bower.json │ ├── LICENSE.txt │ ├── jquery.validate.unobtrusive.js │ └── jquery.validate.unobtrusive.min.js │ ├── jquery-validation │ ├── .bower.json │ ├── LICENSE.md │ └── dist │ │ ├── additional-methods.js │ │ ├── additional-methods.min.js │ │ ├── jquery.validate.js │ │ └── jquery.validate.min.js │ ├── jquery │ ├── .bower.json │ ├── LICENSE.txt │ └── dist │ │ ├── jquery.js │ │ ├── jquery.min.js │ │ └── jquery.min.map │ ├── pathfindingjs │ ├── pathfinding-browser.js │ └── pathfinding-browser.min.js │ └── signalr │ ├── signalr.js │ ├── signalr.js.map │ ├── signalr.min.js │ └── signalr.min.js.map ├── DevChatterBot.sln ├── UnitTests ├── Core │ ├── Automation │ │ ├── AutomationSystemTests │ │ │ ├── AddActionShould.cs │ │ │ └── AutomationSystemShould.cs │ │ └── CurrencyUpdateTests │ │ │ └── IsTimeToRunShould.cs │ ├── BotModules │ │ ├── DuelingModule │ │ │ └── DuelingSystemTests │ │ │ │ └── GetChallengesShould.cs │ │ └── VotingModules │ │ │ ├── TestableVoteCommand.cs │ │ │ └── VoteCommand_SetEndShould.cs │ ├── Commands │ │ ├── BaseCommandTests │ │ │ ├── RefreshCommandWordsShould.cs │ │ │ └── TestBaseCommand.cs │ │ ├── BlastCommandTests │ │ │ └── HandleCommandShould.cs │ │ ├── Operations │ │ │ ├── AddAliasOperationTests │ │ │ │ └── TryToExecuteShould.cs │ │ │ ├── AddCommandOperationTests │ │ │ │ └── TryToExecuteShould.cs │ │ │ ├── DeleteCommandOperationTests │ │ │ │ └── TryToExecuteShould.cs │ │ │ └── TopCommandsOperationTests │ │ │ │ └── TryToExecuteShould.cs │ │ ├── QuoteCommandTests │ │ │ └── ProcessShould.cs │ │ ├── ScheduleCommandTests │ │ │ └── ProcessShould.cs │ │ ├── SimpleCommandTests │ │ │ └── ProcessShould.cs │ │ ├── TopCommandTests │ │ │ ├── GenerateMessageShould.cs │ │ │ └── ProcessShould.cs │ │ └── Trackers │ │ │ └── CommandCooldownTrackerTests │ │ │ └── GetUsagesByUserSubjectToGlobalCooldownShould.cs │ ├── Data │ │ └── SettingsFactoryTests │ │ │ └── GetSettingsShould.cs │ ├── Events │ │ ├── CommandHandlerTests │ │ │ └── CommandReceivedHandlerShould.cs │ │ └── CurrencyGeneratorTests │ │ │ └── AddCurrencyToShould.cs │ ├── Extensions │ │ ├── FindTokensShould.cs │ │ ├── NoAtShould.cs │ │ └── TaskExtensionsTests │ │ │ └── TryGetResultShould.cs │ ├── Games │ │ ├── Hangman │ │ │ └── HangmanGameTests │ │ │ │ └── CalculateLetterAwardsShould.cs │ │ ├── Heist │ │ │ ├── HeistGameTests │ │ │ │ └── AttemptToJoinHeistShould.cs │ │ │ └── HeistMissionTests │ │ │ │ └── AttemptHeistShould.cs │ │ └── Quiz │ │ │ └── QuizGameTests │ │ │ ├── AttemptToJoinShould.cs │ │ │ └── StartGameShould.cs │ ├── Messaging │ │ └── SimpleTokenTests │ │ │ └── ReplaceCommandValuesShould.cs │ └── Util │ │ └── MyRandomTests │ │ ├── ChooseRandomItemShould.cs │ │ └── ChooseRandomWeightedItemShouldReturn.cs ├── DataBuilders │ └── CommandEntityBuilder.cs ├── Fakes │ ├── FakeActionSystem.cs │ ├── FakeClock.cs │ ├── FakeCommand.cs │ └── FakeIntervalAction.cs ├── ScratchTesting.cs └── UnitTests.csproj ├── WastefulGame.UnitTests ├── Commands │ └── Operations │ │ ├── JoinTeamOperationShould.cs │ │ └── SellShopItemOperationShould.cs ├── Model │ └── SurvivorTests │ │ ├── BuyItemShould.cs │ │ └── SellItemShould.cs └── WastefulGame.UnitTests.csproj ├── package-lock.json └── package.json /.gitattributes: -------------------------------------------------------------------------------- 1 | # Auto detect text files and perform LF normalization 2 | * text=auto 3 | 4 | # Custom for Visual Studio 5 | *.cs diff=csharp 6 | 7 | # Standard to msysgit 8 | *.doc diff=astextplain 9 | *.DOC diff=astextplain 10 | *.docx diff=astextplain 11 | *.DOCX diff=astextplain 12 | *.dot diff=astextplain 13 | *.DOT diff=astextplain 14 | *.pdf diff=astextplain 15 | *.PDF diff=astextplain 16 | *.rtf diff=astextplain 17 | *.RTF diff=astextplain 18 | -------------------------------------------------------------------------------- /Dockerfile: -------------------------------------------------------------------------------- 1 | FROM microsoft/dotnet 2 | MAINTAINER dpritchett@gmail.com 3 | 4 | ADD . /opt/devchatterbot 5 | 6 | WORKDIR /opt/devchatterbot 7 | 8 | CMD ["cd /opt/devchatterbot/src/UnitTests", "dotnet test"] 9 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2018 DevChatter 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /docker-compose.yml: -------------------------------------------------------------------------------- 1 | version: '3' 2 | services: 3 | bot: 4 | build: . # use the local Dockerfile 5 | command: bash --login 6 | 7 | test: 8 | build: . # use the local Dockerfile 9 | command: bash -c "cd /opt/devchatterbot/src/UnitTests && dotnet test" 10 | -------------------------------------------------------------------------------- /src/DevChatter.Bot.Core/Automation/DelayedMessageAction.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using DevChatter.Bot.Core.Systems.Chat; 3 | 4 | namespace DevChatter.Bot.Core.Automation 5 | { 6 | public class DelayedMessageAction 7 | : IIntervalAction, IAutomatedItem, IDelayed, IAutomatedMessage 8 | { 9 | private readonly IChatClient _chatClient; 10 | private DateTime _nextRunTime; 11 | public TimeSpan DelayTimeSpan { get; } 12 | public string Message { get; } 13 | 14 | public DelayedMessageAction(int delayInSeconds, string message, 15 | IChatClient chatClient) 16 | { 17 | DelayTimeSpan = TimeSpan.FromSeconds(delayInSeconds); 18 | Message = message; 19 | _chatClient = chatClient; 20 | _nextRunTime = DateTime.UtcNow.AddSeconds(delayInSeconds); 21 | } 22 | 23 | public bool IsTimeToRun() => DateTime.UtcNow > _nextRunTime; 24 | 25 | public void Invoke() 26 | { 27 | _chatClient.SendMessage(Message); 28 | _nextRunTime = DateTime.MaxValue; 29 | } 30 | 31 | public bool IsDone => DateTime.MaxValue == _nextRunTime; 32 | } 33 | } 34 | -------------------------------------------------------------------------------- /src/DevChatter.Bot.Core/Automation/IAutomatedActionSystem.cs: -------------------------------------------------------------------------------- 1 | using System.Threading.Tasks; 2 | 3 | namespace DevChatter.Bot.Core.Automation 4 | { 5 | public interface IAutomatedActionSystem 6 | { 7 | Task Start(); 8 | void AddAction(IIntervalAction actionToAdd); 9 | } 10 | } 11 | -------------------------------------------------------------------------------- /src/DevChatter.Bot.Core/Automation/IIntervalAction.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Linq.Expressions; 3 | 4 | namespace DevChatter.Bot.Core.Automation 5 | { 6 | public interface IIntervalAction 7 | { 8 | bool IsTimeToRun(); 9 | void Invoke(); 10 | bool IsDone { get; } 11 | } 12 | 13 | public interface IAutomatedItem 14 | { 15 | } 16 | 17 | public interface IAutomatedAction 18 | { 19 | Expression Action { get; } 20 | } 21 | 22 | public interface IAutomatedMessage 23 | { 24 | string Message { get; } 25 | } 26 | 27 | public interface IInterval 28 | { 29 | TimeSpan IntervalTimeSpan { get; } 30 | } 31 | 32 | public interface IDelayed 33 | { 34 | TimeSpan DelayTimeSpan { get; } 35 | } 36 | } 37 | -------------------------------------------------------------------------------- /src/DevChatter.Bot.Core/Automation/OneTimeCallBackAction.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Linq.Expressions; 3 | 4 | namespace DevChatter.Bot.Core.Automation 5 | { 6 | public class OneTimeCallBackAction : IIntervalAction 7 | { 8 | protected DateTime _timeOfNextRun; 9 | public Expression Action { get; } 10 | 11 | public OneTimeCallBackAction(int delayInSeconds, Expression actionToCall) 12 | { 13 | Action = actionToCall; 14 | _timeOfNextRun = DateTime.UtcNow.AddSeconds(delayInSeconds); 15 | } 16 | 17 | public bool IsTimeToRun() => DateTime.UtcNow > _timeOfNextRun; 18 | 19 | public void Invoke() 20 | { 21 | _timeOfNextRun = DateTime.MaxValue; 22 | Action.Compile().Invoke(); 23 | } 24 | 25 | public bool IsDone => DateTime.MaxValue == _timeOfNextRun; 26 | } 27 | } 28 | -------------------------------------------------------------------------------- /src/DevChatter.Bot.Core/Automation/RepeatingCallbackAction.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | 3 | namespace DevChatter.Bot.Core.Automation 4 | { 5 | public class RepeatingCallbackAction : IIntervalAction 6 | { 7 | private readonly Action _callback; 8 | private readonly int _intervalInSeconds; 9 | 10 | public RepeatingCallbackAction(Action callback, int intervalInSeconds = 5) 11 | { 12 | _callback = callback; 13 | _intervalInSeconds = intervalInSeconds; 14 | NextRunTime = DateTime.UtcNow.AddSeconds(_intervalInSeconds); 15 | } 16 | public DateTime NextRunTime { get; set; } 17 | public bool IsTimeToRun() => DateTime.UtcNow > NextRunTime; 18 | 19 | public void Invoke() 20 | { 21 | try 22 | { 23 | _callback.Invoke(); 24 | } 25 | catch (Exception e) 26 | { 27 | Console.WriteLine(e); 28 | } 29 | NextRunTime = DateTime.UtcNow.AddSeconds(_intervalInSeconds); 30 | } 31 | 32 | public bool IsDone { get; } = false; 33 | } 34 | } 35 | -------------------------------------------------------------------------------- /src/DevChatter.Bot.Core/BotModules/DuelingModule/AcceptChallengeOperation.cs: -------------------------------------------------------------------------------- 1 | using System.Collections.Generic; 2 | using DevChatter.Bot.Core.Commands.Operations; 3 | using DevChatter.Bot.Core.Events.Args; 4 | 5 | namespace DevChatter.Bot.Core.BotModules.DuelingModule 6 | { 7 | public class AcceptChallengeOperation : BaseCommandOperation 8 | { 9 | private readonly DuelingSystem _duelingSystem; 10 | 11 | public AcceptChallengeOperation(DuelingSystem duelingSystem) 12 | { 13 | _duelingSystem = duelingSystem; 14 | } 15 | 16 | public override List OperandWords { get; } 17 | = new List{"ok", "accept", "yes", "fight"}; 18 | public override string HelpText { get; } = ""; 19 | public override string TryToExecute(CommandReceivedEventArgs eventArgs) 20 | { 21 | return "You have accepted the challenge!"; 22 | } 23 | } 24 | } 25 | -------------------------------------------------------------------------------- /src/DevChatter.Bot.Core/BotModules/VotingModule/DelayableCallbackAction.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Linq.Expressions; 3 | using DevChatter.Bot.Core.Automation; 4 | 5 | namespace DevChatter.Bot.Core.BotModules.VotingModule 6 | { 7 | public class DelayableCallbackAction : OneTimeCallBackAction 8 | { 9 | public DelayableCallbackAction(int delayInSeconds, Expression actionToCall) 10 | : base(delayInSeconds, actionToCall) 11 | { 12 | } 13 | 14 | public void SetTimeout(int seconds) 15 | { 16 | if (!IsDone) 17 | { 18 | _timeOfNextRun = DateTime.UtcNow.AddSeconds(seconds); 19 | } 20 | } 21 | } 22 | } 23 | -------------------------------------------------------------------------------- /src/DevChatter.Bot.Core/BotModules/VotingModule/VoteInfoDto.cs: -------------------------------------------------------------------------------- 1 | namespace DevChatter.Bot.Core.BotModules.VotingModule 2 | { 3 | public class VoteInfoDto 4 | { 5 | public string VoterName { get; set; } 6 | public string VoterChoiceName { get; set; } 7 | public int[] VoteTotals { get; set; } 8 | } 9 | } 10 | -------------------------------------------------------------------------------- /src/DevChatter.Bot.Core/Caching/ICacheLayer.cs: -------------------------------------------------------------------------------- 1 | using DevChatter.Bot.Core.GoogleApi; 2 | using System; 3 | 4 | namespace DevChatter.Bot.Core.Caching 5 | { 6 | public interface ICacheLayer 7 | { 8 | TimezoneLookupResult GetOrInsertTimezone(string lookup, Func fallback); 9 | } 10 | } 11 | -------------------------------------------------------------------------------- /src/DevChatter.Bot.Core/Commands/IBotCommand.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using DevChatter.Bot.Core.Commands.Trackers; 4 | using DevChatter.Bot.Core.Data.Model; 5 | using DevChatter.Bot.Core.Events.Args; 6 | using DevChatter.Bot.Core.Systems.Chat; 7 | 8 | namespace DevChatter.Bot.Core.Commands 9 | { 10 | public interface IBotCommand 11 | { 12 | UserRole RoleRequired { get; } 13 | TimeSpan Cooldown { get; } 14 | string PrimaryCommandText { get; } 15 | string HelpText { get; } 16 | string FullHelpText { get; } 17 | bool ShouldExecute(string commandText, out IList args); 18 | CommandUsage Process(IChatClient chatClient, CommandReceivedEventArgs eventArgs); 19 | TimeSpan GetCooldownTimeRemaining(); 20 | bool IsActiveGame(); 21 | } 22 | } 23 | -------------------------------------------------------------------------------- /src/DevChatter.Bot.Core/Commands/Operations/BaseCommandOperation.cs: -------------------------------------------------------------------------------- 1 | using System.Collections.Generic; 2 | using System.Linq; 3 | using DevChatter.Bot.Core.Events.Args; 4 | using DevChatter.Bot.Core.Extensions; 5 | 6 | namespace DevChatter.Bot.Core.Commands.Operations 7 | { 8 | public abstract class BaseCommandOperation : ICommandOperation 9 | { 10 | public string PrimaryWord => OperandWords.FirstOrDefault(); 11 | public abstract List OperandWords { get; } 12 | public abstract string HelpText { get; } 13 | 14 | public virtual bool ShouldExecute(string operand) 15 | { 16 | return OperandWords.Any(w => w.EqualsIns(operand)); 17 | } 18 | 19 | public abstract string TryToExecute(CommandReceivedEventArgs eventArgs); 20 | } 21 | } 22 | -------------------------------------------------------------------------------- /src/DevChatter.Bot.Core/Commands/Operations/ICommandOperation.cs: -------------------------------------------------------------------------------- 1 | using DevChatter.Bot.Core.Events.Args; 2 | 3 | namespace DevChatter.Bot.Core.Commands.Operations 4 | { 5 | public interface ICommandOperation 6 | { 7 | bool ShouldExecute(string operand); 8 | string TryToExecute(CommandReceivedEventArgs eventArgs); 9 | } 10 | } 11 | -------------------------------------------------------------------------------- /src/DevChatter.Bot.Core/Commands/Trackers/CommandList.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections; 3 | using System.Collections.Generic; 4 | using System.Linq; 5 | 6 | namespace DevChatter.Bot.Core.Commands.Trackers 7 | { 8 | public class CommandList : IEnumerable 9 | { 10 | private readonly IList _list; 11 | 12 | public CommandList(IList list) 13 | { 14 | _list = list ?? throw new ArgumentNullException(nameof(list)); 15 | } 16 | 17 | public T GetCommandByType() where T : class, IBotCommand 18 | { 19 | return _list.OfType().SingleOrDefault(); 20 | } 21 | 22 | public IEnumerator GetEnumerator() 23 | { 24 | return _list.GetEnumerator(); 25 | } 26 | 27 | IEnumerator IEnumerable.GetEnumerator() 28 | { 29 | return ((IEnumerable) _list).GetEnumerator(); 30 | } 31 | 32 | public IBotCommand GetCommandByFullTypeName(string fullTypeName) 33 | { 34 | return _list.SingleOrDefault(x => x.GetType().FullName == fullTypeName); 35 | } 36 | } 37 | } 38 | -------------------------------------------------------------------------------- /src/DevChatter.Bot.Core/Commands/Trackers/CommandUsage.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | 3 | namespace DevChatter.Bot.Core.Commands.Trackers 4 | { 5 | public class CommandUsage 6 | { 7 | public CommandUsage(string displayName, DateTimeOffset timeInvoked, IBotCommand commandUsed) 8 | { 9 | DisplayName = displayName; 10 | TimeInvoked = timeInvoked; 11 | CommandUsed = commandUsed; 12 | } 13 | 14 | public string DisplayName { get; } 15 | public DateTimeOffset TimeInvoked { get; } 16 | public IBotCommand CommandUsed { get; } 17 | public bool WasUserWarned { get; set; } = false; 18 | } 19 | } 20 | -------------------------------------------------------------------------------- /src/DevChatter.Bot.Core/Commands/Trackers/ICommandUsageTracker.cs: -------------------------------------------------------------------------------- 1 | using DevChatter.Bot.Core.Data.Model; 2 | using DevChatter.Bot.Core.Events; 3 | using System; 4 | 5 | namespace DevChatter.Bot.Core.Commands.Trackers 6 | { 7 | public interface ICommandUsageTracker 8 | { 9 | void PurgeExpiredUserCommandCooldowns(DateTimeOffset currentTime); 10 | void RecordUsage(CommandUsage commandUsage); 11 | Cooldown GetActiveCooldown(ChatUser chatUser, IBotCommand botCommand); 12 | } 13 | } 14 | -------------------------------------------------------------------------------- /src/DevChatter.Bot.Core/Commands/ViewersCommand.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using DevChatter.Bot.Core.Data; 3 | using DevChatter.Bot.Core.Data.Model; 4 | using DevChatter.Bot.Core.Events.Args; 5 | using DevChatter.Bot.Core.Systems.Chat; 6 | using DevChatter.Bot.Core.Systems.Streaming; 7 | 8 | namespace DevChatter.Bot.Core.Commands 9 | { 10 | public class ViewersCommand : BaseCommand 11 | { 12 | private readonly IStreamingPlatform _streamingPlatform; 13 | 14 | public ViewersCommand(IRepository repository, IStreamingPlatform streamingPlatform) 15 | : base(repository) 16 | { 17 | _streamingPlatform = streamingPlatform; 18 | } 19 | 20 | protected override async void HandleCommand(IChatClient chatClient, CommandReceivedEventArgs eventArgs) 21 | { 22 | try 23 | { 24 | int viewerCount = await _streamingPlatform.GetViewerCountAsync(); 25 | 26 | chatClient.SendMessage($"We currently have {viewerCount} viewers!"); 27 | } 28 | catch (Exception) 29 | { 30 | chatClient.SendMessage("Something went wrong! We couldn't get the viewer count."); 31 | } 32 | } 33 | } 34 | } 35 | -------------------------------------------------------------------------------- /src/DevChatter.Bot.Core/CoreRegistrationModule.cs: -------------------------------------------------------------------------------- 1 | using Autofac; 2 | using DevChatter.Bot.Core.BotModules.DuelingModule; 3 | using DevChatter.Bot.Core.BotModules.VotingModule; 4 | 5 | namespace DevChatter.Bot.Core 6 | { 7 | public class CoreRegistrationModule : Module 8 | { 9 | protected override void Load(ContainerBuilder builder) 10 | { 11 | builder.RegisterType(); 12 | builder.RegisterType(); 13 | } 14 | } 15 | } 16 | -------------------------------------------------------------------------------- /src/DevChatter.Bot.Core/Data/IRepository.cs: -------------------------------------------------------------------------------- 1 | using System.Collections.Generic; 2 | using DevChatter.Bot.Core.Data.Model; 3 | using DevChatter.Bot.Core.Data.Specifications; 4 | 5 | namespace DevChatter.Bot.Core.Data 6 | { 7 | public interface IRepository 8 | { 9 | T Single(ISpecification spec) where T : DataEntity; 10 | List List(ISpecification spec = null) where T : DataEntity; 11 | T Create(T dataItem) where T : DataEntity; 12 | T Update(T dataItem) where T : DataEntity; 13 | void Update(List dataItemList) where T : DataEntity; 14 | void Create(List dataItemList) where T : DataEntity; 15 | void Remove(T dataItem) where T : DataEntity; 16 | void Remove(List dataItems) where T : DataEntity; 17 | } 18 | } 19 | -------------------------------------------------------------------------------- /src/DevChatter.Bot.Core/Data/ISettingsFactory.cs: -------------------------------------------------------------------------------- 1 | namespace DevChatter.Bot.Core.Data 2 | { 3 | public interface ISettingsFactory 4 | { 5 | T GetSettings() where T : class, new(); 6 | 7 | } 8 | } 9 | -------------------------------------------------------------------------------- /src/DevChatter.Bot.Core/Data/Model/AliasArgumentEntity.cs: -------------------------------------------------------------------------------- 1 | namespace DevChatter.Bot.Core.Data.Model 2 | { 3 | public class AliasArgumentEntity : DataEntity 4 | { 5 | public AliasEntity Alias { get; set; } 6 | public int Index { get; set; } 7 | public string Argument { get; set; } 8 | } 9 | } 10 | -------------------------------------------------------------------------------- /src/DevChatter.Bot.Core/Data/Model/AliasEntity.cs: -------------------------------------------------------------------------------- 1 | using System.Collections.Generic; 2 | 3 | namespace DevChatter.Bot.Core.Data.Model 4 | { 5 | public class AliasEntity : DataEntity 6 | { 7 | public CommandEntity Command { get; set; } 8 | public string Word { get; set; } 9 | public List Arguments { get; set; } 10 | = new List(); 11 | } 12 | } 13 | -------------------------------------------------------------------------------- /src/DevChatter.Bot.Core/Data/Model/BlastTypeEntity.cs: -------------------------------------------------------------------------------- 1 | namespace DevChatter.Bot.Core.Data.Model 2 | { 3 | public class BlastTypeEntity : DataEntity 4 | { 5 | public string Name { get; set; } 6 | public string Message { get; set; } 7 | public string ImagePath { get; set; } 8 | } 9 | } 10 | -------------------------------------------------------------------------------- /src/DevChatter.Bot.Core/Data/Model/CanvasDimensions.cs: -------------------------------------------------------------------------------- 1 | namespace DevChatter.Bot.Core.Data.Model 2 | { 3 | public class CanvasProperties : DataEntity 4 | { 5 | public string CanvasId { get; set; } 6 | public int Width { get; set; } 7 | public int Height { get; set; } 8 | public int TopY { get; set; } 9 | public int LeftX { get; set; } 10 | } 11 | } 12 | -------------------------------------------------------------------------------- /src/DevChatter.Bot.Core/Data/Model/ChatUser.cs: -------------------------------------------------------------------------------- 1 | using DevChatter.Bot.Core.Commands; 2 | 3 | namespace DevChatter.Bot.Core.Data.Model 4 | { 5 | public class ChatUser : DataEntity 6 | { 7 | public string UserId { get; set; } 8 | public string DisplayName { get; set; } 9 | public UserRole? Role { get; set; } 10 | public int Tokens { get; set; } 11 | 12 | public bool CanRunCommand(IBotCommand botCommand) 13 | { 14 | return IsInThisRoleOrHigher(botCommand.RoleRequired); 15 | } 16 | 17 | public bool IsInThisRoleOrHigher(UserRole userRole) 18 | { 19 | return (Role ?? UserRole.Everyone) <= userRole; 20 | } 21 | } 22 | } 23 | -------------------------------------------------------------------------------- /src/DevChatter.Bot.Core/Data/Model/CommandEntity.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using Newtonsoft.Json; 4 | using Newtonsoft.Json.Converters; 5 | 6 | namespace DevChatter.Bot.Core.Data.Model 7 | { 8 | public class CommandEntity : DataEntity 9 | { 10 | public string CommandWord { get; set; } 11 | public string FullTypeName { get; set; } 12 | public List Aliases { get; set; } = new List(); 13 | public bool IsEnabled { get; set; } = true; 14 | 15 | [JsonConverter(typeof(StringEnumConverter))] 16 | public UserRole RequiredRole { get; set; } = UserRole.Everyone; 17 | public TimeSpan Cooldown { get; set; } = TimeSpan.Zero; 18 | public string HelpText { get; set; } 19 | } 20 | } 21 | -------------------------------------------------------------------------------- /src/DevChatter.Bot.Core/Data/Model/CommandSettingsEntity.cs: -------------------------------------------------------------------------------- 1 | namespace DevChatter.Bot.Core.Data.Model 2 | { 3 | public class CommandSettingsEntity : DataEntity 4 | { 5 | public string SettingsTypeName { get; set; } 6 | public string Key { get; set; } 7 | public string Value { get; set; } 8 | } 9 | } 10 | -------------------------------------------------------------------------------- /src/DevChatter.Bot.Core/Data/Model/CommandUsageEntity.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | 3 | namespace DevChatter.Bot.Core.Data.Model 4 | { 5 | public class CommandUsageEntity : DataEntity 6 | { 7 | public CommandUsageEntity() 8 | { 9 | } 10 | 11 | public CommandUsageEntity(string commandWord, string fullTypeName, 12 | string userId, string userDisplayName, string chatClientUsed) 13 | { 14 | CommandWord = commandWord; 15 | FullTypeName = fullTypeName; 16 | UserId = userId; 17 | UserDisplayName = userDisplayName; 18 | ChatClientUsed = chatClientUsed; 19 | } 20 | 21 | public string CommandWord { get; set; } 22 | public string FullTypeName { get; set; } 23 | public string UserId { get; set; } 24 | public string UserDisplayName { get; set; } 25 | public string ChatClientUsed { get; set; } 26 | public DateTimeOffset DateTimeUsed { get; set; } = DateTimeOffset.UtcNow; 27 | } 28 | } 29 | -------------------------------------------------------------------------------- /src/DevChatter.Bot.Core/Data/Model/DataEntity.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | 3 | namespace DevChatter.Bot.Core.Data.Model 4 | { 5 | public abstract class DataEntity 6 | { 7 | public Guid Id { get; set; } 8 | } 9 | } 10 | -------------------------------------------------------------------------------- /src/DevChatter.Bot.Core/Data/Model/HangmanWord.cs: -------------------------------------------------------------------------------- 1 | namespace DevChatter.Bot.Core.Data.Model 2 | { 3 | public class HangmanWord : DataEntity 4 | { 5 | public HangmanWord() 6 | { 7 | } 8 | 9 | public HangmanWord(string word) 10 | { 11 | Word = word; 12 | } 13 | 14 | public string Word { get; set; } 15 | } 16 | } 17 | -------------------------------------------------------------------------------- /src/DevChatter.Bot.Core/Data/Model/IntervalMessage.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using DevChatter.Bot.Core.Util; 3 | 4 | namespace DevChatter.Bot.Core.Data.Model 5 | { 6 | public class IntervalMessage : DataEntity, IWeightedItem 7 | { 8 | public IntervalMessage() 9 | { 10 | } 11 | 12 | public IntervalMessage(string messageText, int weight = 1) 13 | { 14 | MessageText = messageText; 15 | Weight = weight; 16 | } 17 | 18 | public string MessageText { get; protected set; } 19 | public int Weight { get; protected set; } 20 | 21 | public DateTime LastSent { get; set; } = DateTime.UtcNow; 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /src/DevChatter.Bot.Core/Data/Model/QuoteEntity.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | 3 | namespace DevChatter.Bot.Core.Data.Model 4 | { 5 | public class QuoteEntity : DataEntity 6 | { 7 | public int QuoteId { get; set; } 8 | public string Text { get; set; } 9 | public string Author { get; set; } 10 | public string AddedBy { get; set; } 11 | public DateTime DateAdded { get; set; } = DateTime.Now; 12 | 13 | public override string ToString() => $"\"{Text}\" - {Author}, {DateAdded.ToShortDateString()}"; 14 | } 15 | } 16 | -------------------------------------------------------------------------------- /src/DevChatter.Bot.Core/Data/Model/ScheduleEntity.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.ComponentModel; 3 | using NodaTime; 4 | 5 | namespace DevChatter.Bot.Core.Data.Model 6 | { 7 | public class ScheduleEntity : DataEntity 8 | { 9 | public Instant Instant => Instant.FromDateTimeOffset(ExampleDateTime); 10 | [DisplayName("Stream Example Date Time")] 11 | public DateTimeOffset ExampleDateTime { get; set; } 12 | } 13 | } 14 | -------------------------------------------------------------------------------- /src/DevChatter.Bot.Core/Data/Model/StreamerEntity.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | 3 | namespace DevChatter.Bot.Core.Data.Model 4 | { 5 | public class StreamerEntity : DataEntity 6 | { 7 | public string ChannelName { get; set; } 8 | public DateTime DateAdded { get; set; } = DateTime.UtcNow; 9 | public int TimesShoutedOut { get; set; } = 0; 10 | } 11 | } 12 | -------------------------------------------------------------------------------- /src/DevChatter.Bot.Core/Data/Model/TimezoneEntity.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using DevChatter.Bot.Core.GoogleApi; 3 | 4 | namespace DevChatter.Bot.Core.Data.Model 5 | { 6 | public class TimezoneEntity : DataEntity 7 | { 8 | public string TimezoneName { get; set; } 9 | public string LookupString { get; set; } 10 | public float Latitude { get; set; } 11 | public float Longitude { get; set; } 12 | public int Offset { get; set; } 13 | public DateTime DateUpdated { get; set; } = DateTime.UtcNow; 14 | 15 | public TimezoneLookupResult ToTimezoneLookupResult() 16 | { 17 | return new TimezoneLookupResult 18 | { 19 | Offset = Offset, 20 | TimezoneName = TimezoneName, 21 | Success = true, 22 | }; 23 | } 24 | } 25 | } 26 | -------------------------------------------------------------------------------- /src/DevChatter.Bot.Core/Data/Model/UserRole.cs: -------------------------------------------------------------------------------- 1 | namespace DevChatter.Bot.Core.Data.Model 2 | { 3 | public enum UserRole 4 | { 5 | Streamer = 1, 6 | Mod = 2, 7 | Subscriber = 3, 8 | Everyone = 4 9 | } 10 | } 11 | -------------------------------------------------------------------------------- /src/DevChatter.Bot.Core/Data/Specifications/BlastTypeEntityPolicy.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Linq.Expressions; 3 | using DevChatter.Bot.Core.Data.Model; 4 | 5 | namespace DevChatter.Bot.Core.Data.Specifications 6 | { 7 | public class BlastTypeEntityPolicy : DataItemPolicy 8 | { 9 | protected BlastTypeEntityPolicy(Expression> expression) : base(expression) 10 | { 11 | } 12 | 13 | public static BlastTypeEntityPolicy ByName(string name) 14 | { 15 | return new BlastTypeEntityPolicy(x => x.Name == name); 16 | } 17 | } 18 | } 19 | -------------------------------------------------------------------------------- /src/DevChatter.Bot.Core/Data/Specifications/ChatUserPolicy.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Linq.Expressions; 5 | using DevChatter.Bot.Core.Data.Model; 6 | 7 | namespace DevChatter.Bot.Core.Data.Specifications 8 | { 9 | public class ChatUserPolicy : DataItemPolicy 10 | { 11 | protected ChatUserPolicy(Expression> expression) : base(expression) 12 | { 13 | } 14 | 15 | public static ChatUserPolicy ByDisplayName(string displayName) 16 | { 17 | return new ChatUserPolicy(x => x.DisplayName == displayName); 18 | } 19 | 20 | public static ChatUserPolicy ByDisplayName(IEnumerable listOfNames) 21 | { 22 | return new ChatUserPolicy(x => listOfNames.Contains(x.DisplayName)); 23 | } 24 | } 25 | } 26 | -------------------------------------------------------------------------------- /src/DevChatter.Bot.Core/Data/Specifications/CommandPolicy.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Linq; 3 | using System.Linq.Expressions; 4 | using DevChatter.Bot.Core.Data.Model; 5 | 6 | namespace DevChatter.Bot.Core.Data.Specifications 7 | { 8 | public class CommandPolicy : DataItemPolicy 9 | { 10 | protected CommandPolicy(Expression> expression) : base(expression) 11 | { 12 | AddInclude(cw => cw.Aliases); 13 | AddInclude($"{nameof(CommandEntity.Aliases)}.{nameof(AliasEntity.Arguments)}"); 14 | } 15 | 16 | public static CommandPolicy ByType(Type type) 17 | { 18 | return new CommandPolicy(x => x.FullTypeName == type.FullName && x.IsEnabled); 19 | } 20 | 21 | public static CommandPolicy ByWord(string word) 22 | { 23 | return new CommandPolicy(x => x.CommandWord == word 24 | || x.Aliases.Any(a => a.Word == word)); 25 | } 26 | } 27 | } 28 | -------------------------------------------------------------------------------- /src/DevChatter.Bot.Core/Data/Specifications/CommandSettingsPolicy.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Linq.Expressions; 3 | using DevChatter.Bot.Core.Data.Model; 4 | 5 | namespace DevChatter.Bot.Core.Data.Specifications 6 | { 7 | public class CommandSettingsPolicy : DataItemPolicy 8 | { 9 | protected CommandSettingsPolicy(Expression> expression) : base(expression) 10 | { 11 | } 12 | 13 | public static CommandSettingsPolicy BySettingsName(string settingsName) 14 | { 15 | return new CommandSettingsPolicy(x => x.SettingsTypeName == settingsName); 16 | } 17 | } 18 | } 19 | -------------------------------------------------------------------------------- /src/DevChatter.Bot.Core/Data/Specifications/HangmanWordPolicy.cs: -------------------------------------------------------------------------------- 1 | using DevChatter.Bot.Core.Data.Model; 2 | using System; 3 | using System.Linq.Expressions; 4 | 5 | namespace DevChatter.Bot.Core.Data.Specifications 6 | { 7 | public class HangmanWordPolicy : DataItemPolicy 8 | { 9 | protected HangmanWordPolicy(Expression> expression) 10 | : base(expression) 11 | { 12 | } 13 | 14 | public static HangmanWordPolicy ByWord(string word) 15 | { 16 | return new HangmanWordPolicy(x => x.Word == word); 17 | } 18 | } 19 | } 20 | -------------------------------------------------------------------------------- /src/DevChatter.Bot.Core/Data/Specifications/ISpecification.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq.Expressions; 4 | 5 | namespace DevChatter.Bot.Core.Data.Specifications 6 | { 7 | public interface ISpecification 8 | { 9 | Expression> Criteria { get; } 10 | IList>> Includes { get; } 11 | IList IncludeStrings { get; } 12 | void AddInclude(Expression> expression); 13 | } 14 | } 15 | -------------------------------------------------------------------------------- /src/DevChatter.Bot.Core/Data/Specifications/IntervalMessagePolicy.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Linq.Expressions; 3 | using DevChatter.Bot.Core.Data.Model; 4 | 5 | namespace DevChatter.Bot.Core.Data.Specifications 6 | { 7 | public class IntervalMessagePolicy : DataItemPolicy 8 | { 9 | protected IntervalMessagePolicy(Expression> expression) 10 | : base(expression) 11 | { 12 | } 13 | } 14 | } 15 | -------------------------------------------------------------------------------- /src/DevChatter.Bot.Core/Data/Specifications/QuoteEntityPolicy.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Linq.Expressions; 3 | using DevChatter.Bot.Core.Data.Model; 4 | 5 | namespace DevChatter.Bot.Core.Data.Specifications 6 | { 7 | public class QuoteEntityPolicy : DataItemPolicy 8 | { 9 | protected QuoteEntityPolicy(Expression> expression) : base(expression) 10 | { 11 | } 12 | 13 | public new static QuoteEntityPolicy All { get; } = new QuoteEntityPolicy(x => true); 14 | 15 | public static QuoteEntityPolicy ByQuoteId(int? quoteId) 16 | { 17 | return new QuoteEntityPolicy(x => x.QuoteId == quoteId); 18 | } 19 | } 20 | } 21 | -------------------------------------------------------------------------------- /src/DevChatter.Bot.Core/Data/Specifications/SimpleCommandPolicy.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Linq.Expressions; 3 | using DevChatter.Bot.Core.Commands; 4 | 5 | namespace DevChatter.Bot.Core.Data.Specifications 6 | { 7 | public class SimpleCommandPolicy : DataItemPolicy 8 | { 9 | protected SimpleCommandPolicy(Expression> expression) : base(expression) 10 | { 11 | } 12 | 13 | public static SimpleCommandPolicy ByCommandText(string commandText) 14 | { 15 | return new SimpleCommandPolicy(x => x.CommandText == commandText); 16 | } 17 | } 18 | } 19 | -------------------------------------------------------------------------------- /src/DevChatter.Bot.Core/Data/Specifications/StreamerEntityPolicy.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Linq.Expressions; 3 | using DevChatter.Bot.Core.Data.Model; 4 | 5 | namespace DevChatter.Bot.Core.Data.Specifications 6 | { 7 | public class StreamerEntityPolicy : DataItemPolicy 8 | { 9 | protected StreamerEntityPolicy(Expression> expression) : base(expression) 10 | { 11 | } 12 | 13 | public static StreamerEntityPolicy ByChannel(string channelName) 14 | { 15 | return new StreamerEntityPolicy(x => x.ChannelName == channelName); 16 | } 17 | } 18 | } 19 | -------------------------------------------------------------------------------- /src/DevChatter.Bot.Core/Data/Specifications/TimezonePolicy.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Linq.Expressions; 3 | using DevChatter.Bot.Core.Data.Model; 4 | using DevChatter.Bot.Core.Extensions; 5 | 6 | namespace DevChatter.Bot.Core.Data.Specifications 7 | { 8 | public class TimezonePolicy : DataItemPolicy 9 | { 10 | protected TimezonePolicy(Expression> expression) : base(expression) 11 | { 12 | } 13 | 14 | public static TimezonePolicy ByLookup(string lookup) 15 | { 16 | return new TimezonePolicy(x => x.LookupString.EqualsIns(lookup)); 17 | } 18 | } 19 | } -------------------------------------------------------------------------------- /src/DevChatter.Bot.Core/DevChatter.Bot.Core.csproj: -------------------------------------------------------------------------------- 1 |  2 | 3 | netstandard2.0 4 | latest 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | -------------------------------------------------------------------------------- /src/DevChatter.Bot.Core/Events/Args/CommandAliasModifiedEventArgs.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | 3 | namespace DevChatter.Bot.Core.Events.Args 4 | { 5 | public class CommandAliasModifiedEventArgs : EventArgs 6 | { 7 | public CommandAliasModifiedEventArgs(string fullTypeName) 8 | { 9 | FullTypeName = fullTypeName; 10 | } 11 | public string FullTypeName { get; set; } 12 | } 13 | } 14 | -------------------------------------------------------------------------------- /src/DevChatter.Bot.Core/Events/Args/CommandReceivedEventArgs.cs: -------------------------------------------------------------------------------- 1 | using System.Collections.Generic; 2 | using DevChatter.Bot.Core.Data.Model; 3 | 4 | namespace DevChatter.Bot.Core.Events.Args 5 | { 6 | public class CommandReceivedEventArgs 7 | { 8 | public string CommandWord { get; set; } 9 | public IList Arguments { get; set; } = new List(); 10 | public ChatUser ChatUser { get; set; } = new ChatUser(); 11 | public string RoomId { get; set; } 12 | } 13 | } 14 | -------------------------------------------------------------------------------- /src/DevChatter.Bot.Core/Events/Args/NewFollowersEventArgs.cs: -------------------------------------------------------------------------------- 1 | using System.Collections.Generic; 2 | using DevChatter.Bot.Core.Data.Model; 3 | 4 | namespace DevChatter.Bot.Core.Events.Args 5 | { 6 | public class NewFollowersEventArgs 7 | { 8 | public IList NewFollowers { get; } = new List(); 9 | } 10 | } 11 | -------------------------------------------------------------------------------- /src/DevChatter.Bot.Core/Events/Args/NewSubscriberEventArgs.cs: -------------------------------------------------------------------------------- 1 | namespace DevChatter.Bot.Core.Events.Args 2 | { 3 | public class NewSubscriberEventArgs 4 | { 5 | public string SubscriberName { get; set; } 6 | } 7 | } 8 | -------------------------------------------------------------------------------- /src/DevChatter.Bot.Core/Events/Args/UserNoticedEventArgs.cs: -------------------------------------------------------------------------------- 1 | using DevChatter.Bot.Core.Data.Model; 2 | 3 | namespace DevChatter.Bot.Core.Events.Args 4 | { 5 | public class UserStatusEventArgs 6 | { 7 | public string DisplayName { get; set; } 8 | public UserRole? Role { get; set; } 9 | 10 | public ChatUser ToChatUser() 11 | { 12 | return new ChatUser 13 | { 14 | DisplayName = DisplayName, 15 | Role = Role, 16 | }; 17 | } 18 | } 19 | } 20 | -------------------------------------------------------------------------------- /src/DevChatter.Bot.Core/Events/Args/WhisperReceivedEventArgs.cs: -------------------------------------------------------------------------------- 1 | namespace DevChatter.Bot.Core.Events.Args 2 | { 3 | public class WhisperReceivedEventArgs 4 | { 5 | public string FromDisplayName { get; set; } 6 | public string Message { get; set; } 7 | } 8 | } 9 | -------------------------------------------------------------------------------- /src/DevChatter.Bot.Core/Events/CommandHandlerSettings.cs: -------------------------------------------------------------------------------- 1 | namespace DevChatter.Bot.Core.Events 2 | { 3 | public class CommandHandlerSettings 4 | { 5 | /// 6 | /// Cooldown in seconds between commands 7 | /// 8 | public double GlobalCommandCooldown { get; set; } 9 | } 10 | } 11 | -------------------------------------------------------------------------------- /src/DevChatter.Bot.Core/Events/Cooldown.cs: -------------------------------------------------------------------------------- 1 | using DevChatter.Bot.Core.Commands; 2 | 3 | namespace DevChatter.Bot.Core.Events 4 | { 5 | public abstract class Cooldown 6 | { 7 | public string Message { get; set; } 8 | } 9 | 10 | public class NoCooldown : Cooldown 11 | { 12 | } 13 | 14 | /// 15 | /// This cooldown indicates that a user has too recently run any command. 16 | /// 17 | public class UserCooldown : Cooldown 18 | { 19 | } 20 | 21 | /// 22 | /// This cooldown indicates that a command has been run too recently by anyone. 23 | /// 24 | public class CommandCooldown : Cooldown 25 | { 26 | public IBotCommand Command { get; set; } 27 | } 28 | 29 | /// 30 | /// This cooldown indicates that this command has been run too recently by this user. 31 | /// 32 | public class UserCommandCooldown : Cooldown 33 | { 34 | public IBotCommand Command { get; set; } 35 | } 36 | } 37 | -------------------------------------------------------------------------------- /src/DevChatter.Bot.Core/Events/ICommandHandler.cs: -------------------------------------------------------------------------------- 1 | using DevChatter.Bot.Core.Events.Args; 2 | 3 | namespace DevChatter.Bot.Core.Events 4 | { 5 | public interface ICommandHandler 6 | { 7 | void CommandReceivedHandler(object sender, CommandReceivedEventArgs e); 8 | } 9 | } 10 | -------------------------------------------------------------------------------- /src/DevChatter.Bot.Core/Events/ICurrencyGenerator.cs: -------------------------------------------------------------------------------- 1 | using System.Collections.Generic; 2 | 3 | namespace DevChatter.Bot.Core.Events 4 | { 5 | public interface ICurrencyGenerator 6 | { 7 | void AddCurrencyTo(IEnumerable listOfNames, int tokensToAdd); 8 | void AddCurrencyTo(string displayName, int tokensToAdd); 9 | bool RemoveCurrencyFrom(string userName, int tokensToRemove); 10 | void UpdateCurrency(); 11 | } 12 | } 13 | -------------------------------------------------------------------------------- /src/DevChatter.Bot.Core/Events/ISubscriberHandler.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using DevChatter.Bot.Core.Events.Args; 3 | 4 | namespace DevChatter.Bot.Core.Events 5 | { 6 | public interface ISubscriberHandler 7 | { 8 | event EventHandler OnNewSubscriber; 9 | } 10 | } 11 | -------------------------------------------------------------------------------- /src/DevChatter.Bot.Core/Exceptions/RetryException.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | 3 | namespace DevChatter.Bot.Core.Exceptions 4 | { 5 | public class RetryException : Exception 6 | { 7 | public RetryException(Exception innerException) 8 | : base(innerException?.Message, innerException) 9 | { 10 | } 11 | } 12 | } 13 | -------------------------------------------------------------------------------- /src/DevChatter.Bot.Core/Extensions/ListOfStringExtensions.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using DevChatter.Bot.Core.Commands; 4 | using DevChatter.Bot.Core.Data.Model; 5 | 6 | namespace DevChatter.Bot.Core.Extensions 7 | { 8 | public static class ListOfStringExtensions 9 | { 10 | public static SimpleCommand ToSimpleCommand(this IList arguments) 11 | { 12 | if (arguments.Count >= 3 && Enum.TryParse(arguments[2], out UserRole role)) 13 | { 14 | var simpleCommand = new SimpleCommand(arguments[0], arguments[1], role); 15 | return simpleCommand; 16 | } 17 | 18 | return null; 19 | } 20 | } 21 | } 22 | -------------------------------------------------------------------------------- /src/DevChatter.Bot.Core/Extensions/TaskExtensions.cs: -------------------------------------------------------------------------------- 1 | using DevChatter.Bot.Core.Exceptions; 2 | using System; 3 | using System.Threading.Tasks; 4 | 5 | namespace DevChatter.Bot.Core.Extensions 6 | { 7 | public static class TaskExtensions 8 | { 9 | public static async Task TryGetResult(this Task task, int retryCount = 5, Exception exception = null) 10 | { 11 | try 12 | { 13 | if (retryCount <= 0) 14 | { 15 | throw new RetryException(exception); 16 | } 17 | 18 | return await task; 19 | } 20 | catch (Exception ex) when (!(ex is RetryException)) // allow RetryExceptions to go unhandled 21 | { 22 | await Task.Delay(500); 23 | return await TryGetResult(task, retryCount - 1, ex); 24 | } 25 | } 26 | } 27 | } 28 | -------------------------------------------------------------------------------- /src/DevChatter.Bot.Core/Extensions/TimeSpanExtensions.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | 3 | namespace DevChatter.Bot.Core.Extensions 4 | { 5 | public static class TimeSpanExtensions 6 | { 7 | /// 8 | /// Returns a formatted TimeSpan 9 | /// If there are more than 0 days it formats like: 1.00:00:00 10 | /// If there are more than 0 hours it formats like: 1:00:00 11 | /// Otherwise formatted like: 00:00 12 | /// 13 | /// 14 | public static string ToExpandingString(this TimeSpan timeSpan) 15 | { 16 | if (timeSpan.Days > 0) 17 | { 18 | return timeSpan.ToString("d\\.hh\\:mm\\:ss"); 19 | } 20 | else if (timeSpan.Hours > 0) 21 | { 22 | return timeSpan.ToString("hh\\:mm\\:ss"); 23 | } 24 | else 25 | { 26 | return timeSpan.ToString("mm\\:ss"); 27 | } 28 | } 29 | } 30 | } 31 | -------------------------------------------------------------------------------- /src/DevChatter.Bot.Core/Games/Hangman/HangmanGuess.cs: -------------------------------------------------------------------------------- 1 | using DevChatter.Bot.Core.Data.Model; 2 | 3 | namespace DevChatter.Bot.Core.Games.Hangman 4 | { 5 | public class HangmanGuess 6 | { 7 | public HangmanGuess(string letter, ChatUser guesser) 8 | { 9 | Letter = letter; 10 | Guesser = guesser; 11 | } 12 | 13 | public string Letter { get; } 14 | public ChatUser Guesser { get; } 15 | } 16 | } 17 | -------------------------------------------------------------------------------- /src/DevChatter.Bot.Core/Games/Hangman/HangmanSettings.cs: -------------------------------------------------------------------------------- 1 | using DevChatter.Bot.Core.Data.Model; 2 | 3 | namespace DevChatter.Bot.Core.Games.Hangman 4 | { 5 | public class HangmanSettings 6 | { 7 | public UserRole RoleRequiredToDeleteWord { get; set; } = UserRole.Mod; 8 | public UserRole RoleRequiredToStartGame { get; set; } = UserRole.Subscriber; 9 | public int TokensPerLetter { get; set; } = 2; 10 | public int TokensToWinner { get; set; } = 25; 11 | public string AllowedCharacters { get; set; } = "ABCDEFGHIJKLMNOPQRSTUVWXYZ"; 12 | } 13 | } 14 | -------------------------------------------------------------------------------- /src/DevChatter.Bot.Core/Games/Heist/HeistRoles.cs: -------------------------------------------------------------------------------- 1 | namespace DevChatter.Bot.Core.Games.Heist 2 | { 3 | public enum HeistRoles 4 | { 5 | Grifter, 6 | Hacker, 7 | Thug, 8 | Thief, 9 | Tech, 10 | Carrier, 11 | Driver 12 | } 13 | } 14 | -------------------------------------------------------------------------------- /src/DevChatter.Bot.Core/Games/IGame.cs: -------------------------------------------------------------------------------- 1 | namespace DevChatter.Bot.Core.Games 2 | { 3 | public interface IGame 4 | { 5 | bool IsRunning { get; } 6 | } 7 | } 8 | -------------------------------------------------------------------------------- /src/DevChatter.Bot.Core/Games/IGameCommand.cs: -------------------------------------------------------------------------------- 1 | using DevChatter.Bot.Core.Commands; 2 | 3 | namespace DevChatter.Bot.Core.Games 4 | { 5 | public interface IGameCommand : IBotCommand 6 | { 7 | IGame Game { get; } 8 | } 9 | } 10 | -------------------------------------------------------------------------------- /src/DevChatter.Bot.Core/Games/JoinGameResult.cs: -------------------------------------------------------------------------------- 1 | namespace DevChatter.Bot.Core.Games 2 | { 3 | public class JoinGameResult 4 | { 5 | protected bool Equals(JoinGameResult other) 6 | { 7 | return Success == other.Success && string.Equals(Message, other.Message); 8 | } 9 | 10 | public override bool Equals(object obj) 11 | { 12 | if (ReferenceEquals(null, obj)) return false; 13 | if (ReferenceEquals(this, obj)) return true; 14 | if (obj.GetType() != GetType()) return false; 15 | return Equals((JoinGameResult) obj); 16 | } 17 | 18 | public override int GetHashCode() 19 | { 20 | unchecked 21 | { 22 | return (Success.GetHashCode() * 397) ^ (Message != null ? Message.GetHashCode() : 0); 23 | } 24 | } 25 | 26 | public JoinGameResult(bool success, string message) 27 | { 28 | Success = success; 29 | Message = message; 30 | } 31 | 32 | public bool Success { get; set; } 33 | public string Message { get; set; } 34 | } 35 | } 36 | -------------------------------------------------------------------------------- /src/DevChatter.Bot.Core/Games/Quiz/GuessQuizOperation.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using DevChatter.Bot.Core.Commands.Operations; 3 | using DevChatter.Bot.Core.Events.Args; 4 | using System.Collections.Generic; 5 | using System.Linq; 6 | 7 | namespace DevChatter.Bot.Core.Games.Quiz 8 | { 9 | public class GuessQuizOperation : BaseCommandOperation 10 | { 11 | private readonly QuizGame _game; 12 | 13 | public GuessQuizOperation(QuizGame game) 14 | { 15 | _game = game ?? throw new ArgumentNullException(nameof(game)); 16 | } 17 | 18 | public override List OperandWords { get; } = new List { "a", "b", "c", "d" }; 19 | 20 | public override string HelpText => "Type \"!quiz a\" to guess choice \"a\" in the quiz. I think you can figure out the rest."; 21 | 22 | public override string TryToExecute(CommandReceivedEventArgs eventArgs) 23 | { 24 | return _game.UpdateGuess(eventArgs.ChatUser, eventArgs.Arguments.First()); 25 | } 26 | } 27 | } 28 | -------------------------------------------------------------------------------- /src/DevChatter.Bot.Core/Games/Quiz/JoinQuizOperation.cs: -------------------------------------------------------------------------------- 1 | using DevChatter.Bot.Core.Commands.Operations; 2 | using DevChatter.Bot.Core.Events.Args; 3 | using System; 4 | using System.Collections.Generic; 5 | 6 | namespace DevChatter.Bot.Core.Games.Quiz 7 | { 8 | internal class JoinQuizOperation : BaseCommandOperation 9 | { 10 | private readonly QuizGame _game; 11 | 12 | public JoinQuizOperation(QuizGame game) 13 | { 14 | _game = game ?? throw new ArgumentNullException(nameof(game)); 15 | } 16 | 17 | public override List OperandWords { get; } = new List {"join", "enter"}; 18 | 19 | public override string HelpText => "Type \"!quiz join\" to join the quiz game."; 20 | 21 | public override string TryToExecute(CommandReceivedEventArgs eventArgs) 22 | { 23 | JoinGameResult joinGameResult = _game.AttemptToJoin(eventArgs.ChatUser); 24 | return joinGameResult.Message; 25 | } 26 | } 27 | } 28 | -------------------------------------------------------------------------------- /src/DevChatter.Bot.Core/Games/Quiz/LeaveQuizOperation.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using DevChatter.Bot.Core.Commands.Operations; 4 | using DevChatter.Bot.Core.Events.Args; 5 | 6 | namespace DevChatter.Bot.Core.Games.Quiz 7 | { 8 | public class LeaveQuizOperation : BaseCommandOperation 9 | { 10 | private readonly QuizGame _game; 11 | 12 | public LeaveQuizOperation(QuizGame game) 13 | { 14 | _game = game ?? throw new ArgumentNullException(nameof(game)); 15 | } 16 | 17 | public override List OperandWords { get; } = new List {"leave", "forfeit", "exit", "forfiet"}; 18 | 19 | public override string HelpText => "Type \"!quiz leave\" to forfeit the quiz game."; 20 | 21 | public override string TryToExecute(CommandReceivedEventArgs eventArgs) 22 | { 23 | return _game.AttemptToLeave(eventArgs.ChatUser); 24 | } 25 | } 26 | } 27 | -------------------------------------------------------------------------------- /src/DevChatter.Bot.Core/Games/RockPaperScissors/RockPaperScissorsSettings.cs: -------------------------------------------------------------------------------- 1 | namespace DevChatter.Bot.Core.Games.RockPaperScissors 2 | { 3 | public class RockPaperScissorsSettings 4 | { 5 | public int SecondsToJoinGame { get; set; } = 120; 6 | public int TokensForWinning { get; set; } = 100; 7 | public int TokensRequiredToPlay { get; set; } = 30; 8 | } 9 | } 10 | -------------------------------------------------------------------------------- /src/DevChatter.Bot.Core/Games/Roulette/RouletteSettings.cs: -------------------------------------------------------------------------------- 1 | namespace DevChatter.Bot.Core.Games.Roulette 2 | { 3 | public class RouletteSettings 4 | { 5 | public int WinPercentageChance { get; set; } = 20; 6 | public int TimeoutDurationInSeconds { get; set; } = 10; 7 | public bool ProtectSubscribers { get; set; } = true; 8 | public int CoinsReward { get; set; } = 100; 9 | } 10 | } 11 | -------------------------------------------------------------------------------- /src/DevChatter.Bot.Core/GoogleApi/CachedTimezoneLookup.cs: -------------------------------------------------------------------------------- 1 | using DevChatter.Bot.Core.Caching; 2 | using System.Net.Http; 3 | using System.Threading.Tasks; 4 | 5 | namespace DevChatter.Bot.Core.GoogleApi 6 | { 7 | public class CachedTimezoneLookup : ITimezoneLookup 8 | { 9 | private readonly ITimezoneLookup _internalLookup; 10 | private readonly ICacheLayer _cacheLayer; 11 | 12 | public CachedTimezoneLookup(ITimezoneLookup internalLookup, ICacheLayer cacheLayer) 13 | { 14 | _internalLookup = internalLookup; 15 | _cacheLayer = cacheLayer; 16 | } 17 | 18 | public Task GetTimezoneInfoAsync( 19 | HttpClient client, string lookup) 20 | { 21 | return Task.FromResult(_cacheLayer.GetOrInsertTimezone(lookup, Fallback)); 22 | 23 | TimezoneLookupResult Fallback() 24 | { 25 | return _internalLookup.GetTimezoneInfoAsync(client, lookup).Result; 26 | } 27 | } 28 | } 29 | } 30 | -------------------------------------------------------------------------------- /src/DevChatter.Bot.Core/GoogleApi/ITimezoneLookup.cs: -------------------------------------------------------------------------------- 1 | using System.Net.Http; 2 | using System.Threading.Tasks; 3 | 4 | namespace DevChatter.Bot.Core.GoogleApi 5 | { 6 | public interface ITimezoneLookup 7 | { 8 | Task GetTimezoneInfoAsync(HttpClient client, string lookup); 9 | } 10 | } 11 | -------------------------------------------------------------------------------- /src/DevChatter.Bot.Core/GoogleApi/TimezoneLookupResult.cs: -------------------------------------------------------------------------------- 1 | namespace DevChatter.Bot.Core.GoogleApi 2 | { 3 | public class TimezoneLookupResult 4 | { 5 | public string Message { get; set; } 6 | public string TimezoneName { get; set; } 7 | public int Offset { get; set; } 8 | public bool Success { get; set; } 9 | } 10 | } 11 | -------------------------------------------------------------------------------- /src/DevChatter.Bot.Core/GoogleApi/TimezoneResponse.cs: -------------------------------------------------------------------------------- 1 | namespace DevChatter.Bot.Core.GoogleApi 2 | { 3 | 4 | public class TimezoneResponse 5 | { 6 | public int dstOffset { get; set; } 7 | public int rawOffset { get; set; } 8 | public string status { get; set; } 9 | public string timeZoneId { get; set; } 10 | public string timeZoneName { get; set; } 11 | } 12 | 13 | } 14 | -------------------------------------------------------------------------------- /src/DevChatter.Bot.Core/GoogleCloudSettings.cs: -------------------------------------------------------------------------------- 1 | namespace DevChatter.Bot.Core 2 | { 3 | public class GoogleCloudSettings 4 | { 5 | public string ApiKey { get; set; } 6 | } 7 | } 8 | -------------------------------------------------------------------------------- /src/DevChatter.Bot.Core/IChatUserCollection.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using DevChatter.Bot.Core.Data.Model; 4 | using DevChatter.Bot.Core.Data.Specifications; 5 | 6 | namespace DevChatter.Bot.Core 7 | { 8 | public interface IChatUserCollection 9 | { 10 | ChatUser GetOrCreateChatUser(string displayName, ChatUser chatUser = null); 11 | bool NeedToWatchUser(string displayName); 12 | void StopWatching(string displayName); 13 | bool TryGiveCoins(string coinGiver, string coinReceiver, int coinsToGive); 14 | void UpdateEachChatter(Action updateToApply); 15 | void UpdateSpecificChatters(Action updateToApply, ISpecification filter); 16 | bool UserHasAtLeast(string username, int tokensToRemove); 17 | void WatchUser(string displayName); 18 | bool ReduceCoins(string username, int coinsToTake); 19 | IReadOnlyCollection AllChatUsers { get; } 20 | } 21 | } 22 | -------------------------------------------------------------------------------- /src/DevChatter.Bot.Core/Settings/CurrencySettings.cs: -------------------------------------------------------------------------------- 1 | namespace DevChatter.Bot.Core.Settings 2 | { 3 | public class CurrencySettings 4 | { 5 | public int IntervalInMinutes { get; set; } = 1; 6 | public int CoinsPerInterval { get; set; } = 1; 7 | } 8 | } 9 | -------------------------------------------------------------------------------- /src/DevChatter.Bot.Core/Streaming/IAnimationDisplay.cs: -------------------------------------------------------------------------------- 1 | using System.Threading.Tasks; 2 | 3 | namespace DevChatter.Bot.Core.Streaming 4 | { 5 | public interface IAnimationDisplay 6 | { 7 | Task Blast(string imagePath); 8 | } 9 | } 10 | -------------------------------------------------------------------------------- /src/DevChatter.Bot.Core/Streaming/IHangmanDisplay.cs: -------------------------------------------------------------------------------- 1 | using System.Threading.Tasks; 2 | 3 | namespace DevChatter.Bot.Core.Streaming 4 | { 5 | public interface IHangmanDisplay 6 | { 7 | Task HangmanStart(string allLetters, int livesRemaining, string maskedWord); 8 | Task HangmanWin(); 9 | Task HangmanLose(); 10 | Task HangmanWrongAnswer(); 11 | Task HangmanShowGuessedLetters(string availableLetters, int livesRemaining, string maskedWord); 12 | } 13 | } 14 | -------------------------------------------------------------------------------- /src/DevChatter.Bot.Core/Streaming/IVotingDisplay.cs: -------------------------------------------------------------------------------- 1 | using System.Collections.Generic; 2 | using System.Threading.Tasks; 3 | using DevChatter.Bot.Core.BotModules.VotingModule; 4 | 5 | namespace DevChatter.Bot.Core.Streaming 6 | { 7 | public interface IVotingDisplay 8 | { 9 | Task VoteStart(IEnumerable choices); 10 | Task VoteEnd(); 11 | Task VoteReceived(VoteInfoDto voteInfo); 12 | } 13 | } 14 | -------------------------------------------------------------------------------- /src/DevChatter.Bot.Core/Systems/Chat/IChatClient.cs: -------------------------------------------------------------------------------- 1 | using DevChatter.Bot.Core.Data.Model; 2 | using DevChatter.Bot.Core.Events.Args; 3 | using System; 4 | using System.Collections.Generic; 5 | using System.Threading.Tasks; 6 | 7 | namespace DevChatter.Bot.Core.Systems.Chat 8 | { 9 | public interface IChatClient : IMessageSender 10 | { 11 | Task Connect(); 12 | 13 | Task Disconnect(); 14 | 15 | void Timeout(string username, TimeSpan duration, string reason); 16 | 17 | IList GetAllChatters(); 18 | 19 | event EventHandler OnCommandReceived; 20 | event EventHandler OnWhisperReceived; 21 | event EventHandler OnUserNoticed; 22 | event EventHandler OnUserLeft; 23 | } 24 | } 25 | -------------------------------------------------------------------------------- /src/DevChatter.Bot.Core/Systems/Chat/IMessageSender.cs: -------------------------------------------------------------------------------- 1 | namespace DevChatter.Bot.Core.Systems.Chat 2 | { 3 | public interface IMessageSender 4 | { 5 | void SendMessage(string message); 6 | void SendDirectMessage(string username, string message); 7 | } 8 | } 9 | -------------------------------------------------------------------------------- /src/DevChatter.Bot.Core/Systems/Streaming/IAnimationDisplayNotification.cs: -------------------------------------------------------------------------------- 1 | using System.Threading.Tasks; 2 | 3 | namespace DevChatter.Bot.Core.Systems.Streaming 4 | { 5 | public interface IAnimationDisplayNotification 6 | { 7 | Task Blast(string imagePath); 8 | } 9 | } 10 | -------------------------------------------------------------------------------- /src/DevChatter.Bot.Core/Systems/Streaming/IFollowableSystem.cs: -------------------------------------------------------------------------------- 1 | using System.Threading.Tasks; 2 | 3 | namespace DevChatter.Bot.Core.Systems.Streaming 4 | { 5 | public interface IFollowableSystem 6 | { 7 | Task Connect(); 8 | Task Disconnect(); 9 | } 10 | } 11 | -------------------------------------------------------------------------------- /src/DevChatter.Bot.Core/Systems/Streaming/IFollowerService.cs: -------------------------------------------------------------------------------- 1 | using DevChatter.Bot.Core.Events.Args; 2 | using System; 3 | using System.Collections.Generic; 4 | using System.Threading.Tasks; 5 | 6 | namespace DevChatter.Bot.Core.Systems.Streaming 7 | { 8 | public interface IFollowerService 9 | { 10 | event EventHandler OnNewFollower; 11 | Task> GetUsersWeFollow(); 12 | } 13 | } 14 | -------------------------------------------------------------------------------- /src/DevChatter.Bot.Core/Systems/Streaming/IHangmanDisplayNotification.cs: -------------------------------------------------------------------------------- 1 | using System.Threading.Tasks; 2 | 3 | namespace DevChatter.Bot.Core.Systems.Streaming 4 | { 5 | public interface IHangmanDisplayNotification 6 | { 7 | Task HangmanWin(); 8 | Task HangmanLose(); 9 | Task HangmanStart(string allLetters, int livesRemaining, string maskedWord); 10 | Task HangmanWrongAnswer(); 11 | Task HangmanShowGuessedLetters(string availableLetters, int livesRemaining, string maskedWord); 12 | } 13 | } 14 | -------------------------------------------------------------------------------- /src/DevChatter.Bot.Core/Systems/Streaming/IStreamingInfoService.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Threading.Tasks; 3 | 4 | namespace DevChatter.Bot.Core.Systems.Streaming 5 | { 6 | public interface IStreamingInfoService 7 | { 8 | Task GetUptimeAsync(); 9 | Task GetViewerCountAsync(); 10 | 11 | } 12 | } 13 | -------------------------------------------------------------------------------- /src/DevChatter.Bot.Core/Systems/Streaming/IStreamingPlatform.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Threading.Tasks; 3 | 4 | namespace DevChatter.Bot.Core.Systems.Streaming 5 | { 6 | public interface IStreamingPlatform : IFollowableSystem 7 | { 8 | Task GetUptimeAsync(); 9 | Task GetViewerCountAsync(); 10 | } 11 | } 12 | -------------------------------------------------------------------------------- /src/DevChatter.Bot.Core/Systems/Streaming/IVotingDisplayNotification.cs: -------------------------------------------------------------------------------- 1 | using System.Collections.Generic; 2 | using System.Threading.Tasks; 3 | using DevChatter.Bot.Core.Data.Model; 4 | 5 | namespace DevChatter.Bot.Core.Systems.Streaming 6 | { 7 | public interface IVotingDisplayNotification 8 | { 9 | Task VoteStart(IEnumerable choices); 10 | Task VoteEnd(); 11 | Task VoteReceived(ChatUser chatUser, string chosenName, int[] voteTotals); 12 | } 13 | } 14 | -------------------------------------------------------------------------------- /src/DevChatter.Bot.Core/Util/IClock.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | 3 | namespace DevChatter.Bot.Core.Util 4 | { 5 | public interface IClock 6 | { 7 | DateTime UtcNow { get; } 8 | DateTime Now { get; } 9 | } 10 | 11 | public class SystemClock : IClock 12 | { 13 | public DateTime UtcNow => DateTime.UtcNow; 14 | public DateTime Now => DateTime.Now; 15 | } 16 | } 17 | -------------------------------------------------------------------------------- /src/DevChatter.Bot.Core/Util/ILoggerAdapter.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | 3 | namespace DevChatter.Bot.Core.Util 4 | { 5 | public interface ILoggerAdapter 6 | { 7 | void LogInformation(string message); 8 | void LogError(Exception ex, string message, params object[] args); 9 | } 10 | } 11 | -------------------------------------------------------------------------------- /src/DevChatter.Bot.Core/Util/IWeightedItem.cs: -------------------------------------------------------------------------------- 1 | namespace DevChatter.Bot.Core.Util 2 | { 3 | public interface IWeightedItem 4 | { 5 | int Weight { get; } 6 | } 7 | } 8 | -------------------------------------------------------------------------------- /src/DevChatter.Bot.Core/Util/LoggerAdapter.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using Microsoft.Extensions.Logging; 3 | 4 | namespace DevChatter.Bot.Core.Util 5 | { 6 | public class LoggerAdapter : ILoggerAdapter 7 | { 8 | private readonly ILogger _logger; 9 | 10 | public LoggerAdapter(ILogger logger) 11 | { 12 | _logger = logger; 13 | } 14 | 15 | public void LogError(Exception ex, string message, params object[] args) 16 | { 17 | _logger.LogError(ex, message, args); 18 | } 19 | 20 | public void LogInformation(string message) 21 | { 22 | _logger.LogInformation(message); 23 | } 24 | } 25 | } 26 | -------------------------------------------------------------------------------- /src/DevChatter.Bot.Infra.Ef/DevChatter.Bot.Infra.Ef.csproj: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | netstandard2.0 5 | latest 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | -------------------------------------------------------------------------------- /src/DevChatter.Bot.Infra.Ef/Migrations/20180327190522_StreamerData.cs: -------------------------------------------------------------------------------- 1 | using Microsoft.EntityFrameworkCore.Metadata; 2 | using Microsoft.EntityFrameworkCore.Migrations; 3 | using System; 4 | using System.Collections.Generic; 5 | 6 | namespace DevChatter.Bot.Infra.Ef.Migrations 7 | { 8 | public partial class StreamerData : Migration 9 | { 10 | protected override void Up(MigrationBuilder migrationBuilder) 11 | { 12 | migrationBuilder.CreateTable( 13 | name: "Streamers", 14 | columns: table => new 15 | { 16 | Id = table.Column(nullable: false), 17 | ChannelName = table.Column(nullable: true), 18 | DateAdded = table.Column(nullable: false), 19 | TimesShoutedOut = table.Column(nullable: false) 20 | }, 21 | constraints: table => { table.PrimaryKey("PK_Streamers", x => x.Id); }); 22 | } 23 | 24 | protected override void Down(MigrationBuilder migrationBuilder) 25 | { 26 | migrationBuilder.DropTable( 27 | name: "Streamers"); 28 | } 29 | } 30 | } 31 | -------------------------------------------------------------------------------- /src/DevChatter.Bot.Infra.Ef/Migrations/20180403184339_AddingHelpText.cs: -------------------------------------------------------------------------------- 1 | using Microsoft.EntityFrameworkCore.Migrations; 2 | using System; 3 | using System.Collections.Generic; 4 | 5 | namespace DevChatter.Bot.Infra.Ef.Migrations 6 | { 7 | public partial class AddingHelpText : Migration 8 | { 9 | protected override void Up(MigrationBuilder migrationBuilder) 10 | { 11 | migrationBuilder.AddColumn( 12 | name: "HelpText", 13 | table: "SimpleCommands", 14 | nullable: true); 15 | } 16 | 17 | protected override void Down(MigrationBuilder migrationBuilder) 18 | { 19 | migrationBuilder.DropColumn( 20 | name: "HelpText", 21 | table: "SimpleCommands"); 22 | } 23 | } 24 | } 25 | -------------------------------------------------------------------------------- /src/DevChatter.Bot.Infra.Ef/Migrations/20180426202937_HangmanWords.cs: -------------------------------------------------------------------------------- 1 | using Microsoft.EntityFrameworkCore.Migrations; 2 | using System; 3 | using System.Collections.Generic; 4 | 5 | namespace DevChatter.Bot.Infra.Ef.Migrations 6 | { 7 | public partial class HangmanWords : Migration 8 | { 9 | protected override void Up(MigrationBuilder migrationBuilder) 10 | { 11 | migrationBuilder.CreateTable( 12 | name: "HangmanWords", 13 | columns: table => new 14 | { 15 | Id = table.Column(nullable: false), 16 | Word = table.Column(nullable: true) 17 | }, 18 | constraints: table => 19 | { 20 | table.PrimaryKey("PK_HangmanWords", x => x.Id); 21 | }); 22 | } 23 | 24 | protected override void Down(MigrationBuilder migrationBuilder) 25 | { 26 | migrationBuilder.DropTable( 27 | name: "HangmanWords"); 28 | } 29 | } 30 | } 31 | -------------------------------------------------------------------------------- /src/DevChatter.Bot.Infra.Ef/Migrations/20180503185218_CreateScheduleEntity.cs: -------------------------------------------------------------------------------- 1 | using Microsoft.EntityFrameworkCore.Migrations; 2 | using System; 3 | using System.Collections.Generic; 4 | 5 | namespace DevChatter.Bot.Infra.Ef.Migrations 6 | { 7 | public partial class CreateScheduleEntity : Migration 8 | { 9 | protected override void Up(MigrationBuilder migrationBuilder) 10 | { 11 | migrationBuilder.CreateTable( 12 | name: "ScheduleEntities", 13 | columns: table => new 14 | { 15 | Id = table.Column(nullable: false), 16 | ExampleDateTime = table.Column(nullable: false) 17 | }, 18 | constraints: table => 19 | { 20 | table.PrimaryKey("PK_ScheduleEntities", x => x.Id); 21 | }); 22 | } 23 | 24 | protected override void Down(MigrationBuilder migrationBuilder) 25 | { 26 | migrationBuilder.DropTable( 27 | name: "ScheduleEntities"); 28 | } 29 | } 30 | } 31 | -------------------------------------------------------------------------------- /src/DevChatter.Bot.Infra.Ef/Migrations/20180505181259_Add-UserIdColumn.cs: -------------------------------------------------------------------------------- 1 | using Microsoft.EntityFrameworkCore.Migrations; 2 | using System; 3 | using System.Collections.Generic; 4 | 5 | namespace DevChatter.Bot.Infra.Ef.Migrations 6 | { 7 | public partial class AddUserIdColumn : Migration 8 | { 9 | protected override void Up(MigrationBuilder migrationBuilder) 10 | { 11 | migrationBuilder.AddColumn( 12 | name: "UserId", 13 | table: "CommandUsages", 14 | nullable: true); 15 | 16 | migrationBuilder.AddColumn( 17 | name: "UserId", 18 | table: "ChatUsers", 19 | nullable: true); 20 | } 21 | 22 | protected override void Down(MigrationBuilder migrationBuilder) 23 | { 24 | migrationBuilder.DropColumn( 25 | name: "UserId", 26 | table: "CommandUsages"); 27 | 28 | migrationBuilder.DropColumn( 29 | name: "UserId", 30 | table: "ChatUsers"); 31 | } 32 | } 33 | } 34 | -------------------------------------------------------------------------------- /src/DevChatter.Bot.Infra.Ef/Migrations/20180505183605_Add-ChatClientUsedColumn.cs: -------------------------------------------------------------------------------- 1 | using Microsoft.EntityFrameworkCore.Migrations; 2 | using System; 3 | using System.Collections.Generic; 4 | 5 | namespace DevChatter.Bot.Infra.Ef.Migrations 6 | { 7 | public partial class AddChatClientUsedColumn : Migration 8 | { 9 | protected override void Up(MigrationBuilder migrationBuilder) 10 | { 11 | migrationBuilder.AddColumn( 12 | name: "ChatClientUsed", 13 | table: "CommandUsages", 14 | nullable: true); 15 | } 16 | 17 | protected override void Down(MigrationBuilder migrationBuilder) 18 | { 19 | migrationBuilder.DropColumn( 20 | name: "ChatClientUsed", 21 | table: "CommandUsages"); 22 | } 23 | } 24 | } 25 | -------------------------------------------------------------------------------- /src/DevChatter.Bot.Infra.Ef/Migrations/20180609054837_Add-CommandSettings.cs: -------------------------------------------------------------------------------- 1 | using Microsoft.EntityFrameworkCore.Migrations; 2 | using System; 3 | using System.Collections.Generic; 4 | 5 | namespace DevChatter.Bot.Infra.Ef.Migrations 6 | { 7 | public partial class AddCommandSettings : Migration 8 | { 9 | protected override void Up(MigrationBuilder migrationBuilder) 10 | { 11 | migrationBuilder.CreateTable( 12 | name: "CommandSettings", 13 | columns: table => new 14 | { 15 | Id = table.Column(nullable: false), 16 | CommandNameFull = table.Column(nullable: true), 17 | Key = table.Column(nullable: true), 18 | Value = table.Column(nullable: true) 19 | }, 20 | constraints: table => 21 | { 22 | table.PrimaryKey("PK_CommandSettings", x => x.Id); 23 | }); 24 | } 25 | 26 | protected override void Down(MigrationBuilder migrationBuilder) 27 | { 28 | migrationBuilder.DropTable( 29 | name: "CommandSettings"); 30 | } 31 | } 32 | } 33 | -------------------------------------------------------------------------------- /src/DevChatter.Bot.Infra.Ef/Migrations/20180609190031_RenameColumnToSettingsTypeName.cs: -------------------------------------------------------------------------------- 1 | using Microsoft.EntityFrameworkCore.Migrations; 2 | using System; 3 | using System.Collections.Generic; 4 | 5 | namespace DevChatter.Bot.Infra.Ef.Migrations 6 | { 7 | public partial class RenameColumnToSettingsTypeName : Migration 8 | { 9 | protected override void Up(MigrationBuilder migrationBuilder) 10 | { 11 | migrationBuilder.RenameColumn( 12 | name: "CommandNameFull", 13 | table: "CommandSettings", 14 | newName: "SettingsTypeName"); 15 | } 16 | 17 | protected override void Down(MigrationBuilder migrationBuilder) 18 | { 19 | migrationBuilder.RenameColumn( 20 | name: "SettingsTypeName", 21 | table: "CommandSettings", 22 | newName: "CommandNameFull"); 23 | } 24 | } 25 | } 26 | -------------------------------------------------------------------------------- /src/DevChatter.Bot.Infra.Ef/Migrations/20180816164558_AddLastSentColumn.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using Microsoft.EntityFrameworkCore.Migrations; 3 | 4 | namespace DevChatter.Bot.Infra.Ef.Migrations 5 | { 6 | public partial class AddLastSentColumn : Migration 7 | { 8 | protected override void Up(MigrationBuilder migrationBuilder) 9 | { 10 | migrationBuilder.AddColumn( 11 | name: "LastSent", 12 | table: "IntervalMessages", 13 | nullable: false, 14 | defaultValue: new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified)); 15 | } 16 | 17 | protected override void Down(MigrationBuilder migrationBuilder) 18 | { 19 | migrationBuilder.DropColumn( 20 | name: "LastSent", 21 | table: "IntervalMessages"); 22 | } 23 | } 24 | } 25 | -------------------------------------------------------------------------------- /src/DevChatter.Bot.Infra.Ef/Migrations/20180914171143_AddUniqueIndex-CommandWords.cs: -------------------------------------------------------------------------------- 1 | using Microsoft.EntityFrameworkCore.Migrations; 2 | 3 | namespace DevChatter.Bot.Infra.Ef.Migrations 4 | { 5 | public partial class AddUniqueIndexCommandWords : Migration 6 | { 7 | protected override void Up(MigrationBuilder migrationBuilder) 8 | { 9 | migrationBuilder.DropIndex( 10 | name: "IX_CommandWords_CommandWord", 11 | table: "CommandWords"); 12 | 13 | migrationBuilder.CreateIndex( 14 | name: "IX_CommandWords_CommandWord", 15 | table: "CommandWords", 16 | column: "CommandWord", 17 | unique: true, 18 | filter: "[CommandWord] IS NOT NULL"); 19 | } 20 | 21 | protected override void Down(MigrationBuilder migrationBuilder) 22 | { 23 | migrationBuilder.DropIndex( 24 | name: "IX_CommandWords_CommandWord", 25 | table: "CommandWords"); 26 | 27 | migrationBuilder.CreateIndex( 28 | name: "IX_CommandWords_CommandWord", 29 | table: "CommandWords", 30 | column: "CommandWord"); 31 | } 32 | } 33 | } 34 | -------------------------------------------------------------------------------- /src/DevChatter.Bot.Infra.Ef/Migrations/20180920190708_AddIsEnabledToCommandTable.cs: -------------------------------------------------------------------------------- 1 | using Microsoft.EntityFrameworkCore.Migrations; 2 | 3 | namespace DevChatter.Bot.Infra.Ef.Migrations 4 | { 5 | public partial class AddIsEnabledToCommandTable : Migration 6 | { 7 | protected override void Up(MigrationBuilder migrationBuilder) 8 | { 9 | migrationBuilder.RenameColumn( 10 | name: "IsPrimary", 11 | table: "CommandWords", 12 | newName: "IsEnabled"); 13 | } 14 | 15 | protected override void Down(MigrationBuilder migrationBuilder) 16 | { 17 | migrationBuilder.RenameColumn( 18 | name: "IsEnabled", 19 | table: "CommandWords", 20 | newName: "IsPrimary"); 21 | } 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /src/DevChatter.Bot.Infra.Ef/Migrations/20180920195333_AddRoleRequiredToCommandTable.cs: -------------------------------------------------------------------------------- 1 | using Microsoft.EntityFrameworkCore.Migrations; 2 | 3 | namespace DevChatter.Bot.Infra.Ef.Migrations 4 | { 5 | public partial class AddRoleRequiredToCommandTable : Migration 6 | { 7 | protected override void Up(MigrationBuilder migrationBuilder) 8 | { 9 | migrationBuilder.AddColumn( 10 | name: "RequiredRole", 11 | table: "CommandWords", 12 | nullable: false, 13 | defaultValue: 1); 14 | } 15 | 16 | protected override void Down(MigrationBuilder migrationBuilder) 17 | { 18 | migrationBuilder.DropColumn( 19 | name: "RequiredRole", 20 | table: "CommandWords"); 21 | } 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /src/DevChatter.Bot.Infra.Ef/Migrations/20180922185822_AddCooldownAndHelpTextColumns.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using Microsoft.EntityFrameworkCore.Migrations; 3 | 4 | namespace DevChatter.Bot.Infra.Ef.Migrations 5 | { 6 | public partial class AddCooldownAndHelpTextColumns : Migration 7 | { 8 | protected override void Up(MigrationBuilder migrationBuilder) 9 | { 10 | migrationBuilder.AddColumn( 11 | name: "Cooldown", 12 | table: "CommandWords", 13 | nullable: false, 14 | defaultValue: new TimeSpan(0, 0, 0, 0, 0)); 15 | 16 | migrationBuilder.AddColumn( 17 | name: "HelpText", 18 | table: "CommandWords", 19 | nullable: true); 20 | } 21 | 22 | protected override void Down(MigrationBuilder migrationBuilder) 23 | { 24 | migrationBuilder.DropColumn( 25 | name: "Cooldown", 26 | table: "CommandWords"); 27 | 28 | migrationBuilder.DropColumn( 29 | name: "HelpText", 30 | table: "CommandWords"); 31 | } 32 | } 33 | } 34 | -------------------------------------------------------------------------------- /src/DevChatter.Bot.Infra.Ef/Migrations/20181013180243_AddingWeightColumnToIntervalMessages.cs: -------------------------------------------------------------------------------- 1 | using Microsoft.EntityFrameworkCore.Migrations; 2 | 3 | namespace DevChatter.Bot.Infra.Ef.Migrations 4 | { 5 | public partial class AddingWeightColumnToIntervalMessages : Migration 6 | { 7 | protected override void Up(MigrationBuilder migrationBuilder) 8 | { 9 | migrationBuilder.AddColumn( 10 | name: "Weight", 11 | table: "IntervalMessages", 12 | nullable: false, 13 | defaultValue: 0); 14 | } 15 | 16 | protected override void Down(MigrationBuilder migrationBuilder) 17 | { 18 | migrationBuilder.DropColumn( 19 | name: "Weight", 20 | table: "IntervalMessages"); 21 | } 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /src/DevChatter.Bot.Infra.Ef/Migrations/20181013183736_RemoveDelayInMinutesFromIntervalMessages.cs: -------------------------------------------------------------------------------- 1 | using Microsoft.EntityFrameworkCore.Migrations; 2 | 3 | namespace DevChatter.Bot.Infra.Ef.Migrations 4 | { 5 | public partial class RemoveDelayInMinutesFromIntervalMessages : Migration 6 | { 7 | protected override void Up(MigrationBuilder migrationBuilder) 8 | { 9 | migrationBuilder.DropColumn( 10 | name: "DelayInMinutes", 11 | table: "IntervalMessages"); 12 | } 13 | 14 | protected override void Down(MigrationBuilder migrationBuilder) 15 | { 16 | migrationBuilder.AddColumn( 17 | name: "DelayInMinutes", 18 | table: "IntervalMessages", 19 | nullable: false, 20 | defaultValue: 0); 21 | } 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /src/DevChatter.Bot.Infra.GoogleApi/DevChatter.Bot.Infra.GoogleApi.csproj: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | netstandard2.0 5 | latest 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /src/DevChatter.Bot.Infra.Twitch/DevChatter.Bot.Infra.Twitch.csproj: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | netstandard2.0 5 | latest 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | -------------------------------------------------------------------------------- /src/DevChatter.Bot.Infra.Twitch/Events/TwitchSubscriberHandler.cs: -------------------------------------------------------------------------------- 1 | using DevChatter.Bot.Core.Events; 2 | using DevChatter.Bot.Core.Events.Args; 3 | using System; 4 | 5 | namespace DevChatter.Bot.Infra.Twitch.Events 6 | { 7 | public class TwitchSubscriberHandler : ISubscriberHandler 8 | { 9 | public TwitchSubscriberHandler(TwitchChatClient chatClient) 10 | { 11 | chatClient.OnNewSubscriber += ChatClientOnOnNewSubscriber; 12 | } 13 | 14 | private void ChatClientOnOnNewSubscriber(object sender, NewSubscriberEventArgs eventArgs) 15 | { 16 | OnNewSubscriber?.Invoke(sender, eventArgs); 17 | } 18 | 19 | public event EventHandler OnNewSubscriber; 20 | } 21 | } 22 | -------------------------------------------------------------------------------- /src/DevChatter.Bot.Infra.Twitch/TwitchClientSettings.cs: -------------------------------------------------------------------------------- 1 | namespace DevChatter.Bot.Infra.Twitch 2 | { 3 | public class TwitchClientSettings 4 | { 5 | public string TwitchUsername { get; set; } 6 | public string TwitchChannelId { get; set; } 7 | public string TwitchBotUserId { get; set; } 8 | public string TwitchBotOAuth { get; set; } 9 | public string TwitchChannelOAuth { get; set; } 10 | public string TwitchChannel { get; set; } 11 | public string TwitchClientId { get; set; } 12 | public string TwitchRoomId { get; set; } 13 | } 14 | } 15 | -------------------------------------------------------------------------------- /src/DevChatter.Bot.Infra.Web/AnimationDisplayNotification.cs: -------------------------------------------------------------------------------- 1 | using DevChatter.Bot.Core.Streaming; 2 | using DevChatter.Bot.Core.Systems.Streaming; 3 | using DevChatter.Bot.Infra.Web.Hubs; 4 | using Microsoft.AspNetCore.SignalR; 5 | using System.Threading.Tasks; 6 | 7 | namespace DevChatter.Bot.Infra.Web 8 | { 9 | public class AnimationDisplayNotification : IAnimationDisplayNotification 10 | { 11 | private readonly IHubContext _botHubContext; 12 | 13 | public AnimationDisplayNotification(IHubContext botHubContext) 14 | { 15 | _botHubContext = botHubContext; 16 | } 17 | 18 | public async Task Blast(string imagePath) 19 | { 20 | await _botHubContext.Clients.All.Blast(imagePath); 21 | } 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /src/DevChatter.Bot.Infra.Web/DevChatter.Bot.Infra.Web.csproj: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | netcoreapp2.1 5 | latest 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | -------------------------------------------------------------------------------- /src/DevChatter.Bot.Infra.Web/DevChatterBotBackgroundWorker.cs: -------------------------------------------------------------------------------- 1 | using System.Threading; 2 | using System.Threading.Tasks; 3 | using DevChatter.Bot.Core; 4 | using DevChatter.Bot.Core.Util; 5 | using Microsoft.Extensions.Hosting; 6 | 7 | namespace DevChatter.Bot.Infra.Web 8 | { 9 | public class DevChatterBotBackgroundWorker : IHostedService 10 | { 11 | private readonly ILoggerAdapter _logger; 12 | private readonly BotMain _botMain; 13 | 14 | public DevChatterBotBackgroundWorker(BotMain botMain, 15 | ILoggerAdapter logger) 16 | { 17 | _logger = logger; 18 | _botMain = botMain; 19 | } 20 | 21 | public Task StartAsync(CancellationToken cancellationToken) 22 | { 23 | _logger.LogInformation("DevChatterBotBackgroundWorker StartAsync"); 24 | return _botMain.Run(); 25 | } 26 | 27 | public Task StopAsync(CancellationToken stoppingToken) 28 | { 29 | _logger.LogInformation("DevChatterBotBackgroundWorker StopAsync"); 30 | return _botMain.Stop(); 31 | } 32 | } 33 | 34 | } 35 | -------------------------------------------------------------------------------- /src/DevChatter.Bot.Infra.Web/Hubs/BotHub.cs: -------------------------------------------------------------------------------- 1 | using DevChatter.Bot.Core.Streaming; 2 | using Microsoft.AspNetCore.SignalR; 3 | 4 | namespace DevChatter.Bot.Infra.Web.Hubs 5 | { 6 | public class BotHub : Hub 7 | { 8 | } 9 | } 10 | -------------------------------------------------------------------------------- /src/DevChatter.Bot.Infra.Web/Hubs/HangmanHub.cs: -------------------------------------------------------------------------------- 1 | using DevChatter.Bot.Core.Streaming; 2 | using Microsoft.AspNetCore.SignalR; 3 | 4 | namespace DevChatter.Bot.Infra.Web.Hubs 5 | { 6 | public class HangmanHub : Hub 7 | { 8 | } 9 | } 10 | -------------------------------------------------------------------------------- /src/DevChatter.Bot.Infra.Web/Hubs/VotingHub.cs: -------------------------------------------------------------------------------- 1 | using DevChatter.Bot.Core.Streaming; 2 | using Microsoft.AspNetCore.SignalR; 3 | 4 | namespace DevChatter.Bot.Infra.Web.Hubs 5 | { 6 | public class VotingHub : Hub 7 | { 8 | } 9 | } 10 | -------------------------------------------------------------------------------- /src/DevChatter.Bot.Modules.WastefulGame/Commands/Operations/BaseGameCommandOperation.cs: -------------------------------------------------------------------------------- 1 | using System.Collections.Generic; 2 | using System.Linq; 3 | using DevChatter.Bot.Core.Events.Args; 4 | using DevChatter.Bot.Core.Extensions; 5 | using DevChatter.Bot.Modules.WastefulGame.Model; 6 | 7 | namespace DevChatter.Bot.Modules.WastefulGame.Commands.Operations 8 | { 9 | public abstract class BaseGameCommandOperation : IGameCommandOperation 10 | { 11 | public abstract List OperandWords { get; } 12 | 13 | public virtual bool ShouldExecute(string operand) 14 | { 15 | return OperandWords.Any(w => w.EqualsIns(operand)); 16 | } 17 | 18 | public abstract string TryToExecute(CommandReceivedEventArgs eventArgs, Survivor survivor); 19 | } 20 | } 21 | -------------------------------------------------------------------------------- /src/DevChatter.Bot.Modules.WastefulGame/Commands/Operations/IGameCommandOperation.cs: -------------------------------------------------------------------------------- 1 | using DevChatter.Bot.Core.Events.Args; 2 | using DevChatter.Bot.Modules.WastefulGame.Model; 3 | 4 | namespace DevChatter.Bot.Modules.WastefulGame.Commands.Operations 5 | { 6 | public interface IGameCommandOperation 7 | { 8 | bool ShouldExecute(string operand); 9 | string TryToExecute(CommandReceivedEventArgs eventArgs, Survivor survivor); 10 | } 11 | } 12 | -------------------------------------------------------------------------------- /src/DevChatter.Bot.Modules.WastefulGame/Commands/Operations/ListTeamsOperation.cs: -------------------------------------------------------------------------------- 1 | using DevChatter.Bot.Core.Events.Args; 2 | using DevChatter.Bot.Modules.WastefulGame.Data; 3 | using DevChatter.Bot.Modules.WastefulGame.Model; 4 | using System.Collections.Generic; 5 | using System.Linq; 6 | 7 | namespace DevChatter.Bot.Modules.WastefulGame.Commands.Operations 8 | { 9 | public class ListTeamsOperation : BaseGameCommandOperation 10 | { 11 | private readonly IGameRepository _gameRepository; 12 | 13 | public ListTeamsOperation(IGameRepository gameRepository) 14 | { 15 | _gameRepository = gameRepository; 16 | } 17 | 18 | public override List OperandWords { get; } 19 | = new List { "list", "all", "show" }; 20 | public override string TryToExecute(CommandReceivedEventArgs eventArgs 21 | , Survivor survivor) 22 | { 23 | List teams = _gameRepository.List(); 24 | string teamNames = string.Join(", ", teams.Select(team => $"{team.Id}:{team.Name}")); 25 | return $"The teams are: {teamNames}."; 26 | } 27 | } 28 | } 29 | -------------------------------------------------------------------------------- /src/DevChatter.Bot.Modules.WastefulGame/Data/IGameRepository.cs: -------------------------------------------------------------------------------- 1 | using System.Collections.Generic; 2 | using DevChatter.Bot.Core.Data.Model; 3 | using DevChatter.Bot.Core.Data.Specifications; 4 | 5 | namespace DevChatter.Bot.Modules.WastefulGame.Data 6 | { 7 | public interface IGameRepository 8 | { 9 | T Single(ISpecification spec) where T : class; 10 | List List(ISpecification spec = null) where T : class; 11 | T Create(T dataItem) where T : class; 12 | T Update(T dataItem) where T : class; 13 | void Remove(T dataItem) where T : class; 14 | void Remove(List dataItems) where T : class; 15 | void Update(List dataItemList) where T : class; 16 | void Create(List dataItemList) where T : class; 17 | } 18 | } 19 | -------------------------------------------------------------------------------- /src/DevChatter.Bot.Modules.WastefulGame/DevChatter.Bot.Modules.WastefulGame.csproj: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | netcoreapp2.1 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | -------------------------------------------------------------------------------- /src/DevChatter.Bot.Modules.WastefulGame/GameScheduler.cs: -------------------------------------------------------------------------------- 1 | using DevChatter.Bot.Core.Automation; 2 | 3 | namespace DevChatter.Bot.Modules.WastefulGame 4 | { 5 | public class GameScheduler 6 | { 7 | protected readonly int _intervalInSeconds = 5; 8 | protected readonly RepeatingCallbackAction _action; 9 | public bool IsGameRunning { get; set; } 10 | public bool IsGameOpenForJoining { get; set; } 11 | 12 | public GameScheduler(IAutomatedActionSystem automatedActionSystem) 13 | { 14 | _action = new RepeatingCallbackAction(OpenGameIfNeeded, _intervalInSeconds); 15 | automatedActionSystem.AddAction(_action); 16 | } 17 | 18 | protected void OpenGameIfNeeded() 19 | { 20 | if (IsGameRunning) { return; } 21 | 22 | // Lock game-start 23 | 24 | // Announce game 25 | 26 | } 27 | } 28 | } 29 | -------------------------------------------------------------------------------- /src/DevChatter.Bot.Modules.WastefulGame/GameStates/BetweenGames.cs: -------------------------------------------------------------------------------- 1 | namespace DevChatter.Bot.Modules.WastefulGame.GameStates 2 | { 3 | // We're in limbo until the time of the next game. 4 | public class BetweenGames : IGameState 5 | { 6 | } 7 | } 8 | -------------------------------------------------------------------------------- /src/DevChatter.Bot.Modules.WastefulGame/GameStates/GameStateInfo.cs: -------------------------------------------------------------------------------- 1 | using DevChatter.Bot.Core.Data.Model; 2 | using DevChatter.Bot.Modules.WastefulGame.Model; 3 | using System; 4 | using System.Collections.Generic; 5 | 6 | namespace DevChatter.Bot.Modules.WastefulGame.GameStates 7 | { 8 | public class GameStateInfo 9 | { 10 | public Survivor Survivor { get; set; } 11 | public List Entrants { get; set; } 12 | public DateTime NextStartTime { get; set; } 13 | public string GameType { get; set; } 14 | } 15 | } 16 | -------------------------------------------------------------------------------- /src/DevChatter.Bot.Modules.WastefulGame/GameStates/IGameState.cs: -------------------------------------------------------------------------------- 1 | namespace DevChatter.Bot.Modules.WastefulGame.GameStates 2 | { 3 | public interface IGameState 4 | { 5 | } 6 | } 7 | -------------------------------------------------------------------------------- /src/DevChatter.Bot.Modules.WastefulGame/GameStates/OpenGame.cs: -------------------------------------------------------------------------------- 1 | namespace DevChatter.Bot.Modules.WastefulGame.GameStates 2 | { 3 | // This is when the join command should allow users to 4 | // join the game as "entrants" 5 | public class OpenGame : IGameState 6 | { 7 | } 8 | } 9 | -------------------------------------------------------------------------------- /src/DevChatter.Bot.Modules.WastefulGame/GameStates/RunningGame.cs: -------------------------------------------------------------------------------- 1 | namespace DevChatter.Bot.Modules.WastefulGame.GameStates 2 | { 3 | // This is when we should be listening for 4 | // commands given by the "survivor" user. 5 | public class RunningGame : IGameState 6 | { 7 | } 8 | } 9 | -------------------------------------------------------------------------------- /src/DevChatter.Bot.Modules.WastefulGame/Hubs/Dtos/HeldItemDto.cs: -------------------------------------------------------------------------------- 1 | using DevChatter.Bot.Modules.WastefulGame.Model; 2 | 3 | namespace DevChatter.Bot.Modules.WastefulGame.Hubs.Dtos 4 | { 5 | public class HeldItemDto 6 | { 7 | public string Name { get; set; } 8 | public int Uses { get; set; } 9 | 10 | public InventoryItem ToInventoryItem() 11 | { 12 | return new InventoryItem 13 | { 14 | Name = Name, 15 | Uses = Uses 16 | }; 17 | } 18 | 19 | public static HeldItemDto FromInventoryItem(InventoryItem inventoryItem) 20 | { 21 | return new HeldItemDto 22 | { 23 | Name = inventoryItem.Name, 24 | Uses = inventoryItem.Uses 25 | }; 26 | } 27 | } 28 | } 29 | -------------------------------------------------------------------------------- /src/DevChatter.Bot.Modules.WastefulGame/Hubs/Dtos/SurvivorRankingDataDto.cs: -------------------------------------------------------------------------------- 1 | using System.Collections.Generic; 2 | 3 | namespace DevChatter.Bot.Modules.WastefulGame.Hubs.Dtos 4 | { 5 | public class SurvivorRankingDataDto 6 | { 7 | public List Overall { get; set; } 8 | } 9 | } 10 | -------------------------------------------------------------------------------- /src/DevChatter.Bot.Modules.WastefulGame/Hubs/Dtos/SurvivorRecordDto.cs: -------------------------------------------------------------------------------- 1 | using DevChatter.Bot.Modules.WastefulGame.Model; 2 | 3 | namespace DevChatter.Bot.Modules.WastefulGame.Hubs.Dtos 4 | { 5 | public class SurvivorRecordDto 6 | { 7 | public SurvivorRecordDto() 8 | { 9 | } 10 | 11 | public SurvivorRecordDto(Survivor survivor) 12 | { 13 | Name = survivor.DisplayName; 14 | Money = survivor.Money; 15 | } 16 | 17 | public string Name { get; set; } 18 | public long Money { get; set; } 19 | } 20 | } 21 | -------------------------------------------------------------------------------- /src/DevChatter.Bot.Modules.WastefulGame/IWastefulDisplay.cs: -------------------------------------------------------------------------------- 1 | using System.Collections.Generic; 2 | using System.Threading.Tasks; 3 | using DevChatter.Bot.Modules.WastefulGame.Hubs.Dtos; 4 | 5 | namespace DevChatter.Bot.Modules.WastefulGame 6 | { 7 | public interface IWastefulDisplay 8 | { 9 | Task MovePlayer(string direction, int moveNumber); 10 | Task StartGame(string chatUserDisplayName, string chatUserUserId, IEnumerable inventoryItems); 11 | Task DisplaySurvivorRankings(SurvivorRankingDataDto survivorRankingData); 12 | } 13 | } 14 | -------------------------------------------------------------------------------- /src/DevChatter.Bot.Modules.WastefulGame/IWastefulDisplayNotification.cs: -------------------------------------------------------------------------------- 1 | using System.Collections.Generic; 2 | using System.Threading.Tasks; 3 | using DevChatter.Bot.Modules.WastefulGame.Hubs.Dtos; 4 | 5 | namespace DevChatter.Bot.Modules.WastefulGame 6 | { 7 | public interface IWastefulDisplayNotification 8 | { 9 | Task MovePlayer(string direction, int moveNumber); 10 | Task StartGame(string chatUserDisplayName, string chatUserUserId, IEnumerable inventoryItems); 11 | Task DisplaySurvivorRankings(SurvivorRankingDataDto survivorRankingData); 12 | } 13 | } 14 | -------------------------------------------------------------------------------- /src/DevChatter.Bot.Modules.WastefulGame/Migrations/20181106191126_InitialCreate.Designer.cs: -------------------------------------------------------------------------------- 1 | // 2 | using DevChatter.Bot.Modules.WastefulGame.Data; 3 | using Microsoft.EntityFrameworkCore; 4 | using Microsoft.EntityFrameworkCore.Infrastructure; 5 | using Microsoft.EntityFrameworkCore.Metadata; 6 | using Microsoft.EntityFrameworkCore.Migrations; 7 | using Microsoft.EntityFrameworkCore.Storage.ValueConversion; 8 | 9 | namespace DevChatter.Bot.Modules.WastefulGame.Migrations 10 | { 11 | [DbContext(typeof(GameDataContext))] 12 | [Migration("20181106191126_InitialCreate")] 13 | partial class InitialCreate 14 | { 15 | protected override void BuildTargetModel(ModelBuilder modelBuilder) 16 | { 17 | #pragma warning disable 612, 618 18 | modelBuilder 19 | .HasAnnotation("ChangeDetector.SkipDetectChanges", "true") 20 | .HasAnnotation("ProductVersion", "2.1.4-rtm-31024") 21 | .HasAnnotation("Relational:MaxIdentifierLength", 128) 22 | .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); 23 | #pragma warning restore 612, 618 24 | } 25 | } 26 | } 27 | -------------------------------------------------------------------------------- /src/DevChatter.Bot.Modules.WastefulGame/Migrations/20181106191126_InitialCreate.cs: -------------------------------------------------------------------------------- 1 | using Microsoft.EntityFrameworkCore.Migrations; 2 | 3 | namespace DevChatter.Bot.Modules.WastefulGame.Migrations 4 | { 5 | public partial class InitialCreate : Migration 6 | { 7 | protected override void Up(MigrationBuilder migrationBuilder) 8 | { 9 | 10 | } 11 | 12 | protected override void Down(MigrationBuilder migrationBuilder) 13 | { 14 | 15 | } 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /src/DevChatter.Bot.Modules.WastefulGame/Migrations/20181106213627_AddMoneyColumnToSurvivor.cs: -------------------------------------------------------------------------------- 1 | using Microsoft.EntityFrameworkCore.Migrations; 2 | 3 | namespace DevChatter.Bot.Modules.WastefulGame.Migrations 4 | { 5 | public partial class AddMoneyColumnToSurvivor : Migration 6 | { 7 | protected override void Up(MigrationBuilder migrationBuilder) 8 | { 9 | migrationBuilder.AddColumn( 10 | name: "Money", 11 | table: "Survivors", 12 | nullable: false, 13 | defaultValue: 0L); 14 | } 15 | 16 | protected override void Down(MigrationBuilder migrationBuilder) 17 | { 18 | migrationBuilder.DropColumn( 19 | name: "Money", 20 | table: "Survivors"); 21 | } 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /src/DevChatter.Bot.Modules.WastefulGame/Migrations/20181112193900_MakeGameEndTypeNonNullable.cs: -------------------------------------------------------------------------------- 1 | using Microsoft.EntityFrameworkCore.Migrations; 2 | 3 | namespace DevChatter.Bot.Modules.WastefulGame.Migrations 4 | { 5 | public partial class MakeGameEndTypeNonNullable : Migration 6 | { 7 | protected override void Up(MigrationBuilder migrationBuilder) 8 | { 9 | migrationBuilder.AlterColumn( 10 | name: "EndType", 11 | table: "GameEndRecords", 12 | nullable: false, 13 | oldClrType: typeof(string), 14 | oldNullable: true); 15 | } 16 | 17 | protected override void Down(MigrationBuilder migrationBuilder) 18 | { 19 | migrationBuilder.AlterColumn( 20 | name: "EndType", 21 | table: "GameEndRecords", 22 | nullable: true, 23 | oldClrType: typeof(string)); 24 | } 25 | } 26 | } 27 | -------------------------------------------------------------------------------- /src/DevChatter.Bot.Modules.WastefulGame/Migrations/20181115195731_AddUsesColumnToShopItem.cs: -------------------------------------------------------------------------------- 1 | using Microsoft.EntityFrameworkCore.Migrations; 2 | 3 | namespace DevChatter.Bot.Modules.WastefulGame.Migrations 4 | { 5 | public partial class AddUsesColumnToShopItem : Migration 6 | { 7 | protected override void Up(MigrationBuilder migrationBuilder) 8 | { 9 | migrationBuilder.AddColumn( 10 | name: "Uses", 11 | table: "ShopItems", 12 | nullable: false, 13 | defaultValue: 0); 14 | } 15 | 16 | protected override void Down(MigrationBuilder migrationBuilder) 17 | { 18 | migrationBuilder.DropColumn( 19 | name: "Uses", 20 | table: "ShopItems"); 21 | } 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /src/DevChatter.Bot.Modules.WastefulGame/Migrations/20181127193116_AddLocationsTable.cs: -------------------------------------------------------------------------------- 1 | using Microsoft.EntityFrameworkCore.Metadata; 2 | using Microsoft.EntityFrameworkCore.Migrations; 3 | 4 | namespace DevChatter.Bot.Modules.WastefulGame.Migrations 5 | { 6 | public partial class AddLocationsTable : Migration 7 | { 8 | protected override void Up(MigrationBuilder migrationBuilder) 9 | { 10 | migrationBuilder.CreateTable( 11 | name: "Locations", 12 | columns: table => new 13 | { 14 | Id = table.Column(nullable: false) 15 | .Annotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn), 16 | Name = table.Column(nullable: false) 17 | }, 18 | constraints: table => 19 | { 20 | table.PrimaryKey("PK_Locations", x => x.Id); 21 | }); 22 | } 23 | 24 | protected override void Down(MigrationBuilder migrationBuilder) 25 | { 26 | migrationBuilder.DropTable( 27 | name: "Locations"); 28 | } 29 | } 30 | } 31 | -------------------------------------------------------------------------------- /src/DevChatter.Bot.Modules.WastefulGame/Migrations/20181127201348_AddEscapeTypeToLocation.cs: -------------------------------------------------------------------------------- 1 | using Microsoft.EntityFrameworkCore.Migrations; 2 | 3 | namespace DevChatter.Bot.Modules.WastefulGame.Migrations 4 | { 5 | public partial class AddEscapeTypeToLocation : Migration 6 | { 7 | protected override void Up(MigrationBuilder migrationBuilder) 8 | { 9 | migrationBuilder.AddColumn( 10 | name: "EscapeType", 11 | table: "Locations", 12 | nullable: false, 13 | defaultValue: ""); 14 | } 15 | 16 | protected override void Down(MigrationBuilder migrationBuilder) 17 | { 18 | migrationBuilder.DropColumn( 19 | name: "EscapeType", 20 | table: "Locations"); 21 | } 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /src/DevChatter.Bot.Modules.WastefulGame/Model/Enums/EndTypes.cs: -------------------------------------------------------------------------------- 1 | namespace DevChatter.Bot.Modules.WastefulGame.Model.Enums 2 | { 3 | public enum EndTypes 4 | { 5 | Died = 1, 6 | Escaped = 2, 7 | } 8 | } 9 | -------------------------------------------------------------------------------- /src/DevChatter.Bot.Modules.WastefulGame/Model/GameData.cs: -------------------------------------------------------------------------------- 1 | namespace DevChatter.Bot.Modules.WastefulGame.Model 2 | { 3 | public abstract class GameData 4 | { 5 | public int Id { get; set; } 6 | } 7 | } 8 | -------------------------------------------------------------------------------- /src/DevChatter.Bot.Modules.WastefulGame/Model/GameEndRecord.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using DevChatter.Bot.Modules.WastefulGame.Model.Enums; 3 | 4 | namespace DevChatter.Bot.Modules.WastefulGame.Model 5 | { 6 | public class GameEndRecord : GameData 7 | { 8 | public Survivor Survivor { get; set; } 9 | public DateTime DateTime { get; set; } = DateTime.UtcNow; 10 | public int LevelNumber { get; set; } 11 | public int Points { get; set; } 12 | public EndTypes EndType { get; set; } 13 | } 14 | } 15 | -------------------------------------------------------------------------------- /src/DevChatter.Bot.Modules.WastefulGame/Model/InventoryItem.cs: -------------------------------------------------------------------------------- 1 | namespace DevChatter.Bot.Modules.WastefulGame.Model 2 | { 3 | public class InventoryItem : GameData 4 | { 5 | public InventoryItem() 6 | { 7 | } 8 | 9 | public InventoryItem(ShopItem shopItem) 10 | { 11 | Name = shopItem.Name; 12 | Uses = shopItem.Uses; 13 | } 14 | 15 | public Survivor Survivor { get; set; } 16 | public string Name { get; set; } 17 | public int Uses { get; set; } 18 | } 19 | } 20 | -------------------------------------------------------------------------------- /src/DevChatter.Bot.Modules.WastefulGame/Model/Location.cs: -------------------------------------------------------------------------------- 1 | namespace DevChatter.Bot.Modules.WastefulGame.Model 2 | { 3 | public class Location : GameData 4 | { 5 | public string Name { get; set; } 6 | public string EscapeType { get; set; } 7 | } 8 | } 9 | -------------------------------------------------------------------------------- /src/DevChatter.Bot.Modules.WastefulGame/Model/ShopItem.cs: -------------------------------------------------------------------------------- 1 | namespace DevChatter.Bot.Modules.WastefulGame.Model 2 | { 3 | public class ShopItem : GameData 4 | { 5 | public string Name { get; set; } 6 | public int Price { get; set; } 7 | public int Uses { get; set; } 8 | } 9 | } 10 | -------------------------------------------------------------------------------- /src/DevChatter.Bot.Modules.WastefulGame/Model/Specifications/LocationSpecification.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Linq.Expressions; 3 | using DevChatter.Bot.Core.Extensions; 4 | 5 | namespace DevChatter.Bot.Modules.WastefulGame.Model.Specifications 6 | { 7 | public class LocationSpecification : GameDataPolicy 8 | { 9 | protected LocationSpecification(Expression> expression) 10 | : base(expression) 11 | { 12 | } 13 | 14 | public static LocationSpecification ByEscapeType(string escapeType) 15 | { 16 | return new LocationSpecification(x => x.EscapeType.EqualsIns(escapeType)); 17 | } 18 | } 19 | } 20 | -------------------------------------------------------------------------------- /src/DevChatter.Bot.Modules.WastefulGame/Model/Specifications/ShopItemPolicy.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Linq.Expressions; 3 | 4 | namespace DevChatter.Bot.Modules.WastefulGame.Model.Specifications 5 | { 6 | public class ShopItemPolicy : GameDataPolicy 7 | { 8 | protected ShopItemPolicy(Expression> expression) 9 | : base(expression) 10 | { 11 | } 12 | 13 | public static ShopItemPolicy All() 14 | { 15 | return new ShopItemPolicy(x => true); 16 | } 17 | public static ShopItemPolicy ById(int id) 18 | { 19 | return new ShopItemPolicy(x => x.Id == id); 20 | } 21 | } 22 | } 23 | -------------------------------------------------------------------------------- /src/DevChatter.Bot.Modules.WastefulGame/Model/Specifications/SurvivorPolicy.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Linq.Expressions; 3 | 4 | namespace DevChatter.Bot.Modules.WastefulGame.Model.Specifications 5 | { 6 | public class SurvivorPolicy : GameDataPolicy 7 | { 8 | protected SurvivorPolicy(Expression> expression) 9 | : base(expression) 10 | { 11 | AddInclude(x => x.Team); 12 | AddInclude(x => x.InventoryItems); 13 | } 14 | 15 | public static SurvivorPolicy ByName(string displayName) 16 | { 17 | return new SurvivorPolicy( 18 | survivor => survivor.DisplayName == displayName); 19 | } 20 | 21 | public static SurvivorPolicy ByUserId(string userId) 22 | { 23 | return new SurvivorPolicy(survivor => survivor.UserId == userId); 24 | } 25 | } 26 | } 27 | -------------------------------------------------------------------------------- /src/DevChatter.Bot.Modules.WastefulGame/Model/Specifications/TeamPolicy.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Linq.Expressions; 3 | 4 | namespace DevChatter.Bot.Modules.WastefulGame.Model.Specifications 5 | { 6 | public class TeamPolicy : GameDataPolicy 7 | { 8 | protected TeamPolicy(Expression> expression) 9 | : base(expression) 10 | { 11 | AddInclude(t => t.Members); 12 | } 13 | 14 | public static TeamPolicy All() 15 | { 16 | return new TeamPolicy(x => true); 17 | } 18 | public static TeamPolicy ById(int id) 19 | { 20 | return new TeamPolicy(x => x.Id == id); 21 | } 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /src/DevChatter.Bot.Modules.WastefulGame/Model/Team.cs: -------------------------------------------------------------------------------- 1 | using System.Collections.Generic; 2 | 3 | namespace DevChatter.Bot.Modules.WastefulGame.Model 4 | { 5 | public class Team : GameData 6 | { 7 | public const int JOIN_TEAM_COST = 50; 8 | public string Name { get; protected set; } 9 | public List Members { get; protected set; } = new List(); 10 | 11 | public bool Join(Survivor survivor) 12 | { 13 | if (survivor.Team == null && survivor.TryPay(JOIN_TEAM_COST)) 14 | { 15 | Members.Add(survivor); 16 | return true; 17 | } 18 | 19 | return false; 20 | } 21 | } 22 | } 23 | -------------------------------------------------------------------------------- /src/DevChatter.Bot.Modules.WastefulGame/Startup/SetUpGameDatabase.cs: -------------------------------------------------------------------------------- 1 | using DevChatter.Bot.Modules.WastefulGame.Data; 2 | using Microsoft.EntityFrameworkCore; 3 | 4 | namespace DevChatter.Bot.Modules.WastefulGame.Startup 5 | { 6 | public static class SetUpGameDatabase 7 | { 8 | public static IGameRepository SetUpRepository(string connectionString) 9 | { 10 | DbContextOptions options = new DbContextOptionsBuilder() 11 | .UseSqlServer(connectionString) 12 | .Options; 13 | 14 | var dataContext = new GameDataContext(options); 15 | 16 | EnsureDatabase(dataContext); 17 | IGameRepository repository = new EfGameRepository(dataContext); 18 | EnsureInitialData(repository); 19 | 20 | return repository; 21 | 22 | } 23 | 24 | private static void EnsureInitialData(IGameRepository repository) 25 | { 26 | } 27 | 28 | private static void EnsureDatabase(GameDataContext dataContext) 29 | { 30 | } 31 | } 32 | } 33 | -------------------------------------------------------------------------------- /src/DevChatter.Bot.Modules.WastefulGame/WastefulGame.cs: -------------------------------------------------------------------------------- 1 | namespace DevChatter.Bot.Modules.WastefulGame 2 | { 3 | public class WastefulGame 4 | { 5 | 6 | } 7 | } 8 | -------------------------------------------------------------------------------- /src/DevChatter.Bot.Modules.WastefulGame/WastefulMoveController.cs: -------------------------------------------------------------------------------- 1 | namespace DevChatter.Bot.Modules.WastefulGame 2 | { 3 | /// 4 | /// User Interaction for Movement Selection by Chat 5 | /// 6 | public class WastefulMoveController 7 | { 8 | 9 | } 10 | } 11 | -------------------------------------------------------------------------------- /src/DevChatter.Bot.Web/BotConfiguration.cs: -------------------------------------------------------------------------------- 1 | using DevChatter.Bot.Core; 2 | using DevChatter.Bot.Core.Events; 3 | using DevChatter.Bot.Infra.Twitch; 4 | 5 | namespace DevChatter.Bot.Web 6 | { 7 | public class BotConfiguration 8 | { 9 | public ConnectionStrings ConnectionStrings { get; set; } 10 | public GoogleCloudSettings GoogleCloudSettings { get; set; } 11 | public TwitchClientSettings TwitchClientSettings { get; set; } 12 | public CommandHandlerSettings CommandHandlerSettings { get; set; } 13 | } 14 | 15 | public class ConnectionStrings 16 | { 17 | public string DefaultDatabase { get; set; } 18 | public string WastefulGame { get; set; } 19 | } 20 | } 21 | -------------------------------------------------------------------------------- /src/DevChatter.Bot.Web/DefaultData/DefaultCommandData.cs: -------------------------------------------------------------------------------- 1 | using DevChatter.Bot.Core.Data.Model; 2 | 3 | namespace DevChatter.Bot.Web.DefaultData 4 | { 5 | public class DefaultCommandData 6 | { 7 | public CommandEntity[] Commands { get; set; } 8 | } 9 | } 10 | -------------------------------------------------------------------------------- /src/DevChatter.Bot.Web/Extensions/GameRegistrationExtensions.cs: -------------------------------------------------------------------------------- 1 | using Autofac; 2 | using DevChatter.Bot.Core.Games.Hangman; 3 | using DevChatter.Bot.Core.Games.Heist; 4 | using DevChatter.Bot.Core.Games.Quiz; 5 | using DevChatter.Bot.Core.Games.RockPaperScissors; 6 | 7 | namespace DevChatter.Bot.Web.Extensions 8 | { 9 | public static class GameRegistrationExtensions 10 | { 11 | public static ContainerBuilder AddAllGames(this ContainerBuilder builder) 12 | { 13 | builder.RegisterType().SingleInstance(); 14 | builder.RegisterType().SingleInstance(); 15 | builder.RegisterType().SingleInstance(); 16 | builder.RegisterType().SingleInstance(); 17 | 18 | return builder; 19 | } 20 | } 21 | } 22 | -------------------------------------------------------------------------------- /src/DevChatter.Bot.Web/Modules/CurrencyModule.cs: -------------------------------------------------------------------------------- 1 | using Autofac; 2 | using DevChatter.Bot.Core.Automation; 3 | using DevChatter.Bot.Core.Commands; 4 | using DevChatter.Bot.Core.Events; 5 | 6 | namespace DevChatter.Bot.Web.Modules 7 | { 8 | public class CurrencyModule : Module 9 | { 10 | protected override void Load(ContainerBuilder builder) 11 | { 12 | builder.RegisterType() 13 | .AsImplementedInterfaces().SingleInstance(); 14 | builder.RegisterType() 15 | .As() 16 | .SingleInstance(); 17 | } 18 | } 19 | } 20 | -------------------------------------------------------------------------------- /src/DevChatter.Bot.Web/Pages/Commands/Index.cshtml: -------------------------------------------------------------------------------- 1 | @page 2 | @model DevChatter.Bot.Web.Pages.Commands.IndexModel 3 | @{ 4 | ViewData["Title"] = "Manage Commands"; 5 | } 6 | 7 |
8 | 9 |
    10 |
  • Configure Commands Command
  • 11 |
  • Configure Quotes Command
  • 12 |
13 | 14 |
15 | 16 |
17 |
18 |
19 |

Configure Commands Command

20 |
21 |
22 | 23 |

Edit Cooldown

24 | 25 |

Manage Commands

26 | 27 |
28 |
29 |
30 |
31 |

Configure Quotes Command

32 |
33 |
34 | 35 |

Edit Cooldown

36 | 37 |

Edit Quotes

38 | 39 |
40 |
41 |
42 | 43 | 44 | -------------------------------------------------------------------------------- /src/DevChatter.Bot.Web/Pages/Commands/Index.cshtml.cs: -------------------------------------------------------------------------------- 1 | using Microsoft.AspNetCore.Mvc.RazorPages; 2 | 3 | namespace DevChatter.Bot.Web.Pages.Commands 4 | { 5 | public class IndexModel : PageModel 6 | { 7 | public void OnGet() 8 | { 9 | 10 | } 11 | } 12 | } 13 | -------------------------------------------------------------------------------- /src/DevChatter.Bot.Web/Pages/Commands/Manage/Details.cshtml.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Threading.Tasks; 5 | using Microsoft.AspNetCore.Mvc; 6 | using Microsoft.AspNetCore.Mvc.RazorPages; 7 | using Microsoft.EntityFrameworkCore; 8 | using DevChatter.Bot.Core.Data.Model; 9 | using DevChatter.Bot.Infra.Ef; 10 | 11 | namespace DevChatter.Bot.Web.Pages.Commands.Manage 12 | { 13 | public class DetailsModel : PageModel 14 | { 15 | private readonly DevChatter.Bot.Infra.Ef.AppDataContext _context; 16 | 17 | public DetailsModel(DevChatter.Bot.Infra.Ef.AppDataContext context) 18 | { 19 | _context = context; 20 | } 21 | 22 | public CommandEntity CommandEntity { get; set; } 23 | 24 | public async Task OnGetAsync(Guid? id) 25 | { 26 | if (id == null) 27 | { 28 | return NotFound(); 29 | } 30 | 31 | CommandEntity = await _context.CommandWords.FirstOrDefaultAsync(m => m.Id == id); 32 | 33 | if (CommandEntity == null) 34 | { 35 | return NotFound(); 36 | } 37 | return Page(); 38 | } 39 | } 40 | } 41 | -------------------------------------------------------------------------------- /src/DevChatter.Bot.Web/Pages/Commands/Manage/Index.cshtml.cs: -------------------------------------------------------------------------------- 1 | using DevChatter.Bot.Core.Data.Model; 2 | using DevChatter.Bot.Infra.Ef; 3 | using Microsoft.AspNetCore.Mvc.RazorPages; 4 | using Microsoft.EntityFrameworkCore; 5 | using System.Collections.Generic; 6 | using System.Threading.Tasks; 7 | 8 | namespace DevChatter.Bot.Web.Pages.Commands.Manage 9 | { 10 | public class IndexModel : PageModel 11 | { 12 | private readonly AppDataContext _context; 13 | 14 | public IndexModel(AppDataContext context) 15 | { 16 | _context = context; 17 | } 18 | 19 | public IList CommandEntity { get;set; } 20 | 21 | public async Task OnGetAsync() 22 | { 23 | CommandEntity = await _context.CommandWords.ToListAsync(); 24 | } 25 | } 26 | } 27 | -------------------------------------------------------------------------------- /src/DevChatter.Bot.Web/Pages/Commands/Quotes/Create.cshtml.cs: -------------------------------------------------------------------------------- 1 | using DevChatter.Bot.Core.Data.Model; 2 | using DevChatter.Bot.Infra.Ef; 3 | using Microsoft.AspNetCore.Mvc; 4 | using Microsoft.AspNetCore.Mvc.RazorPages; 5 | using System.Threading.Tasks; 6 | 7 | namespace DevChatter.Bot.Web.Pages.Commands.Quotes 8 | { 9 | public class CreateModel : PageModel 10 | { 11 | private readonly AppDataContext _context; 12 | 13 | public CreateModel(AppDataContext context) 14 | { 15 | _context = context; 16 | } 17 | 18 | public IActionResult OnGet() 19 | { 20 | return Page(); 21 | } 22 | 23 | [BindProperty] 24 | public QuoteEntity QuoteEntity { get; set; } 25 | 26 | public async Task OnPostAsync() 27 | { 28 | if (!ModelState.IsValid) 29 | { 30 | return Page(); 31 | } 32 | 33 | _context.QuoteEntities.Add(QuoteEntity); 34 | await _context.SaveChangesAsync(); 35 | 36 | return RedirectToPage("./Index"); 37 | } 38 | } 39 | } 40 | -------------------------------------------------------------------------------- /src/DevChatter.Bot.Web/Pages/Commands/Quotes/Details.cshtml.cs: -------------------------------------------------------------------------------- 1 | using DevChatter.Bot.Core.Data.Model; 2 | using DevChatter.Bot.Infra.Ef; 3 | using Microsoft.AspNetCore.Mvc; 4 | using Microsoft.AspNetCore.Mvc.RazorPages; 5 | using Microsoft.EntityFrameworkCore; 6 | using System; 7 | using System.Threading.Tasks; 8 | 9 | namespace DevChatter.Bot.Web.Pages.Commands.Quotes 10 | { 11 | public class DetailsModel : PageModel 12 | { 13 | private readonly AppDataContext _context; 14 | 15 | public DetailsModel(AppDataContext context) 16 | { 17 | _context = context; 18 | } 19 | 20 | public QuoteEntity QuoteEntity { get; set; } 21 | 22 | public async Task OnGetAsync(Guid? id) 23 | { 24 | if (id == null) 25 | { 26 | return NotFound(); 27 | } 28 | 29 | QuoteEntity = await _context.QuoteEntities.FirstOrDefaultAsync(m => m.Id == id); 30 | 31 | if (QuoteEntity == null) 32 | { 33 | return NotFound(); 34 | } 35 | return Page(); 36 | } 37 | } 38 | } 39 | -------------------------------------------------------------------------------- /src/DevChatter.Bot.Web/Pages/Commands/Quotes/Index.cshtml.cs: -------------------------------------------------------------------------------- 1 | using DevChatter.Bot.Core.Data.Model; 2 | using DevChatter.Bot.Infra.Ef; 3 | using Microsoft.AspNetCore.Mvc.RazorPages; 4 | using Microsoft.EntityFrameworkCore; 5 | using System.Collections.Generic; 6 | using System.Threading.Tasks; 7 | 8 | namespace DevChatter.Bot.Web.Pages.Commands.Quotes 9 | { 10 | public class IndexModel : PageModel 11 | { 12 | private readonly AppDataContext _context; 13 | 14 | public IndexModel(AppDataContext context) 15 | { 16 | _context = context; 17 | } 18 | 19 | public IList QuoteEntity { get;set; } 20 | 21 | public async Task OnGetAsync() 22 | { 23 | QuoteEntity = await _context.QuoteEntities.ToListAsync(); 24 | } 25 | } 26 | } 27 | -------------------------------------------------------------------------------- /src/DevChatter.Bot.Web/Pages/Error.cshtml: -------------------------------------------------------------------------------- 1 | @page 2 | @model ErrorModel 3 | @{ 4 | ViewData["Title"] = "Error"; 5 | } 6 | 7 |

Error.

8 |

An error occurred while processing your request.

9 | 10 | @if (Model.ShowRequestId) 11 | { 12 |

13 | Request ID: @Model.RequestId 14 |

15 | } 16 | 17 |

Development Mode

18 |

19 | Swapping to Development environment will display more detailed information about the error that occurred. 20 |

21 |

22 | Development environment should not be enabled in deployed applications, as it can result in sensitive information from exceptions being displayed to end users. For local debugging, development environment can be enabled by setting the ASPNETCORE_ENVIRONMENT environment variable to Development, and restarting the application. 23 |

24 | -------------------------------------------------------------------------------- /src/DevChatter.Bot.Web/Pages/Error.cshtml.cs: -------------------------------------------------------------------------------- 1 | using Microsoft.AspNetCore.Mvc; 2 | using Microsoft.AspNetCore.Mvc.RazorPages; 3 | using System.Diagnostics; 4 | 5 | namespace DevChatter.Bot.Web.Pages 6 | { 7 | public class ErrorModel : PageModel 8 | { 9 | public string RequestId { get; set; } 10 | 11 | public bool ShowRequestId => !string.IsNullOrEmpty(RequestId); 12 | 13 | [ResponseCache(Duration = 0, Location = ResponseCacheLocation.None, NoStore = true)] 14 | public void OnGet() 15 | { 16 | RequestId = Activity.Current?.Id ?? HttpContext.TraceIdentifier; 17 | } 18 | } 19 | } 20 | -------------------------------------------------------------------------------- /src/DevChatter.Bot.Web/Pages/Games/Hangman/Create.cshtml: -------------------------------------------------------------------------------- 1 | @page 2 | @model DevChatter.Bot.Web.Pages.Games.Hangman.CreateModel 3 | 4 | @{ 5 | ViewData["Title"] = "Create"; 6 | } 7 | 8 |

Create

9 | 10 |

HangmanWord

11 |
12 |
13 |
14 |
15 |
16 |
17 | 18 | 19 | 20 |
21 |
22 | 23 |
24 |
25 |
26 |
27 | 28 |
29 | Back to List 30 |
31 | 32 | @section Scripts { 33 | @{await Html.RenderPartialAsync("_ValidationScriptsPartial");} 34 | } 35 | -------------------------------------------------------------------------------- /src/DevChatter.Bot.Web/Pages/Games/Hangman/Create.cshtml.cs: -------------------------------------------------------------------------------- 1 | using DevChatter.Bot.Core.Data.Model; 2 | using Microsoft.AspNetCore.Mvc; 3 | using Microsoft.AspNetCore.Mvc.RazorPages; 4 | using System.Threading.Tasks; 5 | 6 | namespace DevChatter.Bot.Web.Pages.Games.Hangman 7 | { 8 | public class CreateModel : PageModel 9 | { 10 | private readonly DevChatter.Bot.Infra.Ef.AppDataContext _context; 11 | 12 | public CreateModel(DevChatter.Bot.Infra.Ef.AppDataContext context) 13 | { 14 | _context = context; 15 | } 16 | 17 | public IActionResult OnGet() 18 | { 19 | return Page(); 20 | } 21 | 22 | [BindProperty] 23 | public HangmanWord HangmanWord { get; set; } 24 | 25 | public async Task OnPostAsync() 26 | { 27 | if (!ModelState.IsValid) 28 | { 29 | return Page(); 30 | } 31 | 32 | _context.HangmanWords.Add(HangmanWord); 33 | await _context.SaveChangesAsync(); 34 | 35 | return RedirectToPage("./Index"); 36 | } 37 | } 38 | } 39 | -------------------------------------------------------------------------------- /src/DevChatter.Bot.Web/Pages/Games/Hangman/Delete.cshtml: -------------------------------------------------------------------------------- 1 | @page 2 | @model DevChatter.Bot.Web.Pages.Games.Hangman.DeleteModel 3 | 4 | @{ 5 | ViewData["Title"] = "Delete"; 6 | } 7 | 8 |

Delete

9 | 10 |

Are you sure you want to delete this?

11 |
12 |

HangmanWord

13 |
14 |
15 |
16 | @Html.DisplayNameFor(model => model.HangmanWord.Word) 17 |
18 |
19 | @Html.DisplayFor(model => model.HangmanWord.Word) 20 |
21 |
22 | 23 |
24 | 25 | | 26 | Back to List 27 |
28 |
29 | -------------------------------------------------------------------------------- /src/DevChatter.Bot.Web/Pages/Games/Hangman/Details.cshtml: -------------------------------------------------------------------------------- 1 | @page 2 | @model DevChatter.Bot.Web.Pages.Games.Hangman.DetailsModel 3 | 4 | @{ 5 | ViewData["Title"] = "Details"; 6 | } 7 | 8 |

Details

9 | 10 |
11 |

HangmanWord

12 |
13 |
14 |
15 | @Html.DisplayNameFor(model => model.HangmanWord.Word) 16 |
17 |
18 | @Html.DisplayFor(model => model.HangmanWord.Word) 19 |
20 |
21 |
22 |
23 | Edit | 24 | Back to List 25 |
26 | -------------------------------------------------------------------------------- /src/DevChatter.Bot.Web/Pages/Games/Hangman/Details.cshtml.cs: -------------------------------------------------------------------------------- 1 | using DevChatter.Bot.Core.Data.Model; 2 | using Microsoft.AspNetCore.Mvc; 3 | using Microsoft.AspNetCore.Mvc.RazorPages; 4 | using Microsoft.EntityFrameworkCore; 5 | using System; 6 | using System.Threading.Tasks; 7 | 8 | namespace DevChatter.Bot.Web.Pages.Games.Hangman 9 | { 10 | public class DetailsModel : PageModel 11 | { 12 | private readonly DevChatter.Bot.Infra.Ef.AppDataContext _context; 13 | 14 | public DetailsModel(DevChatter.Bot.Infra.Ef.AppDataContext context) 15 | { 16 | _context = context; 17 | } 18 | 19 | public HangmanWord HangmanWord { get; set; } 20 | 21 | public async Task OnGetAsync(Guid? id) 22 | { 23 | if (id == null) 24 | { 25 | return NotFound(); 26 | } 27 | 28 | HangmanWord = await _context.HangmanWords.FirstOrDefaultAsync(m => m.Id == id); 29 | 30 | if (HangmanWord == null) 31 | { 32 | return NotFound(); 33 | } 34 | return Page(); 35 | } 36 | } 37 | } 38 | -------------------------------------------------------------------------------- /src/DevChatter.Bot.Web/Pages/Games/Hangman/Edit.cshtml: -------------------------------------------------------------------------------- 1 | @page 2 | @model DevChatter.Bot.Web.Pages.Games.Hangman.EditModel 3 | 4 | @{ 5 | ViewData["Title"] = "Edit"; 6 | } 7 | 8 |

Edit

9 | 10 |

HangmanWord

11 |
12 |
13 |
14 |
15 |
16 |
17 | 18 | 19 | 20 |
21 | 22 |
23 | 24 |
25 |
26 |
27 |
28 | 29 |
30 | Back to List 31 |
32 | 33 | @section Scripts { 34 | @{await Html.RenderPartialAsync("_ValidationScriptsPartial");} 35 | } 36 | -------------------------------------------------------------------------------- /src/DevChatter.Bot.Web/Pages/Games/Hangman/Index.cshtml: -------------------------------------------------------------------------------- 1 | @page 2 | @model DevChatter.Bot.Web.Pages.Games.Hangman.IndexModel 3 | 4 | @{ 5 | ViewData["Title"] = "Index"; 6 | } 7 | 8 |

Index

9 | 10 |

11 | Create New 12 |

13 | 14 | 15 | 16 | 19 | 20 | 21 | 22 | 23 | @foreach (var item in Model.HangmanWord) { 24 | 25 | 28 | 33 | 34 | } 35 | 36 |
17 | @Html.DisplayNameFor(model => model.HangmanWord[0].Word) 18 |
26 | @Html.DisplayFor(modelItem => item.Word) 27 | 29 | Edit | 30 | Details | 31 | Delete 32 |
37 | -------------------------------------------------------------------------------- /src/DevChatter.Bot.Web/Pages/Games/Hangman/Index.cshtml.cs: -------------------------------------------------------------------------------- 1 | using DevChatter.Bot.Core.Data.Model; 2 | using Microsoft.AspNetCore.Mvc.RazorPages; 3 | using Microsoft.EntityFrameworkCore; 4 | using System.Collections.Generic; 5 | using System.Threading.Tasks; 6 | 7 | namespace DevChatter.Bot.Web.Pages.Games.Hangman 8 | { 9 | public class IndexModel : PageModel 10 | { 11 | private readonly DevChatter.Bot.Infra.Ef.AppDataContext _context; 12 | 13 | public IndexModel(DevChatter.Bot.Infra.Ef.AppDataContext context) 14 | { 15 | _context = context; 16 | } 17 | 18 | public IList HangmanWord { get;set; } 19 | 20 | public async Task OnGetAsync() 21 | { 22 | HangmanWord = await _context.HangmanWords.ToListAsync(); 23 | } 24 | } 25 | } 26 | -------------------------------------------------------------------------------- /src/DevChatter.Bot.Web/Pages/Games/Index.cshtml.cs: -------------------------------------------------------------------------------- 1 | using Microsoft.AspNetCore.Mvc.RazorPages; 2 | 3 | namespace DevChatter.Bot.Web.Pages.Games 4 | { 5 | public class IndexModel : PageModel 6 | { 7 | public void OnGet() 8 | { 9 | 10 | } 11 | } 12 | } 13 | -------------------------------------------------------------------------------- /src/DevChatter.Bot.Web/Pages/Games/QuizQuestions/Create.cshtml.cs: -------------------------------------------------------------------------------- 1 | using System.Threading.Tasks; 2 | using DevChatter.Bot.Core.Data.Model; 3 | using Microsoft.AspNetCore.Mvc; 4 | using Microsoft.AspNetCore.Mvc.RazorPages; 5 | 6 | namespace DevChatter.Bot.Web.Pages.Games.QuizQuestions 7 | { 8 | public class CreateModel : PageModel 9 | { 10 | private readonly DevChatter.Bot.Infra.Ef.AppDataContext _context; 11 | 12 | public CreateModel(DevChatter.Bot.Infra.Ef.AppDataContext context) 13 | { 14 | _context = context; 15 | } 16 | 17 | public IActionResult OnGet() 18 | { 19 | return Page(); 20 | } 21 | 22 | [BindProperty] 23 | public QuizQuestion QuizQuestion { get; set; } 24 | 25 | public async Task OnPostAsync() 26 | { 27 | if (!ModelState.IsValid) 28 | { 29 | return Page(); 30 | } 31 | 32 | _context.QuizQuestions.Add(QuizQuestion); 33 | await _context.SaveChangesAsync(); 34 | 35 | return RedirectToPage("./Index"); 36 | } 37 | } 38 | } 39 | -------------------------------------------------------------------------------- /src/DevChatter.Bot.Web/Pages/Games/QuizQuestions/Details.cshtml.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Threading.Tasks; 5 | using Microsoft.AspNetCore.Mvc; 6 | using Microsoft.AspNetCore.Mvc.RazorPages; 7 | using Microsoft.EntityFrameworkCore; 8 | using DevChatter.Bot.Core.Data.Model; 9 | using DevChatter.Bot.Infra.Ef; 10 | 11 | namespace DevChatter.Bot.Web.Pages.Games.QuizQuestions 12 | { 13 | public class DetailsModel : PageModel 14 | { 15 | private readonly DevChatter.Bot.Infra.Ef.AppDataContext _context; 16 | 17 | public DetailsModel(DevChatter.Bot.Infra.Ef.AppDataContext context) 18 | { 19 | _context = context; 20 | } 21 | 22 | public QuizQuestion QuizQuestion { get; set; } 23 | 24 | public async Task OnGetAsync(Guid? id) 25 | { 26 | if (id == null) 27 | { 28 | return NotFound(); 29 | } 30 | 31 | QuizQuestion = await _context.QuizQuestions.FirstOrDefaultAsync(m => m.Id == id); 32 | 33 | if (QuizQuestion == null) 34 | { 35 | return NotFound(); 36 | } 37 | return Page(); 38 | } 39 | } 40 | } 41 | -------------------------------------------------------------------------------- /src/DevChatter.Bot.Web/Pages/Games/QuizQuestions/Index.cshtml.cs: -------------------------------------------------------------------------------- 1 | using DevChatter.Bot.Core.Data.Model; 2 | using DevChatter.Bot.Infra.Ef; 3 | using Microsoft.AspNetCore.Mvc.RazorPages; 4 | using Microsoft.EntityFrameworkCore; 5 | using System.Collections.Generic; 6 | using System.Threading.Tasks; 7 | 8 | namespace DevChatter.Bot.Web.Pages.Games.QuizQuestions 9 | { 10 | public class IndexModel : PageModel 11 | { 12 | private readonly AppDataContext _context; 13 | 14 | public IndexModel(AppDataContext context) 15 | { 16 | _context = context; 17 | } 18 | 19 | public IList QuizQuestion { get;set; } 20 | 21 | public async Task OnGetAsync() 22 | { 23 | QuizQuestion = await _context.QuizQuestions.ToListAsync(); 24 | } 25 | } 26 | } 27 | -------------------------------------------------------------------------------- /src/DevChatter.Bot.Web/Pages/Index.cshtml.cs: -------------------------------------------------------------------------------- 1 | using System.Collections.Generic; 2 | using System.Linq; 3 | using DevChatter.Bot.Core.Events; 4 | using DevChatter.Bot.Infra.Ef; 5 | using DevChatter.Bot.Web.ViewModels; 6 | using Microsoft.AspNetCore.Mvc.RazorPages; 7 | 8 | namespace DevChatter.Bot.Web.Pages 9 | { 10 | public class IndexModel : PageModel 11 | { 12 | private readonly AppDataContext _context; 13 | 14 | public IndexModel(AppDataContext context) 15 | { 16 | _context = context; 17 | } 18 | 19 | public CommandHandlerSettings CommandHandlerSettings { get; private set; } 20 | 21 | public IList ScheduleViewModels { get; set; } 22 | 23 | public void OnGet() 24 | { 25 | ScheduleViewModels = _context.ScheduleEntities.Select(ScheduleViewModel.FromScheduleEntity).ToList(); 26 | } 27 | } 28 | } 29 | -------------------------------------------------------------------------------- /src/DevChatter.Bot.Web/Pages/ManageOverlay/Details.cshtml.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Threading.Tasks; 5 | using Microsoft.AspNetCore.Mvc; 6 | using Microsoft.AspNetCore.Mvc.RazorPages; 7 | using Microsoft.EntityFrameworkCore; 8 | using DevChatter.Bot.Core.Data.Model; 9 | using DevChatter.Bot.Infra.Ef; 10 | 11 | namespace DevChatter.Bot.Web.Pages.ManageOverlay 12 | { 13 | public class DetailsModel : PageModel 14 | { 15 | private readonly DevChatter.Bot.Infra.Ef.AppDataContext _context; 16 | 17 | public DetailsModel(DevChatter.Bot.Infra.Ef.AppDataContext context) 18 | { 19 | _context = context; 20 | } 21 | 22 | public CanvasProperties CanvasProperties { get; set; } 23 | 24 | public async Task OnGetAsync(Guid? id) 25 | { 26 | if (id == null) 27 | { 28 | return NotFound(); 29 | } 30 | 31 | CanvasProperties = await _context.CanvasProperties.FirstOrDefaultAsync(m => m.Id == id); 32 | 33 | if (CanvasProperties == null) 34 | { 35 | return NotFound(); 36 | } 37 | return Page(); 38 | } 39 | } 40 | } 41 | -------------------------------------------------------------------------------- /src/DevChatter.Bot.Web/Pages/ManageOverlay/Index.cshtml.cs: -------------------------------------------------------------------------------- 1 | using DevChatter.Bot.Core.Data.Model; 2 | using Microsoft.AspNetCore.Mvc.RazorPages; 3 | using Microsoft.EntityFrameworkCore; 4 | using System.Collections.Generic; 5 | using System.Threading.Tasks; 6 | using DevChatter.Bot.Infra.Ef; 7 | 8 | namespace DevChatter.Bot.Web.Pages.ManageOverlay 9 | { 10 | public class IndexModel : PageModel 11 | { 12 | private readonly AppDataContext _context; 13 | 14 | public IndexModel(AppDataContext context) 15 | { 16 | _context = context; 17 | } 18 | 19 | public IList CanvasProperties { get;set; } 20 | 21 | public async Task OnGetAsync() 22 | { 23 | CanvasProperties = await _context.CanvasProperties.ToListAsync(); 24 | } 25 | } 26 | } 27 | -------------------------------------------------------------------------------- /src/DevChatter.Bot.Web/Pages/Overlay.cshtml.cs: -------------------------------------------------------------------------------- 1 | using System.Collections.Generic; 2 | using DevChatter.Bot.Core.Data; 3 | using DevChatter.Bot.Core.Data.Model; 4 | using Microsoft.AspNetCore.Mvc.RazorPages; 5 | 6 | namespace DevChatter.Bot.Web.Pages 7 | { 8 | public class OverlayModel : PageModel 9 | { 10 | private readonly IRepository _repository; 11 | 12 | public OverlayModel(IRepository repository) 13 | { 14 | _repository = repository; 15 | } 16 | 17 | public List Canvases { get; set; } 18 | 19 | public void OnGet() 20 | { 21 | Canvases = _repository.List(); 22 | } 23 | } 24 | } 25 | -------------------------------------------------------------------------------- /src/DevChatter.Bot.Web/Pages/Privacy.cshtml: -------------------------------------------------------------------------------- 1 | @page 2 | @model PrivacyModel 3 | @{ 4 | ViewData["Title"] = "Privacy Policy"; 5 | } 6 |

@ViewData["Title"]

7 | 8 |

Use this page to detail your site's privacy policy.

-------------------------------------------------------------------------------- /src/DevChatter.Bot.Web/Pages/Privacy.cshtml.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Threading.Tasks; 5 | using Microsoft.AspNetCore.Mvc; 6 | using Microsoft.AspNetCore.Mvc.RazorPages; 7 | 8 | namespace DevChatter.Bot.Web.Pages 9 | { 10 | public class PrivacyModel : PageModel 11 | { 12 | public void OnGet() 13 | { 14 | } 15 | } 16 | } -------------------------------------------------------------------------------- /src/DevChatter.Bot.Web/Pages/Schedule/Create.cshtml: -------------------------------------------------------------------------------- 1 | @page 2 | @model DevChatter.Bot.Web.Pages.Schedule.CreateModel 3 | 4 | @{ 5 | ViewData["Title"] = "Create"; 6 | } 7 | 8 |

Create

9 | 10 |

ScheduleEntity

11 |
12 |
13 |
14 |
15 |
16 |
17 | 18 | 19 | 20 |
21 |
22 | 23 |
24 |
25 |
26 |
27 | 28 |
29 | Back to List 30 |
31 | 32 | @section Scripts { 33 | @{await Html.RenderPartialAsync("_ValidationScriptsPartial");} 34 | } 35 | -------------------------------------------------------------------------------- /src/DevChatter.Bot.Web/Pages/Schedule/Create.cshtml.cs: -------------------------------------------------------------------------------- 1 | using DevChatter.Bot.Core.Data.Model; 2 | using Microsoft.AspNetCore.Mvc; 3 | using Microsoft.AspNetCore.Mvc.RazorPages; 4 | using System.Threading.Tasks; 5 | 6 | namespace DevChatter.Bot.Web.Pages.Schedule 7 | { 8 | public class CreateModel : PageModel 9 | { 10 | private readonly DevChatter.Bot.Infra.Ef.AppDataContext _context; 11 | 12 | public CreateModel(DevChatter.Bot.Infra.Ef.AppDataContext context) 13 | { 14 | _context = context; 15 | } 16 | 17 | public IActionResult OnGet() 18 | { 19 | return Page(); 20 | } 21 | 22 | [BindProperty] 23 | public ScheduleEntity ScheduleEntity { get; set; } 24 | 25 | public async Task OnPostAsync() 26 | { 27 | if (!ModelState.IsValid) 28 | { 29 | return Page(); 30 | } 31 | 32 | _context.ScheduleEntities.Add(ScheduleEntity); 33 | await _context.SaveChangesAsync(); 34 | 35 | return RedirectToPage("./Index"); 36 | } 37 | } 38 | } 39 | -------------------------------------------------------------------------------- /src/DevChatter.Bot.Web/Pages/Schedule/Delete.cshtml: -------------------------------------------------------------------------------- 1 | @page 2 | @model DevChatter.Bot.Web.Pages.Schedule.DeleteModel 3 | 4 | @{ 5 | ViewData["Title"] = "Delete"; 6 | } 7 | 8 |

Delete

9 | 10 |

Are you sure you want to delete this?

11 |
12 |

ScheduleEntity

13 |
14 |
15 |
16 | @Html.DisplayNameFor(model => model.ScheduleEntity.ExampleDateTime) 17 |
18 |
19 | @Html.DisplayFor(model => model.ScheduleEntity.ExampleDateTime) 20 |
21 |
22 | 23 |
24 | 25 | | 26 | Back to List 27 |
28 |
29 | -------------------------------------------------------------------------------- /src/DevChatter.Bot.Web/Pages/Schedule/Details.cshtml: -------------------------------------------------------------------------------- 1 | @page 2 | @model DevChatter.Bot.Web.Pages.Schedule.DetailsModel 3 | 4 | @{ 5 | ViewData["Title"] = "Details"; 6 | } 7 | 8 |

Details

9 | 10 |
11 |

ScheduleEntity

12 |
13 |
14 |
15 | @Html.DisplayNameFor(model => model.ScheduleEntity.ExampleDateTime) 16 |
17 |
18 | @Html.DisplayFor(model => model.ScheduleEntity.ExampleDateTime) 19 |
20 |
21 |
22 |
23 | Edit | 24 | Back to List 25 |
26 | -------------------------------------------------------------------------------- /src/DevChatter.Bot.Web/Pages/Schedule/Details.cshtml.cs: -------------------------------------------------------------------------------- 1 | using DevChatter.Bot.Core.Data.Model; 2 | using Microsoft.AspNetCore.Mvc; 3 | using Microsoft.AspNetCore.Mvc.RazorPages; 4 | using Microsoft.EntityFrameworkCore; 5 | using System; 6 | using System.Threading.Tasks; 7 | 8 | namespace DevChatter.Bot.Web.Pages.Schedule 9 | { 10 | public class DetailsModel : PageModel 11 | { 12 | private readonly DevChatter.Bot.Infra.Ef.AppDataContext _context; 13 | 14 | public DetailsModel(DevChatter.Bot.Infra.Ef.AppDataContext context) 15 | { 16 | _context = context; 17 | } 18 | 19 | public ScheduleEntity ScheduleEntity { get; set; } 20 | 21 | public async Task OnGetAsync(Guid? id) 22 | { 23 | if (id == null) 24 | { 25 | return NotFound(); 26 | } 27 | 28 | ScheduleEntity = await _context.ScheduleEntities.FirstOrDefaultAsync(m => m.Id == id); 29 | 30 | if (ScheduleEntity == null) 31 | { 32 | return NotFound(); 33 | } 34 | return Page(); 35 | } 36 | } 37 | } 38 | -------------------------------------------------------------------------------- /src/DevChatter.Bot.Web/Pages/Schedule/Edit.cshtml: -------------------------------------------------------------------------------- 1 | @page 2 | @model DevChatter.Bot.Web.Pages.Schedule.EditModel 3 | 4 | @{ 5 | ViewData["Title"] = "Edit"; 6 | } 7 | 8 |

Edit

9 | 10 |

ScheduleEntity

11 |
12 |
13 |
14 |
15 |
16 |
17 | 18 | 19 | 20 |
21 | 22 |
23 | 24 |
25 |
26 |
27 |
28 | 29 |
30 | Back to List 31 |
32 | 33 | @section Scripts { 34 | @{await Html.RenderPartialAsync("_ValidationScriptsPartial");} 35 | } 36 | -------------------------------------------------------------------------------- /src/DevChatter.Bot.Web/Pages/Schedule/Index.cshtml: -------------------------------------------------------------------------------- 1 | @page 2 | @model DevChatter.Bot.Web.Pages.Schedule.IndexModel 3 | 4 | @{ 5 | ViewData["Title"] = "Index"; 6 | } 7 | 8 |

Index

9 | 10 |

11 | Create New 12 |

13 | 14 | 15 | 16 | 19 | 20 | 21 | 22 | 23 | @foreach (var item in Model.ScheduleEntity) { 24 | 25 | 28 | 33 | 34 | } 35 | 36 |
17 | @Html.DisplayNameFor(model => model.ScheduleEntity[0].ExampleDateTime) 18 |
26 | @Html.DisplayFor(modelItem => item.ExampleDateTime) 27 | 29 | Edit | 30 | Details | 31 | Delete 32 |
37 | -------------------------------------------------------------------------------- /src/DevChatter.Bot.Web/Pages/Schedule/Index.cshtml.cs: -------------------------------------------------------------------------------- 1 | using DevChatter.Bot.Web.ViewModels; 2 | using Microsoft.AspNetCore.Mvc.RazorPages; 3 | using System.Collections.Generic; 4 | using System.Linq; 5 | 6 | namespace DevChatter.Bot.Web.Pages.Schedule 7 | { 8 | public class IndexModel : PageModel 9 | { 10 | private readonly DevChatter.Bot.Infra.Ef.AppDataContext _context; 11 | 12 | public IndexModel(DevChatter.Bot.Infra.Ef.AppDataContext context) 13 | { 14 | _context = context; 15 | } 16 | 17 | public IList ScheduleEntity { get;set; } 18 | 19 | public void OnGet() 20 | { 21 | ScheduleEntity = _context.ScheduleEntities.Select(ScheduleViewModel.FromScheduleEntity).ToList(); 22 | } 23 | } 24 | } 25 | -------------------------------------------------------------------------------- /src/DevChatter.Bot.Web/Pages/Shared/_ValidationScriptsPartial.cshtml: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | 6 | 12 | 18 | 19 | -------------------------------------------------------------------------------- /src/DevChatter.Bot.Web/Pages/_ViewImports.cshtml: -------------------------------------------------------------------------------- 1 | @using DevChatter.Bot.Web 2 | @namespace DevChatter.Bot.Web.Pages 3 | @addTagHelper *, Microsoft.AspNetCore.Mvc.TagHelpers 4 | -------------------------------------------------------------------------------- /src/DevChatter.Bot.Web/Pages/_ViewStart.cshtml: -------------------------------------------------------------------------------- 1 | @{ 2 | Layout = "_Layout"; 3 | } 4 | -------------------------------------------------------------------------------- /src/DevChatter.Bot.Web/Program.cs: -------------------------------------------------------------------------------- 1 | using Microsoft.AspNetCore; 2 | using Microsoft.AspNetCore.Hosting; 3 | 4 | namespace DevChatter.Bot.Web 5 | { 6 | public class Program 7 | { 8 | public static void Main(string[] args) 9 | { 10 | CreateWebHostBuilder(args).Build().Run(); 11 | } 12 | 13 | public static IWebHostBuilder CreateWebHostBuilder(string[] args) => 14 | WebHost.CreateDefaultBuilder(args) 15 | .UseStartup(); 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /src/DevChatter.Bot.Web/ViewModels/ScheduleViewModel.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.ComponentModel.DataAnnotations; 3 | using DevChatter.Bot.Core.Data.Model; 4 | 5 | namespace DevChatter.Bot.Web.ViewModels 6 | { 7 | public class ScheduleViewModel 8 | { 9 | public Guid Id { get; set; } 10 | [DisplayFormat(DataFormatString = "{0:dddd HH:mm tt}")] 11 | public DateTimeOffset ExampleDateTime { get; set; } 12 | 13 | public static ScheduleViewModel FromScheduleEntity(ScheduleEntity entity) 14 | { 15 | return new ScheduleViewModel 16 | { 17 | Id = entity.Id, 18 | ExampleDateTime = entity.ExampleDateTime, 19 | }; 20 | } 21 | 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /src/DevChatter.Bot.Web/appsettings.Development.json: -------------------------------------------------------------------------------- 1 | { 2 | "Logging": { 3 | "LogLevel": { 4 | "Default": "Debug", 5 | "System": "Information", 6 | "Microsoft": "Information" 7 | } 8 | } 9 | } 10 | -------------------------------------------------------------------------------- /src/DevChatter.Bot.Web/appsettings.json: -------------------------------------------------------------------------------- 1 | { 2 | "ConnectionStrings": { 3 | "DefaultDatabase": "Server=(localdb)\\mssqllocaldb;Database=DevChatterBot;Trusted_Connection=True;MultipleActiveResultSets=true", 4 | "WastefulGame": "Server=(localdb)\\mssqllocaldb;Database=WastefulGame;Trusted_Connection=True;MultipleActiveResultSets=true" 5 | }, 6 | 7 | "TwitchClientSettings": { 8 | "TwitchUsername": "secret", 9 | "TwitchChannelID": "secret", 10 | "TwitchBotUserID": "secret", 11 | "TwitchBotOAuth": "secret", 12 | "TwitchChannelOAuth": "secret", 13 | "TwitchChannel": "secret", 14 | "TwitchClientId": "secret", 15 | "TwitchRoomId": "secret" 16 | }, 17 | 18 | "GoogleCloudSettings": { 19 | "ApiKey": "secret" 20 | }, 21 | 22 | "CommandHandlerSettings": { 23 | "GlobalCommandCooldown": "0.5" 24 | }, 25 | 26 | "Logging": { 27 | "LogLevel": { 28 | "Default": "Warning" 29 | } 30 | }, 31 | "AllowedHosts": "*" 32 | } 33 | -------------------------------------------------------------------------------- /src/DevChatter.Bot.Web/wwwroot/css/site.css: -------------------------------------------------------------------------------- 1 | /* Please see documentation at https://docs.microsoft.com/aspnet/core/client-side/bundling-and-minification 2 | for details on configuring this project to bundle and minify static web assets. */ 3 | body { 4 | padding-top: 75px; 5 | padding-bottom: 20px; 6 | } 7 | 8 | /* Wrapping element */ 9 | /* Set some basic padding to keep content from hitting the edges */ 10 | .body-content { 11 | padding-left: 15px; 12 | padding-right: 15px; 13 | } 14 | 15 | /* Carousel */ 16 | .carousel-caption p { 17 | font-size: 20px; 18 | line-height: 1.4; 19 | } 20 | 21 | /* Make .svg files in the carousel display properly in older browsers */ 22 | .carousel-inner .item img[src$=".svg"] { 23 | width: 100%; 24 | } 25 | 26 | /* QR code generator */ 27 | #qrCode { 28 | margin: 15px; 29 | } 30 | 31 | /* Hide/rearrange for smaller screens */ 32 | @media screen and (max-width: 767px) { 33 | /* Hide captions */ 34 | .carousel-caption { 35 | display: none; 36 | } 37 | } 38 | -------------------------------------------------------------------------------- /src/DevChatter.Bot.Web/wwwroot/css/site.min.css: -------------------------------------------------------------------------------- 1 | body{padding-top:50px;padding-bottom:20px}.body-content{padding-left:15px;padding-right:15px}.carousel-caption p{font-size:20px;line-height:1.4}.carousel-inner .item img[src$=".svg"]{width:100%}#qrCode{margin:15px}@media screen and (max-width:767px){.carousel-caption{display:none}} -------------------------------------------------------------------------------- /src/DevChatter.Bot.Web/wwwroot/favicon.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/DevChatter/DevChatterBot/57984370b1780d7a427f7187148863db930ac2e9/src/DevChatter.Bot.Web/wwwroot/favicon.ico -------------------------------------------------------------------------------- /src/DevChatter.Bot.Web/wwwroot/images/BibleThump.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/DevChatter/DevChatterBot/57984370b1780d7a427f7187148863db930ac2e9/src/DevChatter.Bot.Web/wwwroot/images/BibleThump.png -------------------------------------------------------------------------------- /src/DevChatter.Bot.Web/wwwroot/images/DevchaDerpEmote.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/DevChatter/DevChatterBot/57984370b1780d7a427f7187148863db930ac2e9/src/DevChatter.Bot.Web/wwwroot/images/DevchaDerpEmote.png -------------------------------------------------------------------------------- /src/DevChatter.Bot.Web/wwwroot/images/DevchaFailEmote.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/DevChatter/DevChatterBot/57984370b1780d7a427f7187148863db930ac2e9/src/DevChatter.Bot.Web/wwwroot/images/DevchaFailEmote.png -------------------------------------------------------------------------------- /src/DevChatter.Bot.Web/wwwroot/images/DevchaHypeEmote.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/DevChatter/DevChatterBot/57984370b1780d7a427f7187148863db930ac2e9/src/DevChatter.Bot.Web/wwwroot/images/DevchaHypeEmote.png -------------------------------------------------------------------------------- /src/DevChatter.Bot.Web/wwwroot/images/ZedChatter/Axe-0.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/DevChatter/DevChatterBot/57984370b1780d7a427f7187148863db930ac2e9/src/DevChatter.Bot.Web/wwwroot/images/ZedChatter/Axe-0.png -------------------------------------------------------------------------------- /src/DevChatter.Bot.Web/wwwroot/images/ZedChatter/Axe-1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/DevChatter/DevChatterBot/57984370b1780d7a427f7187148863db930ac2e9/src/DevChatter.Bot.Web/wwwroot/images/ZedChatter/Axe-1.png -------------------------------------------------------------------------------- /src/DevChatter.Bot.Web/wwwroot/images/ZedChatter/Barrel-0.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/DevChatter/DevChatterBot/57984370b1780d7a427f7187148863db930ac2e9/src/DevChatter.Bot.Web/wwwroot/images/ZedChatter/Barrel-0.png -------------------------------------------------------------------------------- /src/DevChatter.Bot.Web/wwwroot/images/ZedChatter/BarrelFires-0.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/DevChatter/DevChatterBot/57984370b1780d7a427f7187148863db930ac2e9/src/DevChatter.Bot.Web/wwwroot/images/ZedChatter/BarrelFires-0.png -------------------------------------------------------------------------------- /src/DevChatter.Bot.Web/wwwroot/images/ZedChatter/BaseballBat-0.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/DevChatter/DevChatterBot/57984370b1780d7a427f7187148863db930ac2e9/src/DevChatter.Bot.Web/wwwroot/images/ZedChatter/BaseballBat-0.png -------------------------------------------------------------------------------- /src/DevChatter.Bot.Web/wwwroot/images/ZedChatter/BaseballBat-1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/DevChatter/DevChatterBot/57984370b1780d7a427f7187148863db930ac2e9/src/DevChatter.Bot.Web/wwwroot/images/ZedChatter/BaseballBat-1.png -------------------------------------------------------------------------------- /src/DevChatter.Bot.Web/wwwroot/images/ZedChatter/BlackCan-0.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/DevChatter/DevChatterBot/57984370b1780d7a427f7187148863db930ac2e9/src/DevChatter.Bot.Web/wwwroot/images/ZedChatter/BlackCan-0.png -------------------------------------------------------------------------------- /src/DevChatter.Bot.Web/wwwroot/images/ZedChatter/BlueCan-0.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/DevChatter/DevChatterBot/57984370b1780d7a427f7187148863db930ac2e9/src/DevChatter.Bot.Web/wwwroot/images/ZedChatter/BlueCan-0.png -------------------------------------------------------------------------------- /src/DevChatter.Bot.Web/wwwroot/images/ZedChatter/BluePotion-0.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/DevChatter/DevChatterBot/57984370b1780d7a427f7187148863db930ac2e9/src/DevChatter.Bot.Web/wwwroot/images/ZedChatter/BluePotion-0.png -------------------------------------------------------------------------------- /src/DevChatter.Bot.Web/wwwroot/images/ZedChatter/Campfire-0.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/DevChatter/DevChatterBot/57984370b1780d7a427f7187148863db930ac2e9/src/DevChatter.Bot.Web/wwwroot/images/ZedChatter/Campfire-0.png -------------------------------------------------------------------------------- /src/DevChatter.Bot.Web/wwwroot/images/ZedChatter/CoinPile-0.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/DevChatter/DevChatterBot/57984370b1780d7a427f7187148863db930ac2e9/src/DevChatter.Bot.Web/wwwroot/images/ZedChatter/CoinPile-0.png -------------------------------------------------------------------------------- /src/DevChatter.Bot.Web/wwwroot/images/ZedChatter/CoinStack-0.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/DevChatter/DevChatterBot/57984370b1780d7a427f7187148863db930ac2e9/src/DevChatter.Bot.Web/wwwroot/images/ZedChatter/CoinStack-0.png -------------------------------------------------------------------------------- /src/DevChatter.Bot.Web/wwwroot/images/ZedChatter/ExitTile-0.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/DevChatter/DevChatterBot/57984370b1780d7a427f7187148863db930ac2e9/src/DevChatter.Bot.Web/wwwroot/images/ZedChatter/ExitTile-0.png -------------------------------------------------------------------------------- /src/DevChatter.Bot.Web/wwwroot/images/ZedChatter/Flooring/Metal/MetalPlateFloor-0.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/DevChatter/DevChatterBot/57984370b1780d7a427f7187148863db930ac2e9/src/DevChatter.Bot.Web/wwwroot/images/ZedChatter/Flooring/Metal/MetalPlateFloor-0.png -------------------------------------------------------------------------------- /src/DevChatter.Bot.Web/wwwroot/images/ZedChatter/Flooring/Metal/MetalRivetTileFloor-0.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/DevChatter/DevChatterBot/57984370b1780d7a427f7187148863db930ac2e9/src/DevChatter.Bot.Web/wwwroot/images/ZedChatter/Flooring/Metal/MetalRivetTileFloor-0.png -------------------------------------------------------------------------------- /src/DevChatter.Bot.Web/wwwroot/images/ZedChatter/Flooring/Metal/MetalTileFloor-0.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/DevChatter/DevChatterBot/57984370b1780d7a427f7187148863db930ac2e9/src/DevChatter.Bot.Web/wwwroot/images/ZedChatter/Flooring/Metal/MetalTileFloor-0.png -------------------------------------------------------------------------------- /src/DevChatter.Bot.Web/wwwroot/images/ZedChatter/Flooring/Metal/MetalTileFloor-1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/DevChatter/DevChatterBot/57984370b1780d7a427f7187148863db930ac2e9/src/DevChatter.Bot.Web/wwwroot/images/ZedChatter/Flooring/Metal/MetalTileFloor-1.png -------------------------------------------------------------------------------- /src/DevChatter.Bot.Web/wwwroot/images/ZedChatter/Fresh-Gravestone-0.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/DevChatter/DevChatterBot/57984370b1780d7a427f7187148863db930ac2e9/src/DevChatter.Bot.Web/wwwroot/images/ZedChatter/Fresh-Gravestone-0.png -------------------------------------------------------------------------------- /src/DevChatter.Bot.Web/wwwroot/images/ZedChatter/Fresh-Gravestone-1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/DevChatter/DevChatterBot/57984370b1780d7a427f7187148863db930ac2e9/src/DevChatter.Bot.Web/wwwroot/images/ZedChatter/Fresh-Gravestone-1.png -------------------------------------------------------------------------------- /src/DevChatter.Bot.Web/wwwroot/images/ZedChatter/GreenPotion-0.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/DevChatter/DevChatterBot/57984370b1780d7a427f7187148863db930ac2e9/src/DevChatter.Bot.Web/wwwroot/images/ZedChatter/GreenPotion-0.png -------------------------------------------------------------------------------- /src/DevChatter.Bot.Web/wwwroot/images/ZedChatter/Hat-YellowShirt-Player-Idle-0.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/DevChatter/DevChatterBot/57984370b1780d7a427f7187148863db930ac2e9/src/DevChatter.Bot.Web/wwwroot/images/ZedChatter/Hat-YellowShirt-Player-Idle-0.png -------------------------------------------------------------------------------- /src/DevChatter.Bot.Web/wwwroot/images/ZedChatter/HeliPad-0.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/DevChatter/DevChatterBot/57984370b1780d7a427f7187148863db930ac2e9/src/DevChatter.Bot.Web/wwwroot/images/ZedChatter/HeliPad-0.png -------------------------------------------------------------------------------- /src/DevChatter.Bot.Web/wwwroot/images/ZedChatter/NailBat-0.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/DevChatter/DevChatterBot/57984370b1780d7a427f7187148863db930ac2e9/src/DevChatter.Bot.Web/wwwroot/images/ZedChatter/NailBat-0.png -------------------------------------------------------------------------------- /src/DevChatter.Bot.Web/wwwroot/images/ZedChatter/Pizza-0.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/DevChatter/DevChatterBot/57984370b1780d7a427f7187148863db930ac2e9/src/DevChatter.Bot.Web/wwwroot/images/ZedChatter/Pizza-0.png -------------------------------------------------------------------------------- /src/DevChatter.Bot.Web/wwwroot/images/ZedChatter/Player-Idle-0.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/DevChatter/DevChatterBot/57984370b1780d7a427f7187148863db930ac2e9/src/DevChatter.Bot.Web/wwwroot/images/ZedChatter/Player-Idle-0.png -------------------------------------------------------------------------------- /src/DevChatter.Bot.Web/wwwroot/images/ZedChatter/Player-Step-0.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/DevChatter/DevChatterBot/57984370b1780d7a427f7187148863db930ac2e9/src/DevChatter.Bot.Web/wwwroot/images/ZedChatter/Player-Step-0.png -------------------------------------------------------------------------------- /src/DevChatter.Bot.Web/wwwroot/images/ZedChatter/Player-StepContact-0.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/DevChatter/DevChatterBot/57984370b1780d7a427f7187148863db930ac2e9/src/DevChatter.Bot.Web/wwwroot/images/ZedChatter/Player-StepContact-0.png -------------------------------------------------------------------------------- /src/DevChatter.Bot.Web/wwwroot/images/ZedChatter/Player-Sure-0.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/DevChatter/DevChatterBot/57984370b1780d7a427f7187148863db930ac2e9/src/DevChatter.Bot.Web/wwwroot/images/ZedChatter/Player-Sure-0.png -------------------------------------------------------------------------------- /src/DevChatter.Bot.Web/wwwroot/images/ZedChatter/PlayerWalk-SpriteSheet0.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/DevChatter/DevChatterBot/57984370b1780d7a427f7187148863db930ac2e9/src/DevChatter.Bot.Web/wwwroot/images/ZedChatter/PlayerWalk-SpriteSheet0.png -------------------------------------------------------------------------------- /src/DevChatter.Bot.Web/wwwroot/images/ZedChatter/RedPotion-0.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/DevChatter/DevChatterBot/57984370b1780d7a427f7187148863db930ac2e9/src/DevChatter.Bot.Web/wwwroot/images/ZedChatter/RedPotion-0.png -------------------------------------------------------------------------------- /src/DevChatter.Bot.Web/wwwroot/images/ZedChatter/RockyGroundTile-0.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/DevChatter/DevChatterBot/57984370b1780d7a427f7187148863db930ac2e9/src/DevChatter.Bot.Web/wwwroot/images/ZedChatter/RockyGroundTile-0.png -------------------------------------------------------------------------------- /src/DevChatter.Bot.Web/wwwroot/images/ZedChatter/RockyGroundTile-1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/DevChatter/DevChatterBot/57984370b1780d7a427f7187148863db930ac2e9/src/DevChatter.Bot.Web/wwwroot/images/ZedChatter/RockyGroundTile-1.png -------------------------------------------------------------------------------- /src/DevChatter.Bot.Web/wwwroot/images/ZedChatter/RockyGroundTile-2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/DevChatter/DevChatterBot/57984370b1780d7a427f7187148863db930ac2e9/src/DevChatter.Bot.Web/wwwroot/images/ZedChatter/RockyGroundTile-2.png -------------------------------------------------------------------------------- /src/DevChatter.Bot.Web/wwwroot/images/ZedChatter/Skelly-ArmsUp.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/DevChatter/DevChatterBot/57984370b1780d7a427f7187148863db930ac2e9/src/DevChatter.Bot.Web/wwwroot/images/ZedChatter/Skelly-ArmsUp.png -------------------------------------------------------------------------------- /src/DevChatter.Bot.Web/wwwroot/images/ZedChatter/StonePath-0.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/DevChatter/DevChatterBot/57984370b1780d7a427f7187148863db930ac2e9/src/DevChatter.Bot.Web/wwwroot/images/ZedChatter/StonePath-0.png -------------------------------------------------------------------------------- /src/DevChatter.Bot.Web/wwwroot/images/ZedChatter/Sword-0.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/DevChatter/DevChatterBot/57984370b1780d7a427f7187148863db930ac2e9/src/DevChatter.Bot.Web/wwwroot/images/ZedChatter/Sword-0.png -------------------------------------------------------------------------------- /src/DevChatter.Bot.Web/wwwroot/images/ZedChatter/Sword-1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/DevChatter/DevChatterBot/57984370b1780d7a427f7187148863db930ac2e9/src/DevChatter.Bot.Web/wwwroot/images/ZedChatter/Sword-1.png -------------------------------------------------------------------------------- /src/DevChatter.Bot.Web/wwwroot/images/ZedChatter/Taco-0.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/DevChatter/DevChatterBot/57984370b1780d7a427f7187148863db930ac2e9/src/DevChatter.Bot.Web/wwwroot/images/ZedChatter/Taco-0.png -------------------------------------------------------------------------------- /src/DevChatter.Bot.Web/wwwroot/images/ZedChatter/Taco-1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/DevChatter/DevChatterBot/57984370b1780d7a427f7187148863db930ac2e9/src/DevChatter.Bot.Web/wwwroot/images/ZedChatter/Taco-1.png -------------------------------------------------------------------------------- /src/DevChatter.Bot.Web/wwwroot/images/ZedChatter/Tires-0.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/DevChatter/DevChatterBot/57984370b1780d7a427f7187148863db930ac2e9/src/DevChatter.Bot.Web/wwwroot/images/ZedChatter/Tires-0.png -------------------------------------------------------------------------------- /src/DevChatter.Bot.Web/wwwroot/images/ZedChatter/TiresFire-0.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/DevChatter/DevChatterBot/57984370b1780d7a427f7187148863db930ac2e9/src/DevChatter.Bot.Web/wwwroot/images/ZedChatter/TiresFire-0.png -------------------------------------------------------------------------------- /src/DevChatter.Bot.Web/wwwroot/images/ZedChatter/TiresFire-1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/DevChatter/DevChatterBot/57984370b1780d7a427f7187148863db930ac2e9/src/DevChatter.Bot.Web/wwwroot/images/ZedChatter/TiresFire-1.png -------------------------------------------------------------------------------- /src/DevChatter.Bot.Web/wwwroot/images/ZedChatter/TrashCanLid-0.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/DevChatter/DevChatterBot/57984370b1780d7a427f7187148863db930ac2e9/src/DevChatter.Bot.Web/wwwroot/images/ZedChatter/TrashCanLid-0.png -------------------------------------------------------------------------------- /src/DevChatter.Bot.Web/wwwroot/images/ZedChatter/UndergroundEscape-0.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/DevChatter/DevChatterBot/57984370b1780d7a427f7187148863db930ac2e9/src/DevChatter.Bot.Web/wwwroot/images/ZedChatter/UndergroundEscape-0.png -------------------------------------------------------------------------------- /src/DevChatter.Bot.Web/wwwroot/images/ZedChatter/Walls/ExteriorWall-Blue-Door-0.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/DevChatter/DevChatterBot/57984370b1780d7a427f7187148863db930ac2e9/src/DevChatter.Bot.Web/wwwroot/images/ZedChatter/Walls/ExteriorWall-Blue-Door-0.png -------------------------------------------------------------------------------- /src/DevChatter.Bot.Web/wwwroot/images/ZedChatter/Walls/ExteriorWall-Blue-Left-0.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/DevChatter/DevChatterBot/57984370b1780d7a427f7187148863db930ac2e9/src/DevChatter.Bot.Web/wwwroot/images/ZedChatter/Walls/ExteriorWall-Blue-Left-0.png -------------------------------------------------------------------------------- /src/DevChatter.Bot.Web/wwwroot/images/ZedChatter/Walls/ExteriorWall-Blue-Middle-0.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/DevChatter/DevChatterBot/57984370b1780d7a427f7187148863db930ac2e9/src/DevChatter.Bot.Web/wwwroot/images/ZedChatter/Walls/ExteriorWall-Blue-Middle-0.png -------------------------------------------------------------------------------- /src/DevChatter.Bot.Web/wwwroot/images/ZedChatter/Walls/ExteriorWall-Blue-MiddleWindow-0.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/DevChatter/DevChatterBot/57984370b1780d7a427f7187148863db930ac2e9/src/DevChatter.Bot.Web/wwwroot/images/ZedChatter/Walls/ExteriorWall-Blue-MiddleWindow-0.png -------------------------------------------------------------------------------- /src/DevChatter.Bot.Web/wwwroot/images/ZedChatter/Walls/ExteriorWall-Blue-Right-0.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/DevChatter/DevChatterBot/57984370b1780d7a427f7187148863db930ac2e9/src/DevChatter.Bot.Web/wwwroot/images/ZedChatter/Walls/ExteriorWall-Blue-Right-0.png -------------------------------------------------------------------------------- /src/DevChatter.Bot.Web/wwwroot/images/ZedChatter/Walls/ExteriorWall-Wood-Middle-0.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/DevChatter/DevChatterBot/57984370b1780d7a427f7187148863db930ac2e9/src/DevChatter.Bot.Web/wwwroot/images/ZedChatter/Walls/ExteriorWall-Wood-Middle-0.png -------------------------------------------------------------------------------- /src/DevChatter.Bot.Web/wwwroot/images/ZedChatter/Walls/InteriorWall-A-LBlock-0.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/DevChatter/DevChatterBot/57984370b1780d7a427f7187148863db930ac2e9/src/DevChatter.Bot.Web/wwwroot/images/ZedChatter/Walls/InteriorWall-A-LBlock-0.png -------------------------------------------------------------------------------- /src/DevChatter.Bot.Web/wwwroot/images/ZedChatter/Walls/InteriorWall-A-Left-0.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/DevChatter/DevChatterBot/57984370b1780d7a427f7187148863db930ac2e9/src/DevChatter.Bot.Web/wwwroot/images/ZedChatter/Walls/InteriorWall-A-Left-0.png -------------------------------------------------------------------------------- /src/DevChatter.Bot.Web/wwwroot/images/ZedChatter/Walls/InteriorWall-A-Lower-0.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/DevChatter/DevChatterBot/57984370b1780d7a427f7187148863db930ac2e9/src/DevChatter.Bot.Web/wwwroot/images/ZedChatter/Walls/InteriorWall-A-Lower-0.png -------------------------------------------------------------------------------- /src/DevChatter.Bot.Web/wwwroot/images/ZedChatter/Walls/InteriorWall-A-LowerLeft-0.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/DevChatter/DevChatterBot/57984370b1780d7a427f7187148863db930ac2e9/src/DevChatter.Bot.Web/wwwroot/images/ZedChatter/Walls/InteriorWall-A-LowerLeft-0.png -------------------------------------------------------------------------------- /src/DevChatter.Bot.Web/wwwroot/images/ZedChatter/Walls/InteriorWall-A-LowerRight-0.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/DevChatter/DevChatterBot/57984370b1780d7a427f7187148863db930ac2e9/src/DevChatter.Bot.Web/wwwroot/images/ZedChatter/Walls/InteriorWall-A-LowerRight-0.png -------------------------------------------------------------------------------- /src/DevChatter.Bot.Web/wwwroot/images/ZedChatter/Walls/InteriorWall-A-Middle-0.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/DevChatter/DevChatterBot/57984370b1780d7a427f7187148863db930ac2e9/src/DevChatter.Bot.Web/wwwroot/images/ZedChatter/Walls/InteriorWall-A-Middle-0.png -------------------------------------------------------------------------------- /src/DevChatter.Bot.Web/wwwroot/images/ZedChatter/Walls/InteriorWall-A-Nothing-0.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/DevChatter/DevChatterBot/57984370b1780d7a427f7187148863db930ac2e9/src/DevChatter.Bot.Web/wwwroot/images/ZedChatter/Walls/InteriorWall-A-Nothing-0.png -------------------------------------------------------------------------------- /src/DevChatter.Bot.Web/wwwroot/images/ZedChatter/Walls/InteriorWall-A-ReverseLBlock-0.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/DevChatter/DevChatterBot/57984370b1780d7a427f7187148863db930ac2e9/src/DevChatter.Bot.Web/wwwroot/images/ZedChatter/Walls/InteriorWall-A-ReverseLBlock-0.png -------------------------------------------------------------------------------- /src/DevChatter.Bot.Web/wwwroot/images/ZedChatter/Walls/InteriorWall-A-Right-0.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/DevChatter/DevChatterBot/57984370b1780d7a427f7187148863db930ac2e9/src/DevChatter.Bot.Web/wwwroot/images/ZedChatter/Walls/InteriorWall-A-Right-0.png -------------------------------------------------------------------------------- /src/DevChatter.Bot.Web/wwwroot/images/ZedChatter/Walls/InteriorWall-A-TopLeft-0.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/DevChatter/DevChatterBot/57984370b1780d7a427f7187148863db930ac2e9/src/DevChatter.Bot.Web/wwwroot/images/ZedChatter/Walls/InteriorWall-A-TopLeft-0.png -------------------------------------------------------------------------------- /src/DevChatter.Bot.Web/wwwroot/images/ZedChatter/Walls/InteriorWall-A-TopRight-0.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/DevChatter/DevChatterBot/57984370b1780d7a427f7187148863db930ac2e9/src/DevChatter.Bot.Web/wwwroot/images/ZedChatter/Walls/InteriorWall-A-TopRight-0.png -------------------------------------------------------------------------------- /src/DevChatter.Bot.Web/wwwroot/images/ZedChatter/Walls/Room-PoC.pdn: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/DevChatter/DevChatterBot/57984370b1780d7a427f7187148863db930ac2e9/src/DevChatter.Bot.Web/wwwroot/images/ZedChatter/Walls/Room-PoC.pdn -------------------------------------------------------------------------------- /src/DevChatter.Bot.Web/wwwroot/images/ZedChatter/Walls/Room-PoC.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/DevChatter/DevChatterBot/57984370b1780d7a427f7187148863db930ac2e9/src/DevChatter.Bot.Web/wwwroot/images/ZedChatter/Walls/Room-PoC.png -------------------------------------------------------------------------------- /src/DevChatter.Bot.Web/wwwroot/images/ZedChatter/WoodenBoardNail-0.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/DevChatter/DevChatterBot/57984370b1780d7a427f7187148863db930ac2e9/src/DevChatter.Bot.Web/wwwroot/images/ZedChatter/WoodenBoardNail-0.png -------------------------------------------------------------------------------- /src/DevChatter.Bot.Web/wwwroot/images/ZedChatter/Yellow-Hat-PlayerWalk-SpriteSheet0.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/DevChatter/DevChatterBot/57984370b1780d7a427f7187148863db930ac2e9/src/DevChatter.Bot.Web/wwwroot/images/ZedChatter/Yellow-Hat-PlayerWalk-SpriteSheet0.png -------------------------------------------------------------------------------- /src/DevChatter.Bot.Web/wwwroot/images/ZedChatter/Yellow-PlayerWalk-SpriteSheet0.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/DevChatter/DevChatterBot/57984370b1780d7a427f7187148863db930ac2e9/src/DevChatter.Bot.Web/wwwroot/images/ZedChatter/Yellow-PlayerWalk-SpriteSheet0.png -------------------------------------------------------------------------------- /src/DevChatter.Bot.Web/wwwroot/images/ZedChatter/Yellow-PlayerWalk-SpriteSheet1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/DevChatter/DevChatterBot/57984370b1780d7a427f7187148863db930ac2e9/src/DevChatter.Bot.Web/wwwroot/images/ZedChatter/Yellow-PlayerWalk-SpriteSheet1.png -------------------------------------------------------------------------------- /src/DevChatter.Bot.Web/wwwroot/images/ZedChatter/Zombie-0.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/DevChatter/DevChatterBot/57984370b1780d7a427f7187148863db930ac2e9/src/DevChatter.Bot.Web/wwwroot/images/ZedChatter/Zombie-0.png -------------------------------------------------------------------------------- /src/DevChatter.Bot.Web/wwwroot/images/ZedChatter/Zombie-Gravestone-0.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/DevChatter/DevChatterBot/57984370b1780d7a427f7187148863db930ac2e9/src/DevChatter.Bot.Web/wwwroot/images/ZedChatter/Zombie-Gravestone-0.png -------------------------------------------------------------------------------- /src/DevChatter.Bot.Web/wwwroot/images/ZedChatter/Zombie-Gravestone-1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/DevChatter/DevChatterBot/57984370b1780d7a427f7187148863db930ac2e9/src/DevChatter.Bot.Web/wwwroot/images/ZedChatter/Zombie-Gravestone-1.png -------------------------------------------------------------------------------- /src/DevChatter.Bot.Web/wwwroot/js/site.js: -------------------------------------------------------------------------------- 1 | // Please see documentation at https://docs.microsoft.com/aspnet/core/client-side/bundling-and-minification 2 | // for details on configuring this project to bundle and minify static web assets. 3 | 4 | // Write your Javascript code. 5 | -------------------------------------------------------------------------------- /src/DevChatter.Bot.Web/wwwroot/js/site.min.js: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/DevChatter/DevChatterBot/57984370b1780d7a427f7187148863db930ac2e9/src/DevChatter.Bot.Web/wwwroot/js/site.min.js -------------------------------------------------------------------------------- /src/DevChatter.Bot.Web/wwwroot/js/wasteful-game/entity/components/component.js: -------------------------------------------------------------------------------- 1 | export class Component { 2 | /** 3 | * @param {Wasteful} game 4 | * @param {Entity} entity 5 | */ 6 | constructor(game, entity) { 7 | this._game = game; 8 | this._entity = entity; 9 | } 10 | 11 | /** 12 | * @returns {Wasteful} 13 | */ 14 | get game() { 15 | return this._game; 16 | } 17 | 18 | /** 19 | * @returns {Entity} 20 | */ 21 | get entity() { 22 | return this._entity; 23 | } 24 | } 25 | -------------------------------------------------------------------------------- /src/DevChatter.Bot.Web/wwwroot/js/wasteful-game/entity/enemies/simple-zombie.js: -------------------------------------------------------------------------------- 1 | import { Enemy } from '/js/wasteful-game/entity/abstracts/enemy.js'; 2 | import { SpawnableComponent } from '/js/wasteful-game/entity/components/spawnableComponent.js'; 3 | import { Sprite } from '/js/wasteful-game/entity/sprite.js'; 4 | 5 | export class SimpleZombie extends Enemy { 6 | /** 7 | * @param {Wasteful} game 8 | */ 9 | constructor(game) { 10 | super( 11 | game, 12 | new Sprite('/images/ZedChatter/Zombie-0.png', 1, 1, 1), 13 | 1, // steps 14 | 1, // turns 15 | 1, // health 16 | false, // diagonal 17 | 1, // range 18 | 1, // damage 19 | ); 20 | 21 | this._spawnableComponent = new SpawnableComponent(game, this, [ 22 | { sprite: new Sprite('/images/ZedChatter/Fresh-Gravestone-1.png', 1, 1, 1), attackable: false, walkable: true }, 23 | // Zombie head is already visible, so let the player attack it even if not fully spawned yet 24 | { sprite: new Sprite('/images/ZedChatter/Zombie-Gravestone-1.png', 1, 1, 1), attackable: true, walkable: false }, 25 | ]); 26 | 27 | this.addComponent(this._spawnableComponent); 28 | } 29 | } 30 | -------------------------------------------------------------------------------- /src/DevChatter.Bot.Web/wwwroot/js/wasteful-game/entity/obstacles.js: -------------------------------------------------------------------------------- 1 | import { Entity } from '/js/wasteful-game/entity/entity.js'; 2 | import { Sprite } from '/js/wasteful-game/entity/sprite.js'; 3 | import { AttackingComponent } from '/js/wasteful-game/entity/components/attackingComponent.js'; 4 | 5 | export class CampFire extends Entity { 6 | /** 7 | * @param {Wasteful} game 8 | */ 9 | constructor(game) { 10 | super(game, new Sprite('/images/ZedChatter/Campfire-0.png', 1, 1, 1)); 11 | 12 | this._attackingComponent = new AttackingComponent(game, this, false, 1, 1); 13 | 14 | this.addComponent(this._attackingComponent); 15 | } 16 | } 17 | 18 | export class BarrelFire extends Entity { 19 | /** 20 | * @param {Wasteful} game 21 | */ 22 | constructor(game) { 23 | super(game, new Sprite('/images/ZedChatter/BarrelFires-0.png', 1, 1, 1)); 24 | } 25 | } 26 | -------------------------------------------------------------------------------- /src/DevChatter.Bot.Web/wwwroot/js/wasteful-game/entity/structure/ex-wall.js: -------------------------------------------------------------------------------- 1 | import { Entity } from '/js/wasteful-game/entity/entity.js'; 2 | import { Sprite } from '/js/wasteful-game/entity/sprite.js'; 3 | 4 | const bluePieces = { 5 | door: 'images/ZedChatter/Walls/ExteriorWall-Blue-Door-0.png', 6 | left: 'images/ZedChatter/Walls/ExteriorWall-Blue-Left-0.png', 7 | middle: 'images/ZedChatter/Walls/ExteriorWall-Blue-Middle-0.png', 8 | window: 'images/ZedChatter/Walls/ExteriorWall-Blue-MiddleWindow-0.png', 9 | right: 'images/ZedChatter/Walls/ExteriorWall-Blue-Right-0.png' 10 | }; 11 | 12 | 13 | export class ExWall extends Entity { 14 | /** 15 | * @param {Wasteful} game the game object 16 | * @param {string} imgSrc get source from static properties like: ExWall.blue.window 17 | * @param {number} x x coordinate 18 | * @param {number} y y coordinate 19 | */ 20 | constructor(game, imgSrc, x, y) { 21 | super(game, new Sprite(imgSrc, 1, 1, 1)); 22 | this.setLocation(x, y); 23 | } 24 | 25 | /** 26 | * @public 27 | * @returns {Object} object with fields of image sources for pieces 28 | */ 29 | static get blue() { 30 | return bluePieces; 31 | } 32 | } 33 | 34 | -------------------------------------------------------------------------------- /src/DevChatter.Bot.Web/wwwroot/js/wasteful-game/entity/structure/wall.js: -------------------------------------------------------------------------------- 1 | import { Entity } from '/js/wasteful-game/entity/entity.js'; 2 | import { Sprite } from '/js/wasteful-game/entity/sprite.js'; 3 | 4 | const wallPieces = { 5 | '0': 'images/ZedChatter/Walls/InteriorWall-A-Nothing-0.png', 6 | '<': 'images/ZedChatter/Walls/InteriorWall-A-TopLeft-0.png', 7 | '_': 'images/ZedChatter/Walls/InteriorWall-A-Middle-0.png', 8 | '>': 'images/ZedChatter/Walls/InteriorWall-A-TopRight-0.png', 9 | '/': 'images/ZedChatter/Walls/InteriorWall-A-Left-0.png', 10 | '|': 'images/ZedChatter/Walls/InteriorWall-A-Right-0.png', 11 | '(': 'images/ZedChatter/Walls/InteriorWall-A-LBlock-0.png', 12 | ')': 'images/ZedChatter/Walls/InteriorWall-A-ReverseLBlock-0.png', 13 | '-': 'images/ZedChatter/Walls/InteriorWall-A-Lower-0.png', 14 | '[': 'images/ZedChatter/Walls/InteriorWall-A-LowerLeft-0.png', 15 | ']': 'images/ZedChatter/Walls/InteriorWall-A-LowerRight-0.png' 16 | }; 17 | 18 | 19 | export class Wall extends Entity { 20 | /** 21 | * @param {Wasteful} game the game object 22 | * @param {string} key indicates the type of wall piece. Examples: 0,<,_,>,/,|,(,),-,[,] 23 | */ 24 | constructor(game, key) { 25 | super(game, new Sprite(wallPieces[key], 1, 1, 1)); 26 | } 27 | } 28 | -------------------------------------------------------------------------------- /src/DevChatter.Bot.Web/wwwroot/js/wasteful-game/inventory.js: -------------------------------------------------------------------------------- 1 | export class Inventory { 2 | /** 3 | * @public 4 | * @param {Array} startingItems initial items for the inventory 5 | */ 6 | constructor(startingItems) { 7 | this.items = startingItems || []; 8 | } 9 | 10 | /** 11 | * @public 12 | * @param {Item} item item to add 13 | */ 14 | addItem(item) { 15 | this.items.push(item); 16 | } 17 | 18 | /** 19 | * @public 20 | * @param {Item} item item to remove (if exists) 21 | */ 22 | removeItem(item) { 23 | const index = this.items.indexOf(item); 24 | if (index !== -1) { 25 | this.items.splice(index, 1); 26 | } 27 | } 28 | 29 | /** 30 | * @public 31 | * @param {number} key index of item to use 32 | */ 33 | useItem(key) { 34 | this.items[key].use(); 35 | } 36 | 37 | /** 38 | * @public 39 | * @param {Symbol} itemType type of item 40 | * @returns {Array} items of requested type 41 | */ 42 | getByItemType(itemType) { 43 | return this.items.filter(item => item.type === itemType); 44 | } 45 | } 46 | -------------------------------------------------------------------------------- /src/DevChatter.Bot.Web/wwwroot/js/wasteful-game/level-building/layouts.js: -------------------------------------------------------------------------------- 1 | const levels = { 2 | firstRoomA: [ 3 | '<____><____>0', 4 | '/ |/ |0', 5 | '/ () |0', 6 | '/ |0', 7 | '[----------]0' 8 | ] 9 | }; 10 | 11 | export class Layouts { 12 | 13 | /** 14 | * @public 15 | * @param {string} key unique identifier of the needed layout 16 | * @return {Array} rows of data contained in strings 17 | */ 18 | static byName(key) { 19 | return levels[key]; 20 | } 21 | } 22 | -------------------------------------------------------------------------------- /src/DevChatter.Bot.Web/wwwroot/js/wasteful-game/metadata.js: -------------------------------------------------------------------------------- 1 | const wastefulInfoWidth = 252; 2 | const tileSize = 42; 3 | const endTypeDied = 'died'; 4 | const endTypeEscaped = 'escaped'; 5 | 6 | export class MetaData { 7 | 8 | /** 9 | * @public 10 | * @returns {number} wastefulInfoWidth 11 | */ 12 | static get wastefulInfoWidth() { 13 | return wastefulInfoWidth; 14 | } 15 | 16 | /** 17 | * @public 18 | * @returns {number} tileSize 19 | */ 20 | static get tileSize() { 21 | return tileSize; 22 | } 23 | } 24 | 25 | export class EndTypes { 26 | 27 | /** 28 | * @public 29 | * @returns {string} died 30 | */ 31 | static get died() { 32 | return endTypeDied; 33 | } 34 | 35 | /** 36 | * @public 37 | * @returns {string} escaped 38 | */ 39 | static get escaped() { 40 | return endTypeEscaped; 41 | } 42 | } 43 | -------------------------------------------------------------------------------- /src/DevChatter.Bot.Web/wwwroot/lib/bootstrap/.bower.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "bootstrap", 3 | "description": "The most popular front-end framework for developing responsive, mobile first projects on the web.", 4 | "keywords": [ 5 | "css", 6 | "js", 7 | "less", 8 | "mobile-first", 9 | "responsive", 10 | "front-end", 11 | "framework", 12 | "web" 13 | ], 14 | "homepage": "http://getbootstrap.com", 15 | "license": "MIT", 16 | "moduleType": "globals", 17 | "main": [ 18 | "less/bootstrap.less", 19 | "dist/js/bootstrap.js" 20 | ], 21 | "ignore": [ 22 | "/.*", 23 | "_config.yml", 24 | "CNAME", 25 | "composer.json", 26 | "CONTRIBUTING.md", 27 | "docs", 28 | "js/tests", 29 | "test-infra" 30 | ], 31 | "dependencies": { 32 | "jquery": "1.9.1 - 3" 33 | }, 34 | "version": "3.3.7", 35 | "_release": "3.3.7", 36 | "_resolution": { 37 | "type": "version", 38 | "tag": "v3.3.7", 39 | "commit": "0b9c4a4007c44201dce9a6cc1a38407005c26c86" 40 | }, 41 | "_source": "https://github.com/twbs/bootstrap.git", 42 | "_target": "v3.3.7", 43 | "_originalSource": "bootstrap", 44 | "_direct": true 45 | } -------------------------------------------------------------------------------- /src/DevChatter.Bot.Web/wwwroot/lib/bootstrap/LICENSE: -------------------------------------------------------------------------------- 1 | The MIT License (MIT) 2 | 3 | Copyright (c) 2011-2016 Twitter, Inc. 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in 13 | all copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 21 | THE SOFTWARE. 22 | -------------------------------------------------------------------------------- /src/DevChatter.Bot.Web/wwwroot/lib/bootstrap/dist/fonts/glyphicons-halflings-regular.eot: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/DevChatter/DevChatterBot/57984370b1780d7a427f7187148863db930ac2e9/src/DevChatter.Bot.Web/wwwroot/lib/bootstrap/dist/fonts/glyphicons-halflings-regular.eot -------------------------------------------------------------------------------- /src/DevChatter.Bot.Web/wwwroot/lib/bootstrap/dist/fonts/glyphicons-halflings-regular.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/DevChatter/DevChatterBot/57984370b1780d7a427f7187148863db930ac2e9/src/DevChatter.Bot.Web/wwwroot/lib/bootstrap/dist/fonts/glyphicons-halflings-regular.ttf -------------------------------------------------------------------------------- /src/DevChatter.Bot.Web/wwwroot/lib/bootstrap/dist/fonts/glyphicons-halflings-regular.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/DevChatter/DevChatterBot/57984370b1780d7a427f7187148863db930ac2e9/src/DevChatter.Bot.Web/wwwroot/lib/bootstrap/dist/fonts/glyphicons-halflings-regular.woff -------------------------------------------------------------------------------- /src/DevChatter.Bot.Web/wwwroot/lib/bootstrap/dist/fonts/glyphicons-halflings-regular.woff2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/DevChatter/DevChatterBot/57984370b1780d7a427f7187148863db930ac2e9/src/DevChatter.Bot.Web/wwwroot/lib/bootstrap/dist/fonts/glyphicons-halflings-regular.woff2 -------------------------------------------------------------------------------- /src/DevChatter.Bot.Web/wwwroot/lib/bootstrap/dist/js/npm.js: -------------------------------------------------------------------------------- 1 | // This file is autogenerated via the `commonjs` Grunt task. You can require() this file in a CommonJS environment. 2 | require('../../js/transition.js') 3 | require('../../js/alert.js') 4 | require('../../js/button.js') 5 | require('../../js/carousel.js') 6 | require('../../js/collapse.js') 7 | require('../../js/dropdown.js') 8 | require('../../js/modal.js') 9 | require('../../js/tooltip.js') 10 | require('../../js/popover.js') 11 | require('../../js/scrollspy.js') 12 | require('../../js/tab.js') 13 | require('../../js/affix.js') -------------------------------------------------------------------------------- /src/DevChatter.Bot.Web/wwwroot/lib/jquery-validation-unobtrusive/.bower.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "jquery-validation-unobtrusive", 3 | "homepage": "https://github.com/aspnet/jquery-validation-unobtrusive", 4 | "version": "3.2.9", 5 | "_release": "3.2.9", 6 | "_resolution": { 7 | "type": "version", 8 | "tag": "v3.2.9", 9 | "commit": "a91f5401898e125f10771c5f5f0909d8c4c82396" 10 | }, 11 | "_source": "https://github.com/aspnet/jquery-validation-unobtrusive.git", 12 | "_target": "^3.2.9", 13 | "_originalSource": "jquery-validation-unobtrusive", 14 | "_direct": true 15 | } -------------------------------------------------------------------------------- /src/DevChatter.Bot.Web/wwwroot/lib/jquery-validation-unobtrusive/LICENSE.txt: -------------------------------------------------------------------------------- 1 | Copyright (c) .NET Foundation. All rights reserved. 2 | 3 | Licensed under the Apache License, Version 2.0 (the "License"); you may not use 4 | these files except in compliance with the License. You may obtain a copy of the 5 | License at 6 | 7 | http://www.apache.org/licenses/LICENSE-2.0 8 | 9 | Unless required by applicable law or agreed to in writing, software distributed 10 | under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR 11 | CONDITIONS OF ANY KIND, either express or implied. See the License for the 12 | specific language governing permissions and limitations under the License. 13 | -------------------------------------------------------------------------------- /src/DevChatter.Bot.Web/wwwroot/lib/jquery-validation/.bower.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "jquery-validation", 3 | "homepage": "https://jqueryvalidation.org/", 4 | "repository": { 5 | "type": "git", 6 | "url": "git://github.com/jquery-validation/jquery-validation.git" 7 | }, 8 | "authors": [ 9 | "Jörn Zaefferer " 10 | ], 11 | "description": "Form validation made easy", 12 | "main": "dist/jquery.validate.js", 13 | "keywords": [ 14 | "forms", 15 | "validation", 16 | "validate" 17 | ], 18 | "license": "MIT", 19 | "ignore": [ 20 | "**/.*", 21 | "node_modules", 22 | "bower_components", 23 | "test", 24 | "demo", 25 | "lib" 26 | ], 27 | "dependencies": { 28 | "jquery": ">= 1.7.2" 29 | }, 30 | "version": "1.17.0", 31 | "_release": "1.17.0", 32 | "_resolution": { 33 | "type": "version", 34 | "tag": "1.17.0", 35 | "commit": "fc9b12d3bfaa2d0c04605855b896edb2934c0772" 36 | }, 37 | "_source": "https://github.com/jzaefferer/jquery-validation.git", 38 | "_target": "^1.17.0", 39 | "_originalSource": "jquery-validation", 40 | "_direct": true 41 | } -------------------------------------------------------------------------------- /src/DevChatter.Bot.Web/wwwroot/lib/jquery-validation/LICENSE.md: -------------------------------------------------------------------------------- 1 | The MIT License (MIT) 2 | ===================== 3 | 4 | Copyright Jörn Zaefferer 5 | 6 | Permission is hereby granted, free of charge, to any person obtaining a copy 7 | of this software and associated documentation files (the "Software"), to deal 8 | in the Software without restriction, including without limitation the rights 9 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 10 | copies of the Software, and to permit persons to whom the Software is 11 | furnished to do so, subject to the following conditions: 12 | 13 | The above copyright notice and this permission notice shall be included in 14 | all copies or substantial portions of the Software. 15 | 16 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 17 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 18 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 19 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 20 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 21 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 22 | THE SOFTWARE. 23 | -------------------------------------------------------------------------------- /src/DevChatter.Bot.Web/wwwroot/lib/jquery/.bower.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "jquery", 3 | "main": "dist/jquery.js", 4 | "license": "MIT", 5 | "ignore": [ 6 | "package.json" 7 | ], 8 | "keywords": [ 9 | "jquery", 10 | "javascript", 11 | "browser", 12 | "library" 13 | ], 14 | "homepage": "https://github.com/jquery/jquery-dist", 15 | "version": "3.3.1", 16 | "_release": "3.3.1", 17 | "_resolution": { 18 | "type": "version", 19 | "tag": "3.3.1", 20 | "commit": "9e8ec3d10fad04748176144f108d7355662ae75e" 21 | }, 22 | "_source": "https://github.com/jquery/jquery-dist.git", 23 | "_target": "^3.3.1", 24 | "_originalSource": "jquery", 25 | "_direct": true 26 | } -------------------------------------------------------------------------------- /src/UnitTests/Core/BotModules/VotingModules/TestableVoteCommand.cs: -------------------------------------------------------------------------------- 1 | using DevChatter.Bot.Core.Automation; 2 | using DevChatter.Bot.Core.BotModules.VotingModule; 3 | using DevChatter.Bot.Core.Data; 4 | using DevChatter.Bot.Core.Events.Args; 5 | using DevChatter.Bot.Core.Systems.Chat; 6 | 7 | namespace UnitTests.Core.BotModules.VotingModules 8 | { 9 | internal class TestableVoteCommand : VoteCommand 10 | { 11 | public TestableVoteCommand(IRepository repository, VotingSystem votingSystem, IAutomatedActionSystem automatedActionSystem) : base(repository, votingSystem, automatedActionSystem) 12 | { 13 | } 14 | 15 | public void TestIt(IChatClient chatclient, CommandReceivedEventArgs eventArgs) 16 | { 17 | HandleCommand(chatclient, eventArgs); 18 | } 19 | } 20 | } 21 | -------------------------------------------------------------------------------- /src/UnitTests/Core/Commands/BaseCommandTests/TestBaseCommand.cs: -------------------------------------------------------------------------------- 1 | using DevChatter.Bot.Core.Commands; 2 | using DevChatter.Bot.Core.Data; 3 | using DevChatter.Bot.Core.Data.Model; 4 | using DevChatter.Bot.Core.Events.Args; 5 | using DevChatter.Bot.Core.Systems.Chat; 6 | 7 | namespace UnitTests.Core.Commands.BaseCommandTests 8 | { 9 | public class TestBaseCommand : BaseCommand 10 | { 11 | public TestBaseCommand(IRepository repository) 12 | : base(repository) 13 | { 14 | } 15 | 16 | protected override void HandleCommand(IChatClient chatClient, CommandReceivedEventArgs eventArgs) 17 | { 18 | throw new System.NotImplementedException(); 19 | } 20 | } 21 | } 22 | -------------------------------------------------------------------------------- /src/UnitTests/Core/Extensions/NoAtShould.cs: -------------------------------------------------------------------------------- 1 | using DevChatter.Bot.Core.Extensions; 2 | using Xunit; 3 | 4 | namespace UnitTests.Core.Extensions 5 | { 6 | public class NoAtShould 7 | { 8 | [Fact] 9 | public void DoNothing_GivenAtlessString() 10 | { 11 | string result = "DevChatter".NoAt(); 12 | 13 | Assert.Equal("DevChatter", result); 14 | } 15 | 16 | [Fact] 17 | public void RemoveAt_GivenAtPrefixedString() 18 | { 19 | string result = "@DevChatter".NoAt(); 20 | 21 | Assert.Equal("DevChatter", result); 22 | } 23 | 24 | [Fact] 25 | public void Dothing_GivenAtElsewhereInString() 26 | { 27 | string result = "Dev@Chatter".NoAt(); 28 | 29 | Assert.Equal("Dev@Chatter", result); 30 | } 31 | } 32 | } 33 | -------------------------------------------------------------------------------- /src/UnitTests/Core/Extensions/TaskExtensionsTests/TryGetResultShould.cs: -------------------------------------------------------------------------------- 1 | using DevChatter.Bot.Core.Exceptions; 2 | using DevChatter.Bot.Core.Extensions; 3 | using FluentAssertions; 4 | using System; 5 | using System.Threading.Tasks; 6 | using Xunit; 7 | 8 | namespace UnitTests.Core.Extensions.TaskExtensionsTests 9 | { 10 | public class TryGetResultShould 11 | { 12 | [Fact] 13 | public void DoSomething() 14 | { 15 | bool result = TestTask().TryGetResult().Result; 16 | 17 | result.Should().BeTrue(); 18 | } 19 | 20 | [Fact] 21 | public void DoSomethingElse() 22 | { 23 | Action action = () => 24 | { 25 | bool result = TestThrowingTask().TryGetResult().Result; 26 | }; 27 | action.Should().Throw(); 28 | } 29 | 30 | private async Task TestTask() 31 | { 32 | return await Task.Run(() => true); 33 | } 34 | 35 | private async Task TestThrowingTask() 36 | { 37 | Func func = () => throw new Exception("Hi everybody!"); 38 | return await Task.Run(func); 39 | } 40 | } 41 | } 42 | -------------------------------------------------------------------------------- /src/UnitTests/Core/Games/Quiz/QuizGameTests/StartGameShould.cs: -------------------------------------------------------------------------------- 1 | using DevChatter.Bot.Core.Automation; 2 | using DevChatter.Bot.Core.Data; 3 | using DevChatter.Bot.Core.Events; 4 | using DevChatter.Bot.Core.Games.Quiz; 5 | using DevChatter.Bot.Core.Systems.Chat; 6 | using FluentAssertions; 7 | using Moq; 8 | using Xunit; 9 | 10 | namespace UnitTests.Core.Games.Quiz.QuizGameTests 11 | { 12 | public class IsRunningShould 13 | { 14 | [Fact] 15 | public void BeFalse_ByDefault() 16 | { 17 | var quizGame = new QuizGame(new Mock().Object, new Mock().Object, new Mock().Object); 18 | 19 | quizGame.IsRunning.Should().BeFalse(); 20 | } 21 | 22 | [Fact] 23 | public void BeTrue_AfterStarting() 24 | { 25 | var quizGame = new QuizGame(new Mock().Object, new Mock().Object, new Mock().Object); 26 | 27 | quizGame.StartGame(new Mock().Object); 28 | 29 | quizGame.IsRunning.Should().BeTrue(); 30 | } 31 | 32 | // TODO: Add the test to confirm that the game is no longer running after it's completed. 33 | } 34 | } 35 | -------------------------------------------------------------------------------- /src/UnitTests/Fakes/FakeActionSystem.cs: -------------------------------------------------------------------------------- 1 | using System.Threading.Tasks; 2 | using DevChatter.Bot.Core.Automation; 3 | 4 | namespace UnitTests.Fakes 5 | { 6 | public class FakeActionSystem : IAutomatedActionSystem 7 | { 8 | public IIntervalAction IntervalAction { get; set; } 9 | 10 | public Task Start() 11 | { 12 | return Task.CompletedTask; 13 | } 14 | 15 | public void AddAction(IIntervalAction actionToAdd) 16 | { 17 | IntervalAction = actionToAdd; 18 | } 19 | } 20 | } 21 | -------------------------------------------------------------------------------- /src/UnitTests/Fakes/FakeClock.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using DevChatter.Bot.Core.Util; 3 | 4 | namespace UnitTests.Fakes 5 | { 6 | public class FakeClock : IClock 7 | { 8 | public DateTime UtcNow { get; set; } = DateTime.UtcNow; 9 | public DateTime Now { get; set; } = DateTime.Now; 10 | } 11 | } 12 | -------------------------------------------------------------------------------- /src/UnitTests/Fakes/FakeCommand.cs: -------------------------------------------------------------------------------- 1 | using System.Linq; 2 | using DevChatter.Bot.Core.Commands; 3 | using DevChatter.Bot.Core.Data; 4 | using DevChatter.Bot.Core.Events.Args; 5 | using DevChatter.Bot.Core.Systems.Chat; 6 | 7 | namespace UnitTests.Fakes 8 | { 9 | public class FakeCommand : BaseCommand 10 | { 11 | public FakeCommand(IRepository repository) 12 | : base(repository) 13 | { 14 | NotifyWordsModified(); 15 | } 16 | 17 | protected override void HandleCommand(IChatClient chatClient, CommandReceivedEventArgs eventArgs) 18 | { 19 | ProcessWasCalled = true; 20 | } 21 | 22 | public bool ProcessWasCalled { get; set; } 23 | public string CommandText => CommandWords.First().Word; 24 | } 25 | } 26 | -------------------------------------------------------------------------------- /src/UnitTests/Fakes/FakeIntervalAction.cs: -------------------------------------------------------------------------------- 1 | using DevChatter.Bot.Core.Automation; 2 | 3 | namespace UnitTests.Fakes 4 | { 5 | public class FakeIntervalAction : IIntervalAction 6 | { 7 | public bool ShouldRun { get; set; } 8 | public bool ShouldNeverRunAgain { get; set; } 9 | public bool InvokeWasRun { get; set; } = false; 10 | 11 | public FakeIntervalAction(bool isTimeToRun, bool willNeverRunAgain) 12 | { 13 | ShouldRun = isTimeToRun; 14 | ShouldNeverRunAgain = willNeverRunAgain; 15 | } 16 | public bool IsTimeToRun() 17 | { 18 | return ShouldRun; 19 | } 20 | 21 | public void Invoke() 22 | { 23 | InvokeWasRun = true; 24 | } 25 | 26 | public bool IsDone => ShouldNeverRunAgain; 27 | } 28 | } 29 | -------------------------------------------------------------------------------- /src/UnitTests/ScratchTesting.cs: -------------------------------------------------------------------------------- 1 | using System.Collections.Generic; 2 | using System.Linq; 3 | using FluentAssertions; 4 | using Xunit; 5 | 6 | namespace UnitTests 7 | { 8 | public class ScratchTesting 9 | { 10 | [Fact] 11 | public void TakeTesting() 12 | { 13 | var ints = new List {1, 2, 3, 4, 5}; 14 | 15 | IEnumerable enumerable = ints.Take(10); 16 | 17 | Assert.Equal(5, enumerable.Count()); 18 | } 19 | 20 | [Fact] 21 | public void CheckNumberSignFormatting() 22 | { 23 | int negativeNumber = -4; 24 | int positiveNumber = 2; 25 | $"{negativeNumber:+#;-#;0} {positiveNumber:+#;-#;0} {0:+#;-#;+0}".Should().Be("-4 +2 +0"); 26 | } 27 | } 28 | } 29 | -------------------------------------------------------------------------------- /src/UnitTests/UnitTests.csproj: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | netcoreapp2.1 5 | 6 | false 7 | latest 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | all 18 | runtime; build; native; contentfiles; analyzers 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | -------------------------------------------------------------------------------- /src/WastefulGame.UnitTests/WastefulGame.UnitTests.csproj: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | netcoreapp2.1 5 | 6 | false 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | all 16 | runtime; build; native; contentfiles; analyzers 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | -------------------------------------------------------------------------------- /src/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "DevChatterBot", 3 | "version": "1.0.0", 4 | "main": "index.js", 5 | "dependencies": { 6 | "chart.js": "^2.7.2" 7 | }, 8 | "devDependencies": {}, 9 | "scripts": { 10 | "test": "echo \"Error: no test specified\" && exit 1" 11 | }, 12 | "keywords": [], 13 | "author": "DevChatter", 14 | "license": "ISC", 15 | "description": "DevChatter Bot", 16 | "private": true 17 | } 18 | --------------------------------------------------------------------------------