├── basset_image.jpg ├── src ├── Basset.Generator │ ├── Basset.Generator.csproj │ └── Program.cs ├── Basset.Bot │ ├── Program.cs │ ├── Basset.Bot.csproj │ ├── Commands │ │ ├── UserConfigModule.cs │ │ └── GuildConfigModule.cs │ ├── Services │ │ └── CommandHandlingService.cs │ └── Startup.cs ├── Basset.Core │ ├── Data │ │ ├── Models │ │ │ ├── User.cs │ │ │ ├── Spotify │ │ │ │ ├── SpotifyListen.cs │ │ │ │ └── SpotifyTrack.cs │ │ │ ├── GuildWeight.cs │ │ │ ├── Guild.cs │ │ │ └── FeatureWeights.cs │ │ └── RootDatabase.cs │ ├── Options │ │ ├── DiscordOptions.cs │ │ ├── LoggingOptions.cs │ │ └── DataOptions.cs │ ├── Commands │ │ ├── BotModuleBase.cs │ │ └── BotCommandContext.cs │ ├── common │ │ └── config.yml │ ├── Logging │ │ ├── BotLoggerProvider.cs │ │ └── BotLogger.cs │ ├── Basset.Core.csproj │ └── Services │ │ └── LoggingService.cs └── Basset.Collector │ ├── Basset.Collector.csproj │ ├── Program.cs │ └── CollectingService.cs ├── nuget.config ├── .github └── workflows │ └── dotnetcore.yml ├── README.md ├── LICENSE ├── Basset.sln └── .gitignore /basset_image.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Aux/Basset/HEAD/basset_image.jpg -------------------------------------------------------------------------------- /src/Basset.Generator/Basset.Generator.csproj: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | Exe 5 | netcoreapp3.1 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /src/Basset.Bot/Program.cs: -------------------------------------------------------------------------------- 1 | using System.Threading.Tasks; 2 | 3 | namespace Basset.Bot 4 | { 5 | class Program 6 | { 7 | static Task Main(string[] args) 8 | => new Startup(args).StartAsync(); 9 | } 10 | } 11 | -------------------------------------------------------------------------------- /src/Basset.Core/Data/Models/User.cs: -------------------------------------------------------------------------------- 1 | namespace Basset.Data 2 | { 3 | public class User 4 | { 5 | public ulong Id { get; set; } 6 | public bool IsBlocked { get; set; } 7 | public bool IsIgnored { get; set; } 8 | } 9 | } 10 | -------------------------------------------------------------------------------- /src/Basset.Core/Options/DiscordOptions.cs: -------------------------------------------------------------------------------- 1 | using Discord; 2 | 3 | namespace Basset.Config 4 | { 5 | public class DiscordOptions 6 | { 7 | public string Token { get; set; } 8 | public LogSeverity LogSeverity { get; set; } 9 | } 10 | } 11 | -------------------------------------------------------------------------------- /src/Basset.Generator/Program.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Threading.Tasks; 3 | 4 | namespace Basset.Generator 5 | { 6 | class Program 7 | { 8 | static void Main(string[] args) 9 | { 10 | Console.WriteLine("Hello World!"); 11 | } 12 | } 13 | } 14 | -------------------------------------------------------------------------------- /src/Basset.Bot/Basset.Bot.csproj: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | Exe 5 | netcoreapp3.1 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /src/Basset.Collector/Basset.Collector.csproj: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | Exe 5 | netcoreapp3.1 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /src/Basset.Core/Commands/BotModuleBase.cs: -------------------------------------------------------------------------------- 1 | using Discord; 2 | using Discord.Commands; 3 | using System.Threading.Tasks; 4 | 5 | namespace Basset 6 | { 7 | public abstract class BotModuleBase : ModuleBase 8 | { 9 | public Task ReplyAsync(Embed embed, RequestOptions options = null) 10 | => ReplyAsync("", false, embed, options); 11 | } 12 | } 13 | -------------------------------------------------------------------------------- /src/Basset.Core/common/config.yml: -------------------------------------------------------------------------------- 1 | discord: 2 | token: "" 3 | 4 | data: 5 | server_type: "sqlite" 6 | database: "basset" 7 | host: "localhost" 8 | port: 3306 9 | user: "root" 10 | password: null 11 | 12 | logging: 13 | use_color_output: true 14 | use_relative_output: true 15 | max_file_size_kb: 5000 16 | output_directory: "common/logs" 17 | date_time_format: "yyyy-MM-dd" -------------------------------------------------------------------------------- /nuget.config: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /.github/workflows/dotnetcore.yml: -------------------------------------------------------------------------------- 1 | name: .NET Core 2 | 3 | on: [push] 4 | 5 | jobs: 6 | build: 7 | 8 | runs-on: ubuntu-latest 9 | 10 | steps: 11 | - uses: actions/checkout@v1 12 | - name: Setup .NET Core 13 | uses: actions/setup-dotnet@v1 14 | with: 15 | dotnet-version: 3.1.300-preview-015048 16 | - name: Build with dotnet 17 | run: dotnet build --configuration Release -------------------------------------------------------------------------------- /src/Basset.Core/Options/LoggingOptions.cs: -------------------------------------------------------------------------------- 1 | namespace Basset.Logging 2 | { 3 | public class LoggingOptions 4 | { 5 | public bool UseColorOutput { get; } = true; 6 | public bool UseRelativeOutput { get; } = true; 7 | public int MaxFileSizeKb { get; } = 5000; 8 | public string OutputDirectory { get; } = "common/logs"; 9 | public string DateTimeFormat { get; } = "yyyy-MM-dd"; 10 | } 11 | } 12 | -------------------------------------------------------------------------------- /src/Basset.Core/Data/Models/Spotify/SpotifyListen.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | 3 | namespace Basset.Data 4 | { 5 | public class SpotifyListen 6 | { 7 | public int Id { get; set; } 8 | public DateTime Timestamp { get; set; } 9 | public ulong UserId { get; set; } 10 | public ulong GuildId { get; set; } 11 | public string TrackId { get; set; } 12 | 13 | public SpotifyTrack Track { get; set; } 14 | } 15 | } 16 | -------------------------------------------------------------------------------- /src/Basset.Core/Data/Models/GuildWeight.cs: -------------------------------------------------------------------------------- 1 | namespace Basset.Data 2 | { 3 | public enum WeightType 4 | { 5 | User, 6 | Role 7 | } 8 | 9 | public class GuildWeight 10 | { 11 | public ulong Id { get; set; } 12 | public ulong GuildId { get; set; } 13 | public ulong WeightedId { get; set; } 14 | public WeightType WeightType { get; set; } 15 | 16 | public Guild Guild { get; set; } 17 | } 18 | } 19 | -------------------------------------------------------------------------------- /src/Basset.Core/Data/Models/Guild.cs: -------------------------------------------------------------------------------- 1 | using System.Collections.Generic; 2 | 3 | namespace Basset.Data 4 | { 5 | public enum OptMode 6 | { 7 | OptOut, 8 | OptIn 9 | } 10 | 11 | public class Guild 12 | { 13 | public ulong Id { get; set; } 14 | public bool IsBlocked { get; set; } 15 | public OptMode OptMode { get; set; } 16 | 17 | public FeatureWeights FeatureWeights { get; set; } 18 | public List GuildWeights { get; set; } 19 | } 20 | } 21 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # Basset 2 | [![Discord](https://discordapp.com/api/guilds/257698577894080512/widget.png)](https://discord.gg/t5vphPafdG) ![.NET Core](https://github.com/Aux/Basset/workflows/.NET%20Core/badge.svg) 3 | 4 | Generate a weekly playlist based on your guild's spotify listening activity and do the other things. 5 | [Click here for the bot invite](https://discordapp.com/oauth2/authorize/?permissions=67584&scope=bot&client_id=593797043458146318) or click the little badge above to join my guild and test it out. 6 | 7 |

8 | 9 |

10 | -------------------------------------------------------------------------------- /src/Basset.Core/Data/Models/Spotify/SpotifyTrack.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | 4 | namespace Basset.Data 5 | { 6 | public class SpotifyTrack 7 | { 8 | // Provided by Discord 9 | public string Id { get; set; } 10 | public string Title { get; set; } 11 | public double Duration { get; set; } 12 | 13 | // Provided by Spotify 14 | public DateTime? ReleaseDate { get; set; } = null; 15 | public int? Popularity { get; set; } = null; 16 | 17 | public List Listens { get; set; } 18 | } 19 | } 20 | -------------------------------------------------------------------------------- /src/Basset.Core/Options/DataOptions.cs: -------------------------------------------------------------------------------- 1 | namespace Basset.Options 2 | { 3 | public enum ServerType 4 | { 5 | SQLite, 6 | MySQL, 7 | Postgres // Not implemented 8 | } 9 | 10 | public class DataOptions 11 | { 12 | public ServerType ServerType { get; set; } = ServerType.SQLite; 13 | public string Database { get; set; } = "basset"; 14 | public string Host { get; set; } = "localhost"; 15 | public int Port { get; set; } = 3306; 16 | public string User { get; set; } = "root"; 17 | public string Password { get; set; } = null; 18 | } 19 | } 20 | -------------------------------------------------------------------------------- /src/Basset.Bot/Commands/UserConfigModule.cs: -------------------------------------------------------------------------------- 1 | using Basset.Data; 2 | using Discord.Commands; 3 | using System.Threading.Tasks; 4 | 5 | namespace Basset.Bot.Commands 6 | { 7 | public class UserConfigModule : BotModuleBase 8 | { 9 | private readonly RootDatabase _db; 10 | 11 | public UserConfigModule(RootDatabase db) 12 | { 13 | _db = db; 14 | } 15 | 16 | [Command("optout")] 17 | public async Task OptOutAsync() 18 | { 19 | await Task.Delay(0); 20 | } 21 | 22 | [Command("optin")] 23 | public async Task OptInAsync() 24 | { 25 | await Task.Delay(0); 26 | } 27 | } 28 | } 29 | -------------------------------------------------------------------------------- /src/Basset.Core/Logging/BotLoggerProvider.cs: -------------------------------------------------------------------------------- 1 | using Microsoft.Extensions.Configuration; 2 | using Microsoft.Extensions.Logging; 3 | 4 | namespace Basset.Logging 5 | { 6 | public class BotLoggerProvider : ILoggerProvider 7 | { 8 | private readonly LoggingOptions _options; 9 | 10 | public BotLoggerProvider(IConfiguration config) 11 | { 12 | _options = new LoggingOptions(); 13 | config.Bind("logging", _options); 14 | } 15 | 16 | public ILogger CreateLogger(string categoryName) 17 | { 18 | return new BotLogger(categoryName, _options); 19 | } 20 | 21 | public void Dispose() 22 | { 23 | return; 24 | } 25 | } 26 | } 27 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2019 Auxesis 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 | -------------------------------------------------------------------------------- /src/Basset.Core/Commands/BotCommandContext.cs: -------------------------------------------------------------------------------- 1 | using Discord; 2 | using Discord.Commands; 3 | using Discord.WebSocket; 4 | 5 | namespace Basset 6 | { 7 | public class BotCommandContext : ICommandContext 8 | { 9 | public DiscordShardedClient Client { get; } 10 | public SocketGuild Guild { get; } 11 | public ISocketMessageChannel Channel { get; } 12 | public SocketUser User { get; } 13 | public SocketUserMessage Message { get; } 14 | 15 | public bool IsPrivate => Channel is IPrivateChannel; 16 | 17 | public BotCommandContext(DiscordShardedClient client, SocketUserMessage msg, SocketUser user = null) 18 | { 19 | Client = client; 20 | Guild = (msg.Channel as SocketGuildChannel)?.Guild; 21 | Channel = msg.Channel; 22 | User = user ?? msg.Author; 23 | Message = msg; 24 | } 25 | 26 | //ICommandContext 27 | IDiscordClient ICommandContext.Client => Client; 28 | IGuild ICommandContext.Guild => Guild; 29 | IMessageChannel ICommandContext.Channel => Channel; 30 | IUser ICommandContext.User => User; 31 | IUserMessage ICommandContext.Message => Message; 32 | } 33 | } 34 | -------------------------------------------------------------------------------- /src/Basset.Core/Basset.Core.csproj: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | netstandard2.0 5 | Basset 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | PreserveNewest 23 | 24 | 25 | 26 | 27 | -------------------------------------------------------------------------------- /src/Basset.Core/Data/Models/FeatureWeights.cs: -------------------------------------------------------------------------------- 1 | using System.ComponentModel.DataAnnotations; 2 | 3 | namespace Basset.Data 4 | { 5 | public class FeatureWeights 6 | { 7 | public ulong Id { get; set; } 8 | public ulong GuildId { get; set; } 9 | public bool? Mode { get; set; } 10 | [Range(-1, 11)] 11 | public int? Key { get; set; } 12 | [Range(1, int.MaxValue)] 13 | public int? TimeSignature { get; set; } 14 | [Range(0.1, 1.0)] 15 | public float? Danceability { get; set; } 16 | [Range(0.1, 1.0)] 17 | public float? Energy { get; set; } 18 | [Range(-60, 0)] 19 | public float? Loudness { get; set; } 20 | [Range(0.1, 1.0)] 21 | public float? Speechiness { get; set; } 22 | [Range(0.1, 1.0)] 23 | public float? Acousticness { get; set; } 24 | [Range(0.1, 1.0)] 25 | public float? Instrumentalness { get; set; } 26 | [Range(0.1, 1.0)] 27 | public float? Liveness { get; set; } 28 | [Range(0.1, 1.0)] 29 | public float? Valence { get; set; } 30 | [Range(0, 250)] 31 | public float? Tempo { get; set; } 32 | 33 | public Guild Guild { get; set; } 34 | } 35 | } 36 | -------------------------------------------------------------------------------- /src/Basset.Collector/Program.cs: -------------------------------------------------------------------------------- 1 | using Basset.Logging; 2 | using Basset.Services; 3 | using Discord; 4 | using Discord.WebSocket; 5 | using Microsoft.Extensions.Configuration; 6 | using Microsoft.Extensions.Logging; 7 | using System; 8 | using System.IO; 9 | using System.Threading.Tasks; 10 | 11 | namespace Basset.Collector 12 | { 13 | class Program 14 | { 15 | static async Task Main(string[] args) 16 | { 17 | var config = new ConfigurationBuilder() 18 | .SetBasePath(Path.Combine(AppContext.BaseDirectory, "common")) 19 | .AddYamlFile("config.yml") 20 | .AddCommandLine(args) 21 | .Build(); 22 | 23 | var loggerFactory = LoggerFactory.Create(builder => 24 | { 25 | builder.AddProvider(new BotLoggerProvider(config)); 26 | }); 27 | var logger = loggerFactory.CreateLogger(); 28 | 29 | var discord = new DiscordShardedClient(new DiscordSocketConfig 30 | { 31 | GatewayIntents = GatewayIntents.GuildPresences | GatewayIntents.Guilds, 32 | LogLevel = LogSeverity.Debug 33 | }); 34 | 35 | var loggingService = new LoggingService(loggerFactory, discord, null); 36 | loggingService.Start(); 37 | 38 | var collectingService = new CollectingService(logger, discord, config); 39 | await collectingService.RunAsync(); 40 | } 41 | } 42 | } 43 | -------------------------------------------------------------------------------- /src/Basset.Core/Services/LoggingService.cs: -------------------------------------------------------------------------------- 1 | using Discord; 2 | using Discord.Commands; 3 | using Discord.WebSocket; 4 | using Microsoft.Extensions.Logging; 5 | using System.Threading.Tasks; 6 | 7 | namespace Basset.Services 8 | { 9 | public class LoggingService 10 | { 11 | private readonly ILoggerFactory _factory; 12 | private readonly DiscordShardedClient _discord; 13 | private readonly CommandService _commandService; 14 | 15 | public LoggingService( 16 | ILoggerFactory factory, 17 | DiscordShardedClient discord, 18 | CommandService commandService) 19 | { 20 | _factory = factory; 21 | _commandService = commandService; 22 | _discord = discord; 23 | } 24 | 25 | public void Start() 26 | { 27 | if (_commandService != null) 28 | _commandService.Log += OnLogAsync; 29 | _discord.Log += OnLogAsync; 30 | } 31 | 32 | private Task OnLogAsync(LogMessage msg) 33 | { 34 | var logger = _factory.CreateLogger(msg.Source); 35 | string message = msg.Exception?.ToString() ?? msg.Message; 36 | switch (msg.Severity) 37 | { 38 | case LogSeverity.Debug: 39 | logger.LogDebug(message); 40 | break; 41 | case LogSeverity.Warning: 42 | logger.LogWarning(message); 43 | break; 44 | case LogSeverity.Error: 45 | logger.LogError(message); 46 | break; 47 | case LogSeverity.Critical: 48 | logger.LogCritical(message); 49 | break; 50 | default: 51 | logger.LogInformation(message); 52 | break; 53 | } 54 | return Task.CompletedTask; 55 | } 56 | } 57 | } 58 | -------------------------------------------------------------------------------- /src/Basset.Bot/Commands/GuildConfigModule.cs: -------------------------------------------------------------------------------- 1 | using Basset.Data; 2 | using Discord; 3 | using Discord.Commands; 4 | using System.Threading.Tasks; 5 | 6 | namespace Basset.Bot.Commands 7 | { 8 | [Group("guild")] 9 | public class GuildConfigModule : BotModuleBase 10 | { 11 | private readonly RootDatabase _db; 12 | 13 | public GuildConfigModule(RootDatabase db) 14 | { 15 | _db = db; 16 | } 17 | 18 | [Command] 19 | public async Task GetGuildInfoAsync() 20 | { 21 | // Display guild's non-sensitive configuration options 22 | await Task.Delay(0); 23 | } 24 | 25 | [Command("roleweight")] 26 | public async Task GetRoleWeightAsync(IRole role) 27 | { 28 | // Display a role's weight for playlist generation 29 | await Task.Delay(0); 30 | } 31 | 32 | [Command("roleweight")] 33 | public async Task SetRoleWeightAsync(IRole role, double weight) 34 | { 35 | // Set a role's weight for playlist generation 36 | await Task.Delay(0); 37 | } 38 | 39 | [Command("userweight")] 40 | public async Task GetUserWeightAsync(IUser user) 41 | { 42 | // Display a user's weight for playlist generation 43 | await Task.Delay(0); 44 | } 45 | 46 | [Command("userweight")] 47 | public async Task SetUserWeightAsync(IUser user, double weight) 48 | { 49 | // Set a user's weight for playlist generation 50 | await Task.Delay(0); 51 | } 52 | 53 | [Command("featureweight")] 54 | public async Task GetFeatureWeightAsync(string name) 55 | { 56 | // Display all feature weights 57 | await Task.Delay(0); 58 | } 59 | 60 | [Command("featureweight")] 61 | public async Task SetFeatureWeightAsync(object options) 62 | { 63 | // Set one or many feature's weights 64 | await Task.Delay(0); 65 | } 66 | } 67 | } 68 | -------------------------------------------------------------------------------- /src/Basset.Collector/CollectingService.cs: -------------------------------------------------------------------------------- 1 | using Discord; 2 | using Discord.WebSocket; 3 | using Microsoft.Extensions.Configuration; 4 | using Microsoft.Extensions.Logging; 5 | using System; 6 | using System.Threading.Tasks; 7 | 8 | namespace Basset.Collector 9 | { 10 | public class CollectingService 11 | { 12 | private readonly ILogger _logger; 13 | private readonly IConfiguration _config; 14 | private readonly DiscordShardedClient _discord; 15 | 16 | public CollectingService(ILogger logger, DiscordShardedClient discord, IConfiguration config) 17 | { 18 | _logger = logger; 19 | _config = config; 20 | _discord = discord; 21 | } 22 | 23 | public async Task RunAsync() 24 | { 25 | _discord.GuildMemberUpdated += OnGuildMemberUpdatedAsync; 26 | _discord.UserUpdated += OnUserUpdatedAsync; 27 | 28 | await _discord.LoginAsync(TokenType.Bot, _config["discord:token"]); 29 | await _discord.StartAsync(); 30 | await Task.Delay(-1); 31 | } 32 | 33 | private Task OnUserUpdatedAsync(SocketUser before, SocketUser after) 34 | { 35 | var bspotify = before.Activity as SpotifyGame; 36 | var aspotify = after.Activity as SpotifyGame; 37 | 38 | if (bspotify == null && aspotify == null) 39 | return Task.CompletedTask; 40 | 41 | _logger.LogInformation($"User: {bspotify} -> {aspotify}"); 42 | return Task.CompletedTask; 43 | } 44 | 45 | private Task OnGuildMemberUpdatedAsync(SocketGuildUser before, SocketGuildUser after) 46 | { 47 | var bspotify = before.Activity as SpotifyGame; 48 | var aspotify = after.Activity as SpotifyGame; 49 | 50 | if (bspotify == null && aspotify == null) 51 | return Task.CompletedTask; 52 | if (bspotify?.TrackId == aspotify?.TrackId) 53 | return Task.CompletedTask; 54 | 55 | _logger.LogInformation($"Guild: {bspotify} -> {aspotify}"); 56 | return Task.CompletedTask; 57 | } 58 | } 59 | } 60 | -------------------------------------------------------------------------------- /src/Basset.Bot/Services/CommandHandlingService.cs: -------------------------------------------------------------------------------- 1 | using Discord.Commands; 2 | using Discord.WebSocket; 3 | using Microsoft.Extensions.Logging; 4 | using System; 5 | using System.Threading.Tasks; 6 | 7 | namespace Basset.Bot.Services 8 | { 9 | public class CommandHandlingService 10 | { 11 | private readonly ILogger _logger; 12 | private readonly CommandService _commandService; 13 | private readonly DiscordShardedClient _discord; 14 | private readonly IServiceProvider _serviceProvider; 15 | 16 | public CommandHandlingService( 17 | ILogger logger, 18 | CommandService commandService, 19 | DiscordShardedClient discord, 20 | IServiceProvider serviceProvider) 21 | { 22 | _logger = logger; 23 | _commandService = commandService; 24 | _discord = discord; 25 | _serviceProvider = serviceProvider; 26 | } 27 | 28 | public void Start() 29 | { 30 | _discord.MessageReceived += OnMessageReceivedAsync; 31 | _logger.LogInformation("Started"); 32 | } 33 | 34 | public void Stop() 35 | { 36 | _discord.MessageReceived -= OnMessageReceivedAsync; 37 | _logger.LogInformation("Stopped"); 38 | } 39 | 40 | private async Task OnMessageReceivedAsync(SocketMessage s) 41 | { 42 | if (!(s is SocketUserMessage msg)) return; 43 | if (!(s.Channel is SocketGuildChannel)) return; 44 | 45 | int argPos = 0; 46 | var context = new BotCommandContext(_discord, msg); 47 | if (msg.HasMentionPrefix(_discord.CurrentUser, ref argPos)) 48 | { 49 | var result = await _commandService.ExecuteAsync(context, argPos, _serviceProvider); 50 | if (result.IsSuccess) return; 51 | 52 | switch (result) 53 | { 54 | case ExecuteResult execute: 55 | _logger.LogError(execute.Exception?.ToString()); 56 | return; 57 | case ParseResult parse when parse.Error == CommandError.BadArgCount: 58 | // Send Help Text 59 | return; 60 | default: 61 | await context.Channel.SendMessageAsync(result.ErrorReason); 62 | return; 63 | } 64 | } 65 | } 66 | } 67 | } -------------------------------------------------------------------------------- /src/Basset.Bot/Startup.cs: -------------------------------------------------------------------------------- 1 | using Basset.Bot.Services; 2 | using Basset.Data; 3 | using Basset.Logging; 4 | using Basset.Services; 5 | using Discord; 6 | using Discord.Commands; 7 | using Discord.WebSocket; 8 | using Microsoft.Extensions.Configuration; 9 | using Microsoft.Extensions.DependencyInjection; 10 | using Microsoft.Extensions.Logging; 11 | using System; 12 | using System.IO; 13 | using System.Reflection; 14 | using System.Threading.Tasks; 15 | 16 | namespace Basset.Bot 17 | { 18 | public class Startup 19 | { 20 | private IConfiguration _config; 21 | 22 | public Startup(string[] args) 23 | { 24 | _config = new ConfigurationBuilder() 25 | .SetBasePath(Path.Combine(AppContext.BaseDirectory, "common")) 26 | .AddYamlFile("config.yml") 27 | .AddCommandLine(args) 28 | .Build(); 29 | } 30 | 31 | public async Task StartAsync() 32 | { 33 | var services = new ServiceCollection(); 34 | ConfigureServices(services); 35 | var provider = services.BuildServiceProvider(); 36 | 37 | var discord = provider.GetRequiredService(); 38 | await discord.LoginAsync(TokenType.Bot, _config["discord:token"]); 39 | await discord.StartAsync(); 40 | 41 | var commands = provider.GetRequiredService(); 42 | await commands.AddModulesAsync(Assembly.GetExecutingAssembly(), provider); 43 | 44 | provider.GetRequiredService().AddProvider(new BotLoggerProvider(_config)); 45 | provider.GetRequiredService().Start(); 46 | provider.GetRequiredService().Start(); 47 | 48 | await Task.Delay(-1); 49 | } 50 | 51 | private void ConfigureServices(ServiceCollection services) 52 | { 53 | services 54 | .AddSingleton(new DiscordShardedClient(new DiscordSocketConfig 55 | { 56 | LogLevel = LogSeverity.Verbose 57 | })) 58 | .AddSingleton(new CommandService(new CommandServiceConfig 59 | { 60 | CaseSensitiveCommands = false, 61 | IgnoreExtraArgs = false 62 | })) 63 | .AddSingleton(_config) 64 | .AddSingleton() 65 | .AddSingleton() 66 | .AddDbContext() 67 | .AddLogging(); 68 | } 69 | } 70 | } 71 | -------------------------------------------------------------------------------- /Basset.sln: -------------------------------------------------------------------------------- 1 | 2 | Microsoft Visual Studio Solution File, Format Version 12.00 3 | # Visual Studio Version 16 4 | VisualStudioVersion = 16.0.30014.187 5 | MinimumVisualStudioVersion = 10.0.40219.1 6 | Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Basset.Bot", "src\Basset.Bot\Basset.Bot.csproj", "{74A52CE6-2481-45D2-9970-B7CCEB721448}" 7 | EndProject 8 | Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Basset.Core", "src\Basset.Core\Basset.Core.csproj", "{296A1189-47F0-49A6-B32B-CD4007A7D022}" 9 | EndProject 10 | Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Basset.Collector", "src\Basset.Collector\Basset.Collector.csproj", "{2D1F3724-5177-432D-B6CC-E30B4487B9DB}" 11 | EndProject 12 | Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Basset.Generator", "src\Basset.Generator\Basset.Generator.csproj", "{280B6635-1E93-45E6-A404-8D5219718D9F}" 13 | EndProject 14 | Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Discord", "Discord", "{2C7A1551-FA09-435C-8CC4-763BCBBCB606}" 15 | EndProject 16 | Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Web", "Web", "{AE960EBB-C700-4D81-B071-F5760527B31C}" 17 | EndProject 18 | Global 19 | GlobalSection(SolutionConfigurationPlatforms) = preSolution 20 | Debug|Any CPU = Debug|Any CPU 21 | Release|Any CPU = Release|Any CPU 22 | EndGlobalSection 23 | GlobalSection(ProjectConfigurationPlatforms) = postSolution 24 | {74A52CE6-2481-45D2-9970-B7CCEB721448}.Debug|Any CPU.ActiveCfg = Debug|Any CPU 25 | {74A52CE6-2481-45D2-9970-B7CCEB721448}.Debug|Any CPU.Build.0 = Debug|Any CPU 26 | {74A52CE6-2481-45D2-9970-B7CCEB721448}.Release|Any CPU.ActiveCfg = Release|Any CPU 27 | {74A52CE6-2481-45D2-9970-B7CCEB721448}.Release|Any CPU.Build.0 = Release|Any CPU 28 | {296A1189-47F0-49A6-B32B-CD4007A7D022}.Debug|Any CPU.ActiveCfg = Debug|Any CPU 29 | {296A1189-47F0-49A6-B32B-CD4007A7D022}.Debug|Any CPU.Build.0 = Debug|Any CPU 30 | {296A1189-47F0-49A6-B32B-CD4007A7D022}.Release|Any CPU.ActiveCfg = Release|Any CPU 31 | {296A1189-47F0-49A6-B32B-CD4007A7D022}.Release|Any CPU.Build.0 = Release|Any CPU 32 | {2D1F3724-5177-432D-B6CC-E30B4487B9DB}.Debug|Any CPU.ActiveCfg = Debug|Any CPU 33 | {2D1F3724-5177-432D-B6CC-E30B4487B9DB}.Debug|Any CPU.Build.0 = Debug|Any CPU 34 | {2D1F3724-5177-432D-B6CC-E30B4487B9DB}.Release|Any CPU.ActiveCfg = Release|Any CPU 35 | {2D1F3724-5177-432D-B6CC-E30B4487B9DB}.Release|Any CPU.Build.0 = Release|Any CPU 36 | {280B6635-1E93-45E6-A404-8D5219718D9F}.Debug|Any CPU.ActiveCfg = Debug|Any CPU 37 | {280B6635-1E93-45E6-A404-8D5219718D9F}.Debug|Any CPU.Build.0 = Debug|Any CPU 38 | {280B6635-1E93-45E6-A404-8D5219718D9F}.Release|Any CPU.ActiveCfg = Release|Any CPU 39 | {280B6635-1E93-45E6-A404-8D5219718D9F}.Release|Any CPU.Build.0 = Release|Any CPU 40 | EndGlobalSection 41 | GlobalSection(SolutionProperties) = preSolution 42 | HideSolutionNode = FALSE 43 | EndGlobalSection 44 | GlobalSection(NestedProjects) = preSolution 45 | {74A52CE6-2481-45D2-9970-B7CCEB721448} = {2C7A1551-FA09-435C-8CC4-763BCBBCB606} 46 | {2D1F3724-5177-432D-B6CC-E30B4487B9DB} = {2C7A1551-FA09-435C-8CC4-763BCBBCB606} 47 | {280B6635-1E93-45E6-A404-8D5219718D9F} = {AE960EBB-C700-4D81-B071-F5760527B31C} 48 | EndGlobalSection 49 | GlobalSection(ExtensibilityGlobals) = postSolution 50 | SolutionGuid = {F2255A0D-040F-4A42-9C58-4BD53E6095F1} 51 | EndGlobalSection 52 | EndGlobal 53 | -------------------------------------------------------------------------------- /src/Basset.Core/Data/RootDatabase.cs: -------------------------------------------------------------------------------- 1 | using Basset.Options; 2 | using Microsoft.EntityFrameworkCore; 3 | using Microsoft.Extensions.Configuration; 4 | using System; 5 | using System.IO; 6 | using System.Text; 7 | 8 | namespace Basset.Data 9 | { 10 | public class RootDatabase : DbContext 11 | { 12 | private readonly DataOptions _options; 13 | 14 | public DbSet Tracks { get; set; } 15 | public DbSet Listens { get; set; } 16 | 17 | public DbSet Guilds { get; set; } 18 | public DbSet Users { get; set; } 19 | public DbSet GuildWeights { get; set; } 20 | public DbSet FeatureWeights { get; set; } 21 | 22 | public RootDatabase(IConfiguration config) 23 | { 24 | _options = new DataOptions(); 25 | config.Bind("data", _options); 26 | 27 | Database.EnsureCreated(); 28 | } 29 | 30 | protected override void OnConfiguring(DbContextOptionsBuilder optionsBuilder) 31 | { 32 | if (_options.ServerType == ServerType.SQLite) 33 | { 34 | string baseDir = Path.Combine(AppContext.BaseDirectory, "common/data"); 35 | if (!Directory.Exists(baseDir)) 36 | Directory.CreateDirectory(baseDir); 37 | 38 | string datadir = Path.Combine(baseDir, "basset.sqlite.db"); 39 | optionsBuilder.UseSqlite($"Filename={datadir}"); 40 | } else 41 | { 42 | var stringBuilder = new StringBuilder(); 43 | if (string.IsNullOrWhiteSpace(_options.Host)) 44 | throw new ArgumentNullException("`host` value in configuration is missing"); 45 | else 46 | stringBuilder.Append($"Host={_options.Host};"); 47 | if (string.IsNullOrWhiteSpace(_options.Database)) 48 | throw new ArgumentNullException("`database` value in configuration is missing"); 49 | else 50 | stringBuilder.Append($"Database={_options.Database};"); 51 | if (!string.IsNullOrWhiteSpace(_options.User)) 52 | stringBuilder.Append($"Username={_options.User};"); 53 | if (!string.IsNullOrWhiteSpace(_options.Password)) 54 | stringBuilder.Append($"Password={_options.Password};"); 55 | 56 | if (_options.ServerType == ServerType.MySQL) 57 | optionsBuilder.UseMySql(stringBuilder.ToString()); 58 | else if (_options.ServerType == ServerType.Postgres) 59 | optionsBuilder.UseNpgsql(stringBuilder.ToString()); 60 | } 61 | } 62 | 63 | protected override void OnModelCreating(ModelBuilder modelBuilder) 64 | { 65 | modelBuilder.Entity() 66 | .HasMany(x => x.Listens) 67 | .WithOne(x => x.Track); 68 | modelBuilder.Entity() 69 | .HasOne(x => x.Track) 70 | .WithMany(x => x.Listens); 71 | 72 | modelBuilder.Entity() 73 | .HasMany(x => x.GuildWeights) 74 | .WithOne(x => x.Guild); 75 | modelBuilder.Entity() 76 | .HasOne(x => x.FeatureWeights) 77 | .WithOne(x => x.Guild); 78 | } 79 | } 80 | } 81 | -------------------------------------------------------------------------------- /src/Basset.Core/Logging/BotLogger.cs: -------------------------------------------------------------------------------- 1 | using Microsoft.Extensions.Logging; 2 | using System; 3 | using System.Collections.Generic; 4 | using System.Drawing; 5 | using System.IO; 6 | using System.Text; 7 | 8 | namespace Basset.Logging 9 | { 10 | public class BotLogMessage 11 | { 12 | public DateTime Timestamp { get; } = DateTime.UtcNow; 13 | public LogLevel LogLevel { get; set; } 14 | public string SourceName { get; set; } 15 | public string Content { get; set; } 16 | 17 | public string GetTimestamp() => Timestamp.ToString("hh:mm:ss"); 18 | public string GetShortLogLevel() => LogLevel.ToString().Substring(0, 4); 19 | public override string ToString() => $"{GetTimestamp()} [{GetShortLogLevel()}] {SourceName}: {Content}\n"; 20 | } 21 | 22 | public class BotLogger : ILogger 23 | { 24 | private readonly LoggingOptions _options; 25 | private readonly string _categoryName; 26 | private readonly string _outputDirectory; 27 | 28 | private int _duplicateLogFileCount = 0; 29 | 30 | private string _logFile => Path.Combine(_outputDirectory, GetFileName(DateTime.UtcNow)); 31 | 32 | public BotLogger(string categoryName, LoggingOptions options) 33 | { 34 | _options = options; 35 | _categoryName = categoryName; 36 | _outputDirectory = _options.UseRelativeOutput 37 | ? Path.Combine(AppContext.BaseDirectory, _options.OutputDirectory) 38 | : _options.OutputDirectory; 39 | } 40 | 41 | public bool IsEnabled(LogLevel logLevel) 42 | { 43 | return true; 44 | } 45 | 46 | public string GetFileName(DateTime dateTime) 47 | { 48 | var builder = new StringBuilder(dateTime.ToString(_options.DateTimeFormat)); 49 | if (_duplicateLogFileCount != 0) 50 | builder.Append($" ({_duplicateLogFileCount})"); 51 | builder.Append(".txt"); 52 | return builder.ToString(); 53 | } 54 | 55 | public void Log(LogLevel logLevel, EventId eventId, TState state, Exception exception, Func formatter) 56 | { 57 | var log = new BotLogMessage 58 | { 59 | LogLevel = logLevel, 60 | SourceName = _categoryName, 61 | Content = formatter(state, exception) 62 | }; 63 | 64 | string logText = log.ToString(); 65 | 66 | if (!Directory.Exists(_outputDirectory)) 67 | Directory.CreateDirectory(_outputDirectory); 68 | 69 | var fileInfo = new FileInfo(_logFile); 70 | if (!fileInfo.Exists) 71 | { 72 | fileInfo.Create().Dispose(); 73 | fileInfo.Refresh(); 74 | } 75 | if (fileInfo.Length + logText.Length > _options.MaxFileSizeKb * 1000) 76 | _duplicateLogFileCount++; 77 | try 78 | { 79 | using (var writer = fileInfo.AppendText()) 80 | writer.Write(logText); 81 | } 82 | catch { } 83 | 84 | SendConsole(log); 85 | } 86 | 87 | private void SendConsole(BotLogMessage log) 88 | { 89 | if (!_options.UseColorOutput) 90 | { 91 | Console.WriteLine($"{log.GetTimestamp()} [{log.GetShortLogLevel()}] {log.SourceName}: {log.Content}"); 92 | return; 93 | } 94 | 95 | Console.Write(log.GetTimestamp(), Color.Gray); 96 | 97 | Color levelColor; 98 | switch (log.LogLevel) 99 | { 100 | case LogLevel.Trace: 101 | levelColor = Color.White; 102 | break; 103 | case LogLevel.Information: 104 | levelColor = Color.Green; 105 | break; 106 | case LogLevel.Warning: 107 | levelColor = Color.Yellow; 108 | break; 109 | case LogLevel.Debug: 110 | levelColor = Color.Purple; 111 | break; 112 | case LogLevel.Error: 113 | levelColor = Color.Red; 114 | break; 115 | case LogLevel.Critical: 116 | levelColor = Color.Red; 117 | break; 118 | default: 119 | levelColor = Color.White; 120 | break; 121 | } 122 | 123 | Colorful.Console.Write($" [{log.GetShortLogLevel()}] ", levelColor); 124 | Colorful.Console.Write(log.SourceName, Color.DarkGray); 125 | Colorful.Console.Write(": ", Color.DarkGray); 126 | Colorful.Console.Write(log.Content, Color.White); 127 | Console.WriteLine(); 128 | } 129 | 130 | public IDisposable BeginScope(TState state) 131 | { 132 | return null; 133 | } 134 | } 135 | } 136 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | ## Ignore Visual Studio temporary files, build results, and 2 | ## files generated by popular Visual Studio add-ons. 3 | ## 4 | ## Get latest from https://github.com/github/gitignore/blob/master/VisualStudio.gitignore 5 | 6 | # User-specific files 7 | *.suo 8 | *.user 9 | *.userosscache 10 | *.sln.docstates 11 | 12 | # User-specific files (MonoDevelop/Xamarin Studio) 13 | *.userprefs 14 | 15 | # Build results 16 | [Dd]ebug/ 17 | [Dd]ebugPublic/ 18 | [Rr]elease/ 19 | [Rr]eleases/ 20 | x64/ 21 | x86/ 22 | bld/ 23 | [Bb]in/ 24 | [Oo]bj/ 25 | [Ll]og/ 26 | 27 | # Visual Studio 2015/2017 cache/options directory 28 | .vs/ 29 | # Uncomment if you have tasks that create the project's static files in wwwroot 30 | #wwwroot/ 31 | 32 | # Visual Studio 2017 auto generated files 33 | Generated\ Files/ 34 | 35 | # MSTest test Results 36 | [Tt]est[Rr]esult*/ 37 | [Bb]uild[Ll]og.* 38 | 39 | # NUNIT 40 | *.VisualState.xml 41 | TestResult.xml 42 | 43 | # Build Results of an ATL Project 44 | [Dd]ebugPS/ 45 | [Rr]eleasePS/ 46 | dlldata.c 47 | 48 | # Benchmark Results 49 | BenchmarkDotNet.Artifacts/ 50 | 51 | # .NET Core 52 | project.lock.json 53 | project.fragment.lock.json 54 | artifacts/ 55 | **/Properties/launchSettings.json 56 | 57 | # StyleCop 58 | StyleCopReport.xml 59 | 60 | # Files built by Visual Studio 61 | *_i.c 62 | *_p.c 63 | *_i.h 64 | *.ilk 65 | *.meta 66 | *.obj 67 | *.iobj 68 | *.pch 69 | *.pdb 70 | *.ipdb 71 | *.pgc 72 | *.pgd 73 | *.rsp 74 | *.sbr 75 | *.tlb 76 | *.tli 77 | *.tlh 78 | *.tmp 79 | *.tmp_proj 80 | *.log 81 | *.vspscc 82 | *.vssscc 83 | .builds 84 | *.pidb 85 | *.svclog 86 | *.scc 87 | 88 | # Chutzpah Test files 89 | _Chutzpah* 90 | 91 | # Visual C++ cache files 92 | ipch/ 93 | *.aps 94 | *.ncb 95 | *.opendb 96 | *.opensdf 97 | *.sdf 98 | *.cachefile 99 | *.VC.db 100 | *.VC.VC.opendb 101 | 102 | # Visual Studio profiler 103 | *.psess 104 | *.vsp 105 | *.vspx 106 | *.sap 107 | 108 | # Visual Studio Trace Files 109 | *.e2e 110 | 111 | # TFS 2012 Local Workspace 112 | $tf/ 113 | 114 | # Guidance Automation Toolkit 115 | *.gpState 116 | 117 | # ReSharper is a .NET coding add-in 118 | _ReSharper*/ 119 | *.[Rr]e[Ss]harper 120 | *.DotSettings.user 121 | 122 | # JustCode is a .NET coding add-in 123 | .JustCode 124 | 125 | # TeamCity is a build add-in 126 | _TeamCity* 127 | 128 | # DotCover is a Code Coverage Tool 129 | *.dotCover 130 | 131 | # AxoCover is a Code Coverage Tool 132 | .axoCover/* 133 | !.axoCover/settings.json 134 | 135 | # Visual Studio code coverage results 136 | *.coverage 137 | *.coveragexml 138 | 139 | # NCrunch 140 | _NCrunch_* 141 | .*crunch*.local.xml 142 | nCrunchTemp_* 143 | 144 | # MightyMoose 145 | *.mm.* 146 | AutoTest.Net/ 147 | 148 | # Web workbench (sass) 149 | .sass-cache/ 150 | 151 | # Installshield output folder 152 | [Ee]xpress/ 153 | 154 | # DocProject is a documentation generator add-in 155 | DocProject/buildhelp/ 156 | DocProject/Help/*.HxT 157 | DocProject/Help/*.HxC 158 | DocProject/Help/*.hhc 159 | DocProject/Help/*.hhk 160 | DocProject/Help/*.hhp 161 | DocProject/Help/Html2 162 | DocProject/Help/html 163 | 164 | # Click-Once directory 165 | publish/ 166 | 167 | # Publish Web Output 168 | *.[Pp]ublish.xml 169 | *.azurePubxml 170 | # Note: Comment the next line if you want to checkin your web deploy settings, 171 | # but database connection strings (with potential passwords) will be unencrypted 172 | *.pubxml 173 | *.publishproj 174 | 175 | # Microsoft Azure Web App publish settings. Comment the next line if you want to 176 | # checkin your Azure Web App publish settings, but sensitive information contained 177 | # in these scripts will be unencrypted 178 | PublishScripts/ 179 | 180 | # NuGet Packages 181 | *.nupkg 182 | # The packages folder can be ignored because of Package Restore 183 | **/[Pp]ackages/* 184 | # except build/, which is used as an MSBuild target. 185 | !**/[Pp]ackages/build/ 186 | # Uncomment if necessary however generally it will be regenerated when needed 187 | #!**/[Pp]ackages/repositories.config 188 | # NuGet v3's project.json files produces more ignorable files 189 | *.nuget.props 190 | *.nuget.targets 191 | 192 | # Microsoft Azure Build Output 193 | csx/ 194 | *.build.csdef 195 | 196 | # Microsoft Azure Emulator 197 | ecf/ 198 | rcf/ 199 | 200 | # Windows Store app package directories and files 201 | AppPackages/ 202 | BundleArtifacts/ 203 | Package.StoreAssociation.xml 204 | _pkginfo.txt 205 | *.appx 206 | 207 | # Visual Studio cache files 208 | # files ending in .cache can be ignored 209 | *.[Cc]ache 210 | # but keep track of directories ending in .cache 211 | !*.[Cc]ache/ 212 | 213 | # Others 214 | ClientBin/ 215 | ~$* 216 | *~ 217 | *.dbmdl 218 | *.dbproj.schemaview 219 | *.jfm 220 | *.pfx 221 | *.publishsettings 222 | orleans.codegen.cs 223 | 224 | # Including strong name files can present a security risk 225 | # (https://github.com/github/gitignore/pull/2483#issue-259490424) 226 | #*.snk 227 | 228 | # Since there are multiple workflows, uncomment next line to ignore bower_components 229 | # (https://github.com/github/gitignore/pull/1529#issuecomment-104372622) 230 | #bower_components/ 231 | 232 | # RIA/Silverlight projects 233 | Generated_Code/ 234 | 235 | # Backup & report files from converting an old project file 236 | # to a newer Visual Studio version. Backup files are not needed, 237 | # because we have git ;-) 238 | _UpgradeReport_Files/ 239 | Backup*/ 240 | UpgradeLog*.XML 241 | UpgradeLog*.htm 242 | ServiceFabricBackup/ 243 | *.rptproj.bak 244 | 245 | # SQL Server files 246 | *.mdf 247 | *.ldf 248 | *.ndf 249 | 250 | # Business Intelligence projects 251 | *.rdl.data 252 | *.bim.layout 253 | *.bim_*.settings 254 | *.rptproj.rsuser 255 | 256 | # Microsoft Fakes 257 | FakesAssemblies/ 258 | 259 | # GhostDoc plugin setting file 260 | *.GhostDoc.xml 261 | 262 | # Node.js Tools for Visual Studio 263 | .ntvs_analysis.dat 264 | node_modules/ 265 | 266 | # Visual Studio 6 build log 267 | *.plg 268 | 269 | # Visual Studio 6 workspace options file 270 | *.opt 271 | 272 | # Visual Studio 6 auto-generated workspace file (contains which files were open etc.) 273 | *.vbw 274 | 275 | # Visual Studio LightSwitch build output 276 | **/*.HTMLClient/GeneratedArtifacts 277 | **/*.DesktopClient/GeneratedArtifacts 278 | **/*.DesktopClient/ModelManifest.xml 279 | **/*.Server/GeneratedArtifacts 280 | **/*.Server/ModelManifest.xml 281 | _Pvt_Extensions 282 | 283 | # Paket dependency manager 284 | .paket/paket.exe 285 | paket-files/ 286 | 287 | # FAKE - F# Make 288 | .fake/ 289 | 290 | # JetBrains Rider 291 | .idea/ 292 | *.sln.iml 293 | 294 | # CodeRush 295 | .cr/ 296 | 297 | # Python Tools for Visual Studio (PTVS) 298 | __pycache__/ 299 | *.pyc 300 | 301 | # Cake - Uncomment if you are using it 302 | # tools/** 303 | # !tools/packages.config 304 | 305 | # Tabs Studio 306 | *.tss 307 | 308 | # Telerik's JustMock configuration file 309 | *.jmconfig 310 | 311 | # BizTalk build output 312 | *.btp.cs 313 | *.btm.cs 314 | *.odx.cs 315 | *.xsd.cs 316 | 317 | # OpenCover UI analysis results 318 | OpenCover/ 319 | 320 | # Azure Stream Analytics local run output 321 | ASALocalRun/ 322 | 323 | # MSBuild Binary and Structured Log 324 | *.binlog 325 | 326 | # NVidia Nsight GPU debugger configuration file 327 | *.nvuser 328 | 329 | # MFractors (Xamarin productivity tool) working folder 330 | .mfractor/ 331 | --------------------------------------------------------------------------------