diff options
Diffstat (limited to 'DiscoBot')
-rw-r--r-- | DiscoBot/App.config | 6 | ||||
-rw-r--r-- | DiscoBot/Audio/Soundeffects.cs | 10 | ||||
-rw-r--r-- | DiscoBot/Audio/Voice.cs | 6 | ||||
-rw-r--r-- | DiscoBot/Characters/Character.cs | 18 | ||||
-rw-r--r-- | DiscoBot/Characters/ICharacter.cs | 2 | ||||
-rw-r--r-- | DiscoBot/Commands/MiscCommands.cs | 8 | ||||
-rw-r--r-- | DiscoBot/DSA.cs | 3 | ||||
-rw-r--r-- | DiscoBot/DiscoBot.csproj | 6 | ||||
-rw-r--r-- | DiscoBot/Program.cs | 1 |
9 files changed, 43 insertions, 17 deletions
diff --git a/DiscoBot/App.config b/DiscoBot/App.config index d08a333..1ec9ae3 100644 --- a/DiscoBot/App.config +++ b/DiscoBot/App.config @@ -1,7 +1,7 @@ <?xml version="1.0" encoding="utf-8"?> <configuration> <configSections> - <sectionGroup name="userSettings" type="System.Configuration.UserSettingsGroup, System, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" > + <sectionGroup name="userSettings" type="System.Configuration.UserSettingsGroup, System, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"> <section name="DiscoBot.Properties.Settings" type="System.Configuration.ClientSettingsSection, System, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" allowExeDefinition="MachineToLocalUser" requirePermission="false" /> </sectionGroup> </configSections> @@ -22,6 +22,10 @@ <assemblyIdentity name="System.Collections.Immutable" publicKeyToken="b03f5f7f11d50a3a" culture="neutral" /> <bindingRedirect oldVersion="0.0.0.0-1.2.2.0" newVersion="1.2.2.0" /> </dependentAssembly> + <dependentAssembly> + <assemblyIdentity name="System.Net.Http" publicKeyToken="b03f5f7f11d50a3a" culture="neutral" /> + <bindingRedirect oldVersion="0.0.0.0-4.2.0.0" newVersion="4.2.0.0" /> + </dependentAssembly> </assemblyBinding> </runtime> <userSettings> diff --git a/DiscoBot/Audio/Soundeffects.cs b/DiscoBot/Audio/Soundeffects.cs index 555a79c..485be28 100644 --- a/DiscoBot/Audio/Soundeffects.cs +++ b/DiscoBot/Audio/Soundeffects.cs @@ -13,7 +13,8 @@ Monterkill, Finish, Wrong, - Magic + Magic, + Stupid } public static class SoundEffects @@ -40,9 +41,11 @@ case Sound.Nooo: url = "https://www.myinstants.com/media/sounds/nooo.swf.mp3"; break; + case Sound.Stupid: + url = "https://www.myinstants.com/media/sounds/stupid_dum_03.mp3"; + vol = 10; + break; case Sound.Wrong: - // url = "https://www.myinstants.com/media/sounds/stupid_dum_03.mp3"; - // vol = 10; url = "https://www.myinstants.com/media/sounds/wrong-answer-sound-effect.mp3"; vol = 50; break; @@ -52,6 +55,7 @@ { // await Dsa.Service.SendAudioAsync(url, vol); await Voice.SendAsync(url, vol); + return; } throw new Exception("Ton Existiert nicht"); diff --git a/DiscoBot/Audio/Voice.cs b/DiscoBot/Audio/Voice.cs index d1f7915..7a7da5c 100644 --- a/DiscoBot/Audio/Voice.cs +++ b/DiscoBot/Audio/Voice.cs @@ -12,6 +12,7 @@ using Discord; using Discord.Audio; using Discord.Commands; + using Discord.WebSocket; public class Voice : ModuleBase { @@ -61,6 +62,11 @@ [Command("leave", RunMode = RunMode.Async)] public async Task LeaveChannelAsync(IVoiceChannel channel = null) { + if (!((SocketGuildUser)this.Context.User).Roles.ToList().Exists(v => v.Name.Equals("Meister"))) + { + await this.ReplyAsync("```xl\n Keine ausreichenden Berechtigunen\n```"); + return; + } if (Client != null) { var wait = SoundEffects.Play(Sound.Nooo); diff --git a/DiscoBot/Characters/Character.cs b/DiscoBot/Characters/Character.cs index 9d84fa8..c092154 100644 --- a/DiscoBot/Characters/Character.cs +++ b/DiscoBot/Characters/Character.cs @@ -21,12 +21,13 @@ this.PropTable.Add("GE", "Gewandtheit"); this.PropTable.Add("KO", "Konstitution"); this.PropTable.Add("KK", "Körperkraft"); + + this.Post_process(); // calculate derived values } public Character(string path) : this() { this.Load(path); // load - this.Post_process(); // calculate derived values } public Character(Character c, string name, int stDv = 2) : this() @@ -69,8 +70,6 @@ public string TestTalent(string talent, int erschwernis = 0) // Talentprobe { - try - { var output = new StringBuilder(); var sc = new SpellCorrect(); var tTalent = this.Talente.OrderBy(x => sc.Compare(talent, x.Name)).First(); @@ -138,19 +137,15 @@ tap = (tap == 0) ? 1 : tap; - if(tap < 0) + if (tap < 0) { SoundEffects.Play(Sound.Wrong).Wait(); } + output.AppendFormat(" tap: {0,2}", tap); return output.ToString(); // return output - } - catch (Exception) - { - throw new Exception( - $"{talent} nicht vorhanden! Besitzt {this.Name} {talent} nicht? \n Oder ist {talent} falsch geschrieben?"); - } + } public string TestEigenschaft(string eigenschaft, int erschwernis = 0) @@ -247,8 +242,7 @@ var KO__Wert = this.Eigenschaften.First(s => s.Key.Contains("Konst")).Value; this.Lebenspunkte = LE_Wert + (int)(KO__Wert + (KK_Wert/2.0) + 0.5); - - + } private void Load(string path) diff --git a/DiscoBot/Characters/ICharacter.cs b/DiscoBot/Characters/ICharacter.cs index 62bc1a5..e8bc653 100644 --- a/DiscoBot/Characters/ICharacter.cs +++ b/DiscoBot/Characters/ICharacter.cs @@ -10,7 +10,7 @@ //int Astralpunkte { get; set; } - //int Karmalpunkte { get; set; } + //int Karmapunkte { get; set; } string TestTalent(string talent, int erschwernis = 0); diff --git a/DiscoBot/Commands/MiscCommands.cs b/DiscoBot/Commands/MiscCommands.cs index c067507..d60e25d 100644 --- a/DiscoBot/Commands/MiscCommands.cs +++ b/DiscoBot/Commands/MiscCommands.cs @@ -28,5 +28,13 @@ { return this.ReplyAsync(echo); } + + [Command("spot"), Summary("Echos a message.")] + [Alias("spotify")] + public Task SpotiAsync([Remainder, Summary("The text to echo")] string echo) + { + var test = new Spotify.WebClient(); + return this.ReplyAsync(string.Join("\n", test.GetPlaylist(""))); + } } } diff --git a/DiscoBot/DSA.cs b/DiscoBot/DSA.cs index 609fef7..121be08 100644 --- a/DiscoBot/DSA.cs +++ b/DiscoBot/DSA.cs @@ -29,6 +29,9 @@ Relation.Add("DSA Bot", "Morla"); // "Felis Exodus Schattenwald"); Relation.Add("Morla", "Morla"); Relation.Add("Rhoktar", "Rhoktar4"); + Relation.Add("MagicBro5", "Krenko"); + Relation.Add("Nicolas", "Hartmut Reiher"); + Relation.Add("TrueKuehli", "Ledur Torfinson"); // relation.Add("Papo","Gwendelson"); Relation.Add("Papo", "Pump aus der Gosse"); diff --git a/DiscoBot/DiscoBot.csproj b/DiscoBot/DiscoBot.csproj index b6635ea..37ddc5c 100644 --- a/DiscoBot/DiscoBot.csproj +++ b/DiscoBot/DiscoBot.csproj @@ -178,6 +178,12 @@ <LastGenOutput>Settings.Designer.cs</LastGenOutput> </None> </ItemGroup> + <ItemGroup> + <ProjectReference Include="..\..\Spotify\Spotify.csproj"> + <Project>{aef1f22a-7209-4939-b375-3f94b82f6f8a}</Project> + <Name>Spotify</Name> + </ProjectReference> + </ItemGroup> <Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" /> <Import Project="..\packages\Baseclass.Contrib.Nuget.Output.2.4.1\build\net40\Baseclass.Contrib.Nuget.Output.targets" Condition="Exists('..\packages\Baseclass.Contrib.Nuget.Output.2.4.1\build\net40\Baseclass.Contrib.Nuget.Output.targets')" /> <Target Name="EnsureNuGetPackageBuildImports" BeforeTargets="PrepareForBuild"> diff --git a/DiscoBot/Program.cs b/DiscoBot/Program.cs index e3ea828..96bbd09 100644 --- a/DiscoBot/Program.cs +++ b/DiscoBot/Program.cs @@ -24,6 +24,7 @@ namespace DiscoBot public async Task StartAsync() { Dsa.Startup(); + this.client = new DiscordSocketClient(); this.commands = new CommandService(); |