-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
7a978c5
commit cbdbe38
Showing
27 changed files
with
2,034 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
|
||
Microsoft Visual Studio Solution File, Format Version 12.00 | ||
# Visual Studio Version 16 | ||
VisualStudioVersion = 16.0.31205.134 | ||
MinimumVisualStudioVersion = 10.0.40219.1 | ||
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "ISurvivalBot", "ISurvivalBot\ISurvivalBot.csproj", "{B09CDD35-8951-43C7-93FA-53A5EE6EAF40}" | ||
EndProject | ||
Global | ||
GlobalSection(SolutionConfigurationPlatforms) = preSolution | ||
Debug|Any CPU = Debug|Any CPU | ||
Debug|x64 = Debug|x64 | ||
Release|Any CPU = Release|Any CPU | ||
Release|x64 = Release|x64 | ||
EndGlobalSection | ||
GlobalSection(ProjectConfigurationPlatforms) = postSolution | ||
{B09CDD35-8951-43C7-93FA-53A5EE6EAF40}.Debug|Any CPU.ActiveCfg = Debug|Any CPU | ||
{B09CDD35-8951-43C7-93FA-53A5EE6EAF40}.Debug|Any CPU.Build.0 = Debug|Any CPU | ||
{B09CDD35-8951-43C7-93FA-53A5EE6EAF40}.Debug|x64.ActiveCfg = Debug|x64 | ||
{B09CDD35-8951-43C7-93FA-53A5EE6EAF40}.Debug|x64.Build.0 = Debug|x64 | ||
{B09CDD35-8951-43C7-93FA-53A5EE6EAF40}.Release|Any CPU.ActiveCfg = Release|Any CPU | ||
{B09CDD35-8951-43C7-93FA-53A5EE6EAF40}.Release|Any CPU.Build.0 = Release|Any CPU | ||
{B09CDD35-8951-43C7-93FA-53A5EE6EAF40}.Release|x64.ActiveCfg = Release|x64 | ||
{B09CDD35-8951-43C7-93FA-53A5EE6EAF40}.Release|x64.Build.0 = Release|x64 | ||
EndGlobalSection | ||
GlobalSection(SolutionProperties) = preSolution | ||
HideSolutionNode = FALSE | ||
EndGlobalSection | ||
GlobalSection(ExtensibilityGlobals) = postSolution | ||
SolutionGuid = {A81E7C66-5FD0-4B8C-A23C-3F518540F05D} | ||
EndGlobalSection | ||
EndGlobal |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,88 @@ | ||
using Discord; | ||
using Discord.Commands; | ||
using ISurvivalBot.Services; | ||
using ISurvivalBot.Utils; | ||
using System; | ||
using System.Collections.Generic; | ||
using System.Linq; | ||
using System.Text; | ||
using System.Threading; | ||
using System.Threading.Tasks; | ||
|
||
namespace ISurvivalBot.Commands | ||
{ | ||
public class AudioModule : ModuleBase<ICommandContext> | ||
{ | ||
// Scroll down further for the AudioService. | ||
// Like, way down | ||
private readonly AudioService _service; | ||
|
||
// Remember to add an instance of the AudioService | ||
// to your IServiceCollection when you initialize your bot | ||
public AudioModule(AudioService service) | ||
{ | ||
_service = service; | ||
} | ||
|
||
// You *MUST* mark these commands with 'RunMode.Async' | ||
// otherwise the bot will not respond until the Task times out. | ||
[Command("joins", RunMode = RunMode.Async)] | ||
[RequireContext(ContextType.Guild, ErrorMessage = "This command is only possible via a public channel.")] | ||
//[RequireBotPermission(ChannelPermission.Speak, ErrorMessage = "I don't have permissions to join a voice chat")] | ||
public async Task JoinCmd() | ||
{ | ||
var result = await _service.JoinAudio(Context.Guild, (Context.User as IVoiceState).VoiceChannel); | ||
await Context.Message.AddReactionAsync(result == AudioServiceStatus.Succes ? CommonEmoij.OK : CommonEmoij.NOK); | ||
|
||
/*Emoji custom = null; | ||
foreach(var emoij in Context.Guild.Emotes) | ||
{ | ||
Console.WriteLine($"Name: {emoij.Name} Url: {emoij.Url}, Id: {emoij.Id}"); | ||
}*/ | ||
await Context.Message.AddReactionAsync(CommonEmoij.BEREND); | ||
} | ||
|
||
// Remember to add preconditions to your commands, | ||
// this is merely the minimal amount necessary. | ||
// Adding more commands of your own is also encouraged. | ||
[Command("leaves", RunMode = RunMode.Async)] | ||
[RequireContext(ContextType.Guild, ErrorMessage = "This command is only possible via a public channel.")] | ||
public async Task LeaveCmd() | ||
{ | ||
var result = await _service.LeaveAudio(Context.Guild, (Context.User as IVoiceState).VoiceChannel); | ||
await Context.Message.AddReactionAsync(result == AudioServiceStatus.Succes ? CommonEmoij.OK : CommonEmoij.NOK); | ||
} | ||
|
||
[Command("plays", RunMode = RunMode.Async)] | ||
[RequireContext(ContextType.Guild, ErrorMessage = "This command is only possible via a public channel.")] | ||
public async Task PlayCmd([Remainder] string song) | ||
{ | ||
var result = await _service.PlaySound(Context.Guild, Context.Channel, (Context.User as IVoiceState).VoiceChannel, song); | ||
await Context.Message.AddReactionAsync(result == AudioServiceStatus.Succes ? CommonEmoij.OK : CommonEmoij.NOK); | ||
} | ||
|
||
[Command("stops", RunMode = RunMode.Async)] | ||
[RequireContext(ContextType.Guild, ErrorMessage = "This command is only possible via a public channel.")] | ||
public async Task StopCmd() | ||
{ | ||
var result = await _service.StopPlaying(Context.Guild, (Context.User as IVoiceState).VoiceChannel); | ||
await Context.Message.AddReactionAsync(result == AudioServiceStatus.Succes ? CommonEmoij.OK : CommonEmoij.NOK); | ||
} | ||
|
||
[Command("say", RunMode = RunMode.Async)] | ||
[RequireContext(ContextType.Guild, ErrorMessage = "This command is only possible via a public channel.")] | ||
public async Task SayText([Remainder] string text) | ||
{ | ||
var result = await _service.SayText(Context.Guild, (Context.User as IVoiceState).VoiceChannel, Context.Channel, text); | ||
await Context.Message.AddReactionAsync(result == AudioServiceStatus.Succes ? CommonEmoij.OK : CommonEmoij.NOK); | ||
} | ||
|
||
[Command("listaudio", RunMode = RunMode.Async)] | ||
public async Task ListAudioFiles() | ||
{ | ||
var result = await _service.ListAudio(Context); | ||
await Context.Message.AddReactionAsync(result == AudioServiceStatus.Succes ? CommonEmoij.OK : CommonEmoij.NOK); | ||
} | ||
|
||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,108 @@ | ||
using Discord; | ||
using Discord.Commands; | ||
using System; | ||
using System.Collections.Generic; | ||
using System.Linq; | ||
using System.Text; | ||
using System.Threading.Tasks; | ||
|
||
namespace ISurvivalBot.Commands | ||
{ | ||
public class JamaarCommand : ModuleBase<SocketCommandContext> | ||
{ | ||
|
||
|
||
public static Random random = new Random(); | ||
public List<String> cards = new List<string>() | ||
{ | ||
"Nee, het zal je niet lukken", | ||
"Ja, maar het zal niet makkelijk gaan", | ||
"Ja, maar wees voorbereid op tegenslag", | ||
"Ja, waag het", | ||
"Ja, maar hou zelf het initiatief", | ||
"Ja, het is het begin van een groots avontuur", | ||
"Ja, maar alleen als je je kunt openstellen om te ontvangen", | ||
"Nee, het zal je ongelukkig maken", | ||
"Ja, maar blijf luisteren naar je lichaam", | ||
"Nee, het is de moeite niet waard", | ||
"Nee, je zal van jezelf vervreemden", | ||
"Nee, het is niet je diepste verlangen", | ||
"Ja, vecht ervoor", | ||
"Ja, het zal je genezen", | ||
"Nee, het gaat ten koste van je gezondheid", | ||
"Ja, maar stop met zeuren en piekeren", | ||
"Ja, zelfs als alle voortekenen ongunstig zijn", | ||
"Ja, maar doe het tactvol", | ||
"Ja, het zal je diepgaand veranderen", | ||
"Ja, maar alleen als je je kunt verweren", | ||
"Ja, maar je moet bereid zijn het risico echt te nemen", | ||
"Nee, en trek je terug uit deze situatie", | ||
"Nee, je doet het om je te conformeren", | ||
"Nee, je motitieven zij niet zuiver", | ||
"Nee, het is ondoordracht", | ||
"Nee, het zal in alle opzichten tegenvallen", | ||
"Nee, vergeet het", | ||
"Nee en stop met zoeken naar wat je eigenlijk al hebt", | ||
"Nee, het past niet bij je", | ||
"Ja, maar vergeet niet dat het om de weg gaat, niet om de bestemming", | ||
"Nee, het is een vlucht", | ||
"Nee, wacht op een betere kans", | ||
"Ja, het betekent een nieuwe en frisse start", | ||
"Ja, maar alleen als je niet in goed en kwaad denkt", | ||
"Ja, aanvaard het als een kostbaar geschenk", | ||
"Ja, beslist!", | ||
"Nee, het zal je teveel energie kosten", | ||
"Ja en het zal het beste in jezelf naar boven halen", | ||
"Nee, het zal je in gevaar brengen", | ||
"Ja, maar verbrand je schepen achter je niet", | ||
"Ja, de einige die twijfelt ben jij", | ||
"Ja, je opent een geweldige energiebron", | ||
"Ja, het zal zelfs makkelijker gaan dan je denkt", | ||
"Ja en geniet er van", | ||
"Ja, maar doe het met een glimlach", | ||
"Ja, het is tijd voor een verandering", | ||
"Ja, je bent er klaar voor", | ||
"Ja, het zal je rust geven", | ||
"Ja, het mag", | ||
"Ja, dit is een once-in-a-lifetime mogelijkheid", | ||
"Ja, maar blijf je hart volgen", | ||
"Ja, maar accepteer dat je leven grondig zal veranderen", | ||
"Nee, dit is niet het moment", | ||
"Ja, maar let op de details", | ||
"Ja, het is precies de goede stap op precies het goede moment", | ||
"Ja, maar alleen als je geduld hebt", | ||
"Ja, je bent het waard", | ||
"Ja, maar met mededogen", | ||
"Ja, maar alleen als het open & eerlijk kan", | ||
"Nee, je verdient beter", | ||
"Nee, doe eerst iets anders wat je op dit moment liever wilt", | ||
"Ja, maar alleen als je het conflict niet uit de weg gaat", | ||
"Nee, het is te hoog gegrepen", | ||
"Nee, het is een illusie", | ||
"Ja, maar alleen als je echt op succes bent voorbereid", | ||
"Ja, maar loop niet te hard van stapel", | ||
"Ja, dit is het moment", | ||
"Ja en laat het los", | ||
"Ja, maar accepteer onoplosbare conflicten", | ||
"Ja, je zal er veel van leren", | ||
"Ja, maar alleen als je je eigenbelang opzij kunt zetten", | ||
"Ja, je bloed zal er sneller van stromen", | ||
"Ja, maar houd afstand", | ||
"Nee, je zal er onder bezwijken", | ||
"Nee, zelfs als alle voortekenen gunstig zijn", | ||
"Ja, het zal je gelukkig maken", | ||
"Nee, je zal je vrijheid verliezen", | ||
"Ja, maar vraag hulp" | ||
|
||
}; | ||
|
||
|
||
|
||
[Command("jamaar")] | ||
public async Task Jamaar([Remainder] string text) | ||
{ | ||
int answer = random.Next(this.cards.Count); | ||
await Context.Message.ReplyAsync(this.cards[answer]); | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,63 @@ | ||
using Discord; | ||
using Discord.Commands; | ||
using ISurvivalBot.Services; | ||
using ISurvivalBot.Utils; | ||
using System; | ||
using System.Collections.Generic; | ||
using System.Linq; | ||
using System.Text; | ||
using System.Threading.Tasks; | ||
|
||
namespace ISurvivalBot.Commands | ||
{ | ||
|
||
|
||
[Group("maintenance")] | ||
public class MaintenanceCommand : ModuleBase<SocketCommandContext> | ||
{ | ||
|
||
private readonly MaintenanceService _maintenanceService; | ||
private readonly UserService _userService; | ||
|
||
public MaintenanceCommand(MaintenanceService maintenanceservice, UserService userService) | ||
{ | ||
this._maintenanceService = maintenanceservice; | ||
this._userService = userService; | ||
} | ||
|
||
|
||
[Command("update", RunMode = RunMode.Async)] | ||
public async Task UpdateCommand() | ||
{ | ||
await _maintenanceService.UpdateUser((long)Context.User.Id, Context.User.Username); | ||
} | ||
|
||
|
||
[Command("setadmin", RunMode = RunMode.Async)] | ||
public async Task CreateAdminCommand(string username, bool admin) | ||
{ | ||
bool isRequesterAdmin = await _userService.IsAdmin(Context.Message.Author.Username); | ||
if (!isRequesterAdmin) | ||
await Context.Message.AddReactionAsync(CommonEmoij.NOK); | ||
|
||
var mentionUser = Context.Message.MentionedUsers.FirstOrDefault(); | ||
if (mentionUser != null) | ||
username = mentionUser.Username; | ||
|
||
var result = await _userService.SetAdminStatus(username, admin); | ||
await Context.Message.AddReactionAsync(result ? CommonEmoij.OK : CommonEmoij.NOK); | ||
} | ||
|
||
|
||
[Command("isadmin", RunMode = RunMode.Async)] | ||
public async Task IsAdminCommand(string username) | ||
{ | ||
var mentionUser = Context.Message.MentionedUsers.FirstOrDefault(); | ||
bool result = await _userService.IsAdmin(mentionUser == null ? username : mentionUser.Username); | ||
await Context.Message.AddReactionAsync(result ? CommonEmoij.OK : CommonEmoij.NOK); | ||
|
||
} | ||
|
||
|
||
} | ||
} |
Oops, something went wrong.