Giter Site home page Giter Site logo

java-discord's Introduction

discord-bot

License: MIT

version 0.1.4

This bot is deployed in a separate container and connected to your platform ID. This allows you to broadcast an audio stream, and it is also possible to store commands in a separate database based on mongoDB. Spring Session provides an API and implementations for managing a user’s session information.

Spring Session makes it trivial to support clustered sessions without being tied to an application container specific solution. It also provides transparent integration with:

HttpSession - allows replacing the HttpSession in an application container (i.e. Tomcat) neutral way, with support for providing session IDs in headers to work with RESTful APIs

WebSocket - provides the ability to keep the HttpSession alive when receiving WebSocket messages

WebSession - allows replacing the Spring WebFlux’s WebSession in an application container neutral way

The main variables

DISCORD_BOT_KEY == The discord API key

BOT_USER_ID == The User ID account

POSTGRES_LOCATION == The URL of postgres №№ I should do a code review and add updates to the dependencies, so will the application architecture be added here TODO recreate documentation

java-discord's People

Contributors

andreichenko avatar dr-frei avatar

Stargazers

 avatar

Watchers

 avatar  avatar

java-discord's Issues

check build

Task :compileJava
Task :compileJava FAILED
FAILURE: Build failed with an exception.

  • What went wrong:
    Execution failed for task ':compileJava'.

invalid source release: 17

  • Try:

Run with --stacktrace option to get the stack trace.
Run with --info or --debug option to get more log output.
Run with --scan to get full insights.

All tests failed

16:52:29 symbol: class Alias
16:52:29 location: class AliasListCommandTest
16:52:29 /var/lib/jenkins/workspace/ture_add-changes-to-architecture/src/test/java/bot/commands/alias/AliasListCommandTest.java:126: error: cannot find symbol
16:52:29 Alias mockAlias = mock(Alias.class);
16:52:29 ^

gradle issue

A problem occurred evaluating root project 'discord-bot'.
31

Could not find method compile() for arguments [net.dv8tion:JDA:+] on object of type org.gradle.api.internal.artifacts.dsl.dependencies.DefaultDependencyHandler.

Errors in code compilation

We should do a refactoring and restart the build again. In addition, it is worth making changes to the pipeline relatively isolated docker environment

api tests failed

/home/runner/work/Java-discord/Java-discord/src/test/testUtils/SeekCommandTestMocker.java:11: error: package org.mockito does not exist
25

Task :compileJava
26
import org.mockito.ArgumentCaptor;
27
^
28
/home/runner/work/Java-discord/Java-discord/src/test/testUtils/SeekCommandTestMocker.java:13: error: package org.mockito does not exist
29
import static org.mockito.Mockito.*;
30
^
31
/home/runner/work/Java-discord/Java-discord/src/test/testUtils/SeekCommandTestMocker.java:17: error: cannot find symbol
32
public static CommandEvent createMockCommandEventWithTime(ArgumentCaptor stringArgumentCaptor,
33
^
34
symbol: class ArgumentCaptor
35
location: class SeekCommandTestMocker

not working

import bot.commands.audio.utils.TrackScheduler;
26

Task :compileJava
27
^
28
symbol: class TrackScheduler
29
location: package bot.commands.audio.utils
30
/home/runner/work/Java-discord/Java-discord/src/main/java/bot/api/controller/CommandTriggerController.java:34: error: cannot find symbol
31
Command command = botService.getCommandWithName(triggerCommandDto.getCommandName());
32
^
33
symbol: method getCommandWithName(String)
34
location: variable botService of type BotService #87

class OptionsCommand

/home/runner/work/Java-discord/Java-discord/src/main/java/bot/commands/utils/OptionsCommand.java:49: error: cannot find symbol
26
event.getChannel().sendMessage(String.format("%s has been %s.", optionName, disabled_enabled_text)).queue();
27
^
28
symbol: variable disabled_enabled_text
29
location: class OptionsCommand
30
Note: Some input files use or override a deprecated API.
31
Note: Recompile with -Xlint:deprecation for details.

build issue

/home/runner/work/Java-discord/Java-discord/src/main/java/bot/controllers/SendCommandController.java:35: error: cannot find symbol (https://github.com/Andreichenko/Java-discord/runs/6426016907?check_suite_focus=true#step:5:46) Command command = botService.getCommandFromName(commandName); (https://github.com/Andreichenko/Java-discord/runs/6426016907?check_suite_focus=true#step:5:47) ^ (https://github.com/Andreichenko/Java-discord/runs/6426016907?check_suite_focus=true#step:5:48) symbol: method getCommandFromName(String) (https://github.com/Andreichenko/Java-discord/runs/6426016907?check_suite_focus=true#step:5:49) location: variable botService of type BotService (https://github.com/Andreichenko/Java-discord/runs/6426016907?check_suite_focus=true#step:5:50) /home/runner/work/Java-discord/Java-discord/src/main/java/bot/commands/audio/PlayTopCommand.java:23: error: cannot find symbol (https://github.com/Andreichenko/Java-discord/runs/6426016907?check_suite_focus=true#step:5:51) VoiceChannelUtils.SearchAndPlaySong(event.getJDA(), event.getArgs(), event.getGuild().getId(), event.getChannel().getId(), event.getMember().getId(), true, playerManager); (https://github.com/Andreichenko/Java-discord/runs/6426016907?check_suite_focus=true#step:5:52) ^ (https://github.com/Andreichenko/Java-discord/runs/6426016907?check_suite_focus=true#step:5:53) symbol: method SearchAndPlaySong(JDA,String,String,String,String,boolean,AudioPlayerManager) (https://github.com/Andreichenko/Java-discord/runs/6426016907?check_suite_focus=true#step:5:54) location: class VoiceChannelUtils

The method does not return a value

/home/runner/work/Java-discord/Java-discord/src/test/java/bot/commands/audio/SeekCommandTest.java:92: error: cannot find symbol
93
assertEquals(TextChannelResponses.SEEK_COMMAND_FORMAT, stringArgumentCaptor.getValue());
94
^
95
symbol: variable TextChannelResponses
96
location: class SeekCommandTest
97
/home/runner/work/Java-discord/Java-discord/src/test/java/bot/commands/audio/SeekCommandTest.java:104: error: incompatible types: com.jagrosh.jdautilities.command.CommandEvent cannot be converted to bot.utils.commands.CommandEvent
98
seekCommand.execute(mockCommandEvent);
99
^
100
/home/runner/work/Java-discord/Java-discord/src/test/java/bot/commands/audio/SeekCommandTest.java:105: error: cannot find symbol
101
assertEquals(TextChannelResponses.SEEK_POINT_LONGER_THAN_SONG, stringArgumentCaptor.getValue());
102
^
103
symbol: variable TextChannelResponses
104
location: class SeekCommandTest
105
/home/runner/work/Java-discord/Java-discord/src/test/java/bot/commands/audio/SeekCommandTest.java:119: error: incompatible types: com.jagrosh.jdautilities.command.CommandEvent cannot be converted to bot.utils.commands.CommandEvent
106
seekCommand.execute(mockCommandEvent);
107
^
108
/home/runner/work/Java-discord/Java-discord/src/test/java/bot/commands/audio/SeekCommandTest.java:121: error: cannot find symbol
109
assertEquals(TextChannelResponses.SEEK_POINT_LONGER_THAN_SONG, stringArgumentCaptor.getValue());
110
^
111
symbol: variable TextChannelResponses
112
location: class SeekCommandTest
113
/home/runner/work/Java-discord/Java-discord/src/test/java/bot/commands/audio/SeekCommandTest.java:132: error: incompatible types: com.jagrosh.jdautilities.command.CommandEvent cannot be converted to bot.utils.commands.CommandEvent
114
seekCommand.execute(mockCommandEvent);
115
^
116
/home/runner/work/Java-discord/Java-discord/src/test/java/bot/commands/audio/SeekCommandTest.java:135: error: cannot find symbol
117
assertEquals(stringArgumentCaptor.getValue(), TextChannelResponses.BOT_NOT_CONNECTED_TO_VOICE);
118
^
119
symbol: variable TextChannelResponses
120
location: class SeekCommandTest
121
/home/runner/work/Java-discord/Java-discord/src/test/java/bot/commands/audio/VoiceChannelTest.java:65: error: method joinVoiceChannel in class VoiceChannelUtils cannot be applied to given types;
122
VoiceChannelUtils.joinVoiceChannel(mockMember, mockGuild, mockAudioPlayerManager);
123
^
124
required: Member,Guild,String,AudioPlayerManager,OptionEntityRepository
125
found: Member,Guild,AudioPlayerManager
126
reason: actual and formal argument lists differ in length
127
/home/runner/work/Java-discord/Java-discord/src/test/java/bot/commands/audio/VoiceChannelTest.java:76: error: method joinVoiceChannel in class VoiceChannelUtils cannot be applied to given types;
128
VoiceChannelUtils.joinVoiceChannel(mockMember, null, null);
129
^
130
required: Member,Guild,String,AudioPlayerManager,OptionEntityRepository
131
found: Member,,
132
reason: actual and formal argument lists differ in length

Refactor VoiceChannel.SearchAndPlaySong(JDA,String,String,String,String,boolean,AudioPlayerManager)

I've selected VoiceChannel.SearchAndPlaySong(JDA,String,String,String,String,boolean,AudioPlayerManager) for refactoring, which is a unit of 51 lines of code and 7 parameters. Addressing this will make our codebase more maintainable and improve Better Code Hub's Keep Unit Interfaces Small guideline rating! 👍

Here's the gist of this guideline:

  • Definition 📖
    Limit the number of parameters per unit to at most 4.
  • Why
    Keeping the number of parameters low makes units easier to understand, test and reuse.
  • How 🔧
    Reduce the number of parameters by grouping related parameters into objects. Alternatively, try extracting parts of units that require fewer parameters.

You can find more info about this guideline in Building Maintainable Software. 📖


ℹ️ To know how many other refactoring candidates need addressing to get a guideline compliant, select some by clicking on the 🔲 next to them. The risk profile below the candidates signals (✅) when it's enough! 🏁


Good luck and happy coding! :shipit: ✨ 💯

Refactor VoiceChannel.SearchAndPlaySong(JDA,String,String,String,String,boolean,AudioPlayerManager)

I've selected VoiceChannel.SearchAndPlaySong(JDA,String,String,String,String,boolean,AudioPlayerManager) for refactoring, which is a unit of 51 lines of code and 16 branch points. Addressing this will make our codebase more maintainable and improve Better Code Hub's Write Simple Units of Code guideline rating! 👍

Here's the gist of this guideline:

  • Definition 📖
    Limit the number of branch points (if, for, while, etc.) per unit to 4.
  • Why
    Keeping the number of branch points low makes units easier to modify and test.
  • How 🔧
    Split complex units with a high number of branch points into smaller and simpler ones.

You can find more info about this guideline in Building Maintainable Software. 📖


ℹ️ To know how many other refactoring candidates need addressing to get a guideline compliant, select some by clicking on the 🔲 next to them. The risk profile below the candidates signals (✅) when it's enough! 🏁


Good luck and happy coding! :shipit: ✨ 💯

new issue

/home/runner/work/Java-discord/Java-discord/src/test/java/bot/commands/audio/VoiceChannelTest.java:92: error: method joinVoiceChannel in class VoiceChannelUtils cannot be applied to given types;
134
VoiceChannelUtils.joinVoiceChannel(mockMember, null, null);
135
^
136
required: Member,Guild,String,AudioPlayerManager,OptionEntityRepository
137
found: Member,,
138
reason: actual and formal argument lists differ in length
139
Note: Some input files use or override a deprecated API.
140
Note: Recompile with -Xlint:deprecation for details.
141
Note: /home/runner/work/Java-discord/Java-discord/src/test/java/testUtils/AudioTestMocker.java uses unchecked or unsafe operations.
142
Note: Recompile with -Xlint:unchecked for details.
143
Note: Some messages have been simplified; recompile with -Xdiags:verbose to get full output
144
22 errors

Refactor AudioController.addNewSong(boolean,String,String,String,String)

I've selected AudioController.addNewSong(boolean,String,String,String,String) for refactoring, which is a unit of 10 lines of code and 5 parameters. Addressing this will make our codebase more maintainable and improve Better Code Hub's Keep Unit Interfaces Small guideline rating! 👍

Here's the gist of this guideline:

  • Definition 📖
    Limit the number of parameters per unit to at most 4.
  • Why
    Keeping the number of parameters low makes units easier to understand, test and reuse.
  • How 🔧
    Reduce the number of parameters by grouping related parameters into objects. Alternatively, try extracting parts of units that require fewer parameters.

You can find more info about this guideline in Building Maintainable Software. 📖


ℹ️ To know how many other refactoring candidates need addressing to get a guideline compliant, select some by clicking on the 🔲 next to them. The risk profile below the candidates signals (✅) when it's enough! 🏁


Good luck and happy coding! :shipit: ✨ 💯

Some input files use or override a deprecated API.

16:22:33 Note: Some input files use or override a deprecated API.
16:22:33 Note: Recompile with -Xlint:deprecation for details.
16:22:33 Note: Some messages have been simplified; recompile with -Xdiags:verbose to get full output
16:22:33 24 errors

Build error

/home/runner/work/Java-discord/Java-discord/src/main/java/bot/commands/utils/OptionListCommand.java:13: error: cannot find symbol
25

Task :compileJava
26
import static bot.commands.utils.OptionsCommand.OPTION_NAMES;
27
^
28
symbol: class OptionsCommand
29
location: package bot.commands.utils
30
/home/runner/work/Java-discord/Java-discord/src/main/java/bot/commands/utils/OptionListCommand.java:13: error: static import only from classes and interfaces
31
import static bot.commands.utils.OptionsCommand.OPTION_NAMES;
32
^
33
/home/runner/work/Java-discord/Java-discord/src/main/java/bot/commands/utils/OptionListCommand.java:36: error: cannot find symbol
34
for (String option : OPTION_NAMES) {
35
^
36
symbol: variable OPTION_NAMES
37
location: class OptionListCommand
38
Note: Some input files use or override a deprecated API.
39
Note: Recompile with -Xlint:deprecation for details.
40
3 errors

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.