Skip to content

Commit

Permalink
Couple small updates and additions to the readme
Browse files Browse the repository at this point in the history
  • Loading branch information
Darkside138 committed Apr 1, 2023
1 parent c3a498c commit ae96083
Show file tree
Hide file tree
Showing 5 changed files with 11 additions and 8 deletions.
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,8 @@ This will walk you through the process of getting your bot up and running.
To fix the issue of being stuck on "Connecting to websocket":
Login to your Discord Developer Portal and enable Privileged Intents for your bot. Go to https://discord.com/developers/applications select your bot, click Bot on the left, and then enable both of the sliders under Privileged Gateway Intents.

You will also need to configure "Intents". Follow this [link](https://jda.wiki/using-jda/troubleshooting/#im-getting-closecode4014-disallowed-intents) for instuctions on enabling Intents for your bot. Make sure Presence Intent, Server Members Intent, and Message Content Intent are all enabled.

## Donations
If you'd like to buy me a beer for my efforts, it's always appreciated. You can do so [here](https://www.paypal.me/DFurrer)

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
import org.springframework.web.bind.annotation.RestController;

import javax.inject.Inject;
import java.util.List;

@RestController
@RequestMapping("/api/users")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,9 +37,9 @@ public LeaveSoundBoardListener(SoundPlayer bot, UserService userService, SoundSe
@Override
public void onGuildVoiceUpdate(GuildVoiceUpdateEvent event) {
if (event.getChannelJoined() == null && event.getChannelLeft() != null) {
String userDisconnected = event.getMember().getEffectiveName();
String userDisconnectedId = event.getMember().getId();
User user = userService.findOneByIdOrUsernameIgnoreCase(userDisconnectedId, userDisconnected);
String userNameDisconnected = event.getMember().getEffectiveName();
String userIdDisconnected = event.getMember().getId();
User user = userService.findOneByIdOrUsernameIgnoreCase(userIdDisconnected, userNameDisconnected);
if (user != null) {
if (!StringUtils.isNullOrEmpty(user.getLeaveSound())) {
bot.playFileInChannel(user.getLeaveSound(), event.getChannelLeft());
Expand All @@ -51,10 +51,10 @@ public void onGuildVoiceUpdate(GuildVoiceUpdateEvent event) {
try {
bot.playFileInChannel(leaveFile.getSoundFileId(), event.getChannelLeft());
} catch (Exception e) {
LOG.error("Could not play file for disconnection of {}", userDisconnected);
LOG.error("Could not play file for disconnection of {}", userNameDisconnected);
}
} else {
LOG.debug("Could not find disconnection sound for {}, so ignoring disconnection event.", userDisconnected);
LOG.debug("Could not find disconnection sound for {}, so ignoring disconnection event.", userNameDisconnected);
}
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ public interface UserService {

Iterable<User> saveAll(List<User> users);

User findOneByIdOrUsernameIgnoreCase(String userNameOrId, String userNameOrId1);
User findOneByIdOrUsernameIgnoreCase(String userNamId, String userName);

User save(User user);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,8 @@ public Iterable<User> saveAll(List<User> users) {
}

@Override
public User findOneByIdOrUsernameIgnoreCase(String userNameOrId, String userNameOrId1) {
return userRepository.findOneByIdOrUsernameIgnoreCase(userNameOrId, userNameOrId1);
public User findOneByIdOrUsernameIgnoreCase(String userId, String userName) {
return userRepository.findOneByIdOrUsernameIgnoreCase(userId, userName);
}

@Override
Expand Down

0 comments on commit ae96083

Please sign in to comment.