Skip to content

Commit

Permalink
Fixed auto thing
Browse files Browse the repository at this point in the history
  • Loading branch information
PSMGoossens committed Dec 21, 2021
1 parent 0955f6c commit 8564da1
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 23 deletions.
11 changes: 4 additions & 7 deletions ISurvivalBot/Services/AudioService.cs
Original file line number Diff line number Diff line change
Expand Up @@ -112,19 +112,16 @@ public async Task<AudioServiceStatus> LeaveAudio(IGuild guild, IVoiceChannel voi
public async Task<AudioServiceStatus> PlaySound(IGuild guild, IMessageChannel channel, IVoiceChannel voiceChannel, string path)
{
AudioServiceState audioState = await getAudioState(guild);
if (audioState == null || audioState.IsPlaying)
{
Console.WriteLine("Is already playing");
if (audioState == null || audioState.IsPlaying) {
_logger.LogInformation("Is already playing");
return AudioServiceStatus.Failure;
}
if (voiceChannel == null || voiceChannel.Guild.Id != guild.Id)
{
if (voiceChannel == null || voiceChannel.Guild.Id != guild.Id) {
return AudioServiceStatus.Failure;
}

// Your task: Get a full path to the file if the value of 'path' is only a filename.
if (!File.Exists(path))
{
if (!File.Exists(path)) {
await channel.SendMessageAsync("File does not exist.");
_logger.LogInformation("Not connected");
return AudioServiceStatus.Failure;
Expand Down
6 changes: 2 additions & 4 deletions ISurvivalBot/Services/UserService.cs
Original file line number Diff line number Diff line change
Expand Up @@ -26,10 +26,8 @@ public UserService(BotContext botContext, DiscordSocketClient discordSocketClien
public async Task UpdateUser(long userId, string username)
{
var user = await _botContext.Users.AsAsyncEnumerable().Where(u => u.DiscordId == userId).FirstOrDefaultAsync();
if (user == null)
{
User u = new User
{
if (user == null) {
var u = new User {
DiscordId = userId,
CurrentUsername = username,
};
Expand Down
24 changes: 12 additions & 12 deletions ISurvivalBot/Utils/CommonEmoij.cs
Original file line number Diff line number Diff line change
Expand Up @@ -9,18 +9,18 @@ namespace ISurvivalBot.Utils
{
public static class CommonEmoij
{
public static var OK = new Emoji("✅");
public static var NOK = new Emoji("❌");
public static Emoji OK = new Emoji("✅");
public static Emoji NOK = new Emoji("❌");

public static var BEREND = Emote.Parse("<:berend:821110556667936838>");
public static var KING = Emote.Parse("<:king:821350847211896903>");
public static var AUTISM = Emote.Parse("<:autism:828935267976216577>");
public static var PANDA_CRY = Emote.Parse("<:panda_cry:829681153317011487>");
public static var PANDA_ANGRY = Emote.Parse("<:panda_angry:829681335601594389>");
public static var PANDA_SLEEP = Emote.Parse("<:panda_sleep:829681500029976576>");
public static var NEGATIVE = Emote.Parse("<:negative:829681658583842817>");
public static var OBEY = Emote.Parse("<:obey:829682075601862676>");
public static var SARCASM = Emote.Parse("<:sarcasm:829682227621003264>");
public static var LAME = Emote.Parse("<:lame:828935234045083680>");
public static Emote BEREND = Emote.Parse("<:berend:821110556667936838>");
public static Emote KING = Emote.Parse("<:king:821350847211896903>");
public static Emote AUTISM = Emote.Parse("<:autism:828935267976216577>");
public static Emote PANDA_CRY = Emote.Parse("<:panda_cry:829681153317011487>");
public static Emote PANDA_ANGRY = Emote.Parse("<:panda_angry:829681335601594389>");
public static Emote PANDA_SLEEP = Emote.Parse("<:panda_sleep:829681500029976576>");
public static Emote NEGATIVE = Emote.Parse("<:negative:829681658583842817>");
public static Emote OBEY = Emote.Parse("<:obey:829682075601862676>");
public static Emote SARCASM = Emote.Parse("<:sarcasm:829682227621003264>");
public static Emote LAME = Emote.Parse("<:lame:828935234045083680>");
}
}

0 comments on commit 8564da1

Please sign in to comment.