Skip to content

Commit 05a3b5d

Browse files
committed
Remove sleepy
1 parent fcc605e commit 05a3b5d

File tree

11 files changed

+54
-929
lines changed

11 files changed

+54
-929
lines changed

3rdPartyBinaries/Sleepy.dll

-2.06 MB
Binary file not shown.

3rdPartyBinaries/Sleepy.lib

-2.45 KB
Binary file not shown.

README.md

Lines changed: 30 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -1,31 +1,30 @@
1-
# Arduino-Source
2-
3-
This is the source code for all the main Arduino programs.
4-
5-
[<img src="https://canary.discordapp.com/api/guilds/695809740428673034/widget.png?style=banner2">](https://discord.gg/cQ4gWxN)
6-
7-
8-
# Licensing:
9-
- Unless otherwise specified, all source code in this repository is under the MIT license.
10-
- Some files may be under other (compatible) licenses.
11-
- All precompiled binaries and object files are free for non-commercial use only. For all other uses, please contact the Pokémon Automation server admins.
12-
13-
# Dependencies:
14-
15-
| **Dependency** | **License** |
16-
| --- | --- |
17-
| Qt5 and Qt6 | LGPLv3 |
18-
| [QDarkStyleSheet](https://github.com/ColinDuquesnoy/QDarkStyleSheet) | MIT |
19-
| [Qt Wav Reader](https://code.qt.io/cgit/qt/qtmultimedia.git/tree/examples/multimedia/spectrum/app/wavfile.cpp?h=5.15) | BSD |
20-
| [nlohmann json](https://github.com/nlohmann/json) | MIT |
21-
| [Sleepy Discord](https://github.com/yourWaifu/sleepy-discord) | MIT |
22-
| [D++](https://github.com/brainboxdotcc/DPP) | Apache 2.0 |
23-
| [LUFA](https://github.com/abcminiuser/lufa) | MIT |
24-
| [Tesseract](https://github.com/tesseract-ocr/tesseract) | Apache 2.0 |
25-
| [Tesseract for Windows](https://github.com/peirick/Tesseract-OCR_for_Windows) | Apache 2.0 |
26-
| [OpenCV](https://github.com/opencv/opencv) | Apache 2.0 |
27-
| [ONNX](https://github.com/microsoft/onnxruntime) | MIT |
28-
29-
Vanilla GPL is disallowed, though LGPL is allowed. This is for the following reasons:
30-
1. A tiny portion of the project is not open-sourced. (mostly related to telemetry and internal research experiments)
31-
2. We reserve right to re-license the project in ways that do not abide by the copy-left requirement of GPL.
1+
# Arduino-Source
2+
3+
This is the source code for all the main Arduino programs.
4+
5+
[<img src="https://canary.discordapp.com/api/guilds/695809740428673034/widget.png?style=banner2">](https://discord.gg/cQ4gWxN)
6+
7+
8+
# Licensing:
9+
- Unless otherwise specified, all source code in this repository is under the MIT license.
10+
- Some files may be under other (compatible) licenses.
11+
- All precompiled binaries and object files are free for non-commercial use only. For all other uses, please contact the Pokémon Automation server admins.
12+
13+
# Dependencies:
14+
15+
| **Dependency** | **License** |
16+
| --- | --- |
17+
| Qt5 and Qt6 | LGPLv3 |
18+
| [QDarkStyleSheet](https://github.com/ColinDuquesnoy/QDarkStyleSheet) | MIT |
19+
| [Qt Wav Reader](https://code.qt.io/cgit/qt/qtmultimedia.git/tree/examples/multimedia/spectrum/app/wavfile.cpp?h=5.15) | BSD |
20+
| [nlohmann json](https://github.com/nlohmann/json) | MIT |
21+
| [D++](https://github.com/brainboxdotcc/DPP) | Apache 2.0 |
22+
| [LUFA](https://github.com/abcminiuser/lufa) | MIT |
23+
| [Tesseract](https://github.com/tesseract-ocr/tesseract) | Apache 2.0 |
24+
| [Tesseract for Windows](https://github.com/peirick/Tesseract-OCR_for_Windows) | Apache 2.0 |
25+
| [OpenCV](https://github.com/opencv/opencv) | Apache 2.0 |
26+
| [ONNX](https://github.com/microsoft/onnxruntime) | MIT |
27+
28+
Vanilla GPL is disallowed, though LGPL is allowed. This is for the following reasons:
29+
1. A tiny portion of the project is not open-sourced. (mostly related to telemetry and internal research experiments)
30+
2. We reserve right to re-license the project in ways that do not abide by the copy-left requirement of GPL.

SerialPrograms/CMakeLists.txt

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -695,8 +695,6 @@ file(GLOB MAIN_SOURCES
695695
Source/Integrations/IntegrationsAPI.h
696696
Source/Integrations/ProgramTracker.cpp
697697
Source/Integrations/ProgramTracker.h
698-
Source/Integrations/SleepyDiscordRunner.cpp
699-
Source/Integrations/SleepyDiscordRunner.h
700698
Source/Kernels/AbsFFT/Kernels_AbsFFT.cpp
701699
Source/Kernels/AbsFFT/Kernels_AbsFFT.h
702700
Source/Kernels/AbsFFT/Kernels_AbsFFT_Arch.h
@@ -2446,15 +2444,13 @@ if (MSVC)
24462444
OpenCV_lib
24472445
ONNX_lib
24482446
ONNX_Providers_lib
2449-
Sleepy.lib
24502447
dpp_lib
24512448
)
24522449
target_compile_definitions(
24532450
SerialPrograms PRIVATE
24542451
_CRT_SECURE_NO_WARNINGS
24552452
_DISABLE_CONSTEXPR_MUTEX_CONSTRUCTOR
24562453
PA_TESSERACT
2457-
PA_SLEEPY
24582454
PA_DPP
24592455
)
24602456

SerialPrograms/Source/CommonFramework/Main.cpp

Lines changed: 1 addition & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,6 @@
1515
#include "Logging/Logger.h"
1616
#include "Logging/OutputRedirector.h"
1717
//#include "Tools/StatsDatabase.h"
18-
#include "Integrations/SleepyDiscordRunner.h"
1918
#include "Globals.h"
2019
#include "GlobalSettingsPanel.h"
2120
//#include "Windows/DpiScaler.h"
@@ -111,15 +110,8 @@ int main(int argc, char *argv[]){
111110

112111
Integration::DiscordIntegrationSettingsOption& discord_settings = GlobalSettings::instance().DISCORD->integration;
113112
if (discord_settings.run_on_start){
114-
#ifdef PA_SLEEPY
115-
if (discord_settings.library0 == Integration::DiscordIntegrationSettingsOption::Library::SleepyDiscord){
116-
Integration::SleepyDiscordRunner::sleepy_connect();
117-
}
118-
#endif
119113
#ifdef PA_DPP
120-
if (discord_settings.library0 == Integration::DiscordIntegrationSettingsOption::Library::DPP){
121-
Integration::DppClient::Client::instance().connect();
122-
}
114+
Integration::DppClient::Client::instance().connect();
123115
#endif
124116
discord_settings.on_config_value_changed(nullptr);
125117
}
@@ -144,9 +136,6 @@ int main(int argc, char *argv[]){
144136
#ifdef PA_DPP
145137
Integration::DppClient::Client::instance().disconnect();
146138
#endif
147-
#ifdef PA_SLEEPY
148-
Integration::SleepyDiscordRunner::sleepy_terminate();
149-
#endif
150139

151140
return ret;
152141
}

SerialPrograms/Source/CommonFramework/Notifications/ProgramNotifications.cpp

Lines changed: 8 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,6 @@
1515
#include "CommonFramework/Tools/ProgramEnvironment.h"
1616
#include "CommonFramework/ProgramStats/StatsTracking.h"
1717
#include "Integrations/DiscordWebhook.h"
18-
#include "Integrations/SleepyDiscordRunner.h"
1918
#include "ProgramNotifications.h"
2019

2120
//#include <iostream>
@@ -120,22 +119,11 @@ void send_raw_notification(
120119
hasFile ? file : nullptr
121120
);
122121

123-
#ifdef PA_SLEEPY
124-
if (GlobalSettings::instance().DISCORD->integration.library0 == Integration::DiscordIntegrationSettingsOption::Library::SleepyDiscord){
125-
Integration::SleepyDiscordRunner::send_embed_sleepy(
126-
should_ping, tags, std::move(embed),
127-
hasFile ? file : nullptr
128-
);
129-
}
130-
#endif
131-
132122
#ifdef PA_DPP
133-
if (GlobalSettings::instance().DISCORD->integration.library0 == Integration::DiscordIntegrationSettingsOption::Library::DPP){
134-
Integration::DppClient::Client::instance().send_embed_dpp(
135-
should_ping, color, tags, std::move(embed),
136-
hasFile ? file : nullptr
137-
);
138-
}
123+
Integration::DppClient::Client::instance().send_embed_dpp(
124+
should_ping, color, tags, std::move(embed),
125+
hasFile ? file : nullptr
126+
);
139127
#endif
140128
}
141129
void send_raw_notification(
@@ -173,22 +161,11 @@ void send_raw_notification(
173161
hasFile ? file : nullptr
174162
);
175163

176-
#ifdef PA_SLEEPY
177-
if (GlobalSettings::instance().DISCORD->integration.library0 == Integration::DiscordIntegrationSettingsOption::Library::SleepyDiscord){
178-
Integration::SleepyDiscordRunner::send_embed_sleepy(
179-
should_ping, tags, std::move(embed),
180-
hasFile ? file : nullptr
181-
);
182-
}
183-
#endif
184-
185164
#ifdef PA_DPP
186-
if (GlobalSettings::instance().DISCORD->integration.library0 == Integration::DiscordIntegrationSettingsOption::Library::DPP){
187-
Integration::DppClient::Client::instance().send_embed_dpp(
188-
should_ping, color, tags, std::move(embed),
189-
hasFile ? file : nullptr
190-
);
191-
}
165+
Integration::DppClient::Client::instance().send_embed_dpp(
166+
should_ping, color, tags, std::move(embed),
167+
hasFile ? file : nullptr
168+
);
192169
#endif
193170
}
194171

SerialPrograms/Source/Integrations/DiscordIntegrationSettings.cpp

Lines changed: 14 additions & 102 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,6 @@
1111
//#include "CommonFramework/Globals.h"
1212
//#include "CommonFramework/GlobalSettingsPanel.h"
1313
#include "DppIntegration/DppClient.h"
14-
#include "SleepyDiscordRunner.h"
1514
#include "DiscordIntegrationSettings.h"
1615

1716
//#include <iostream>
@@ -23,7 +22,6 @@ namespace Integration{
2322

2423

2524
DiscordIntegrationSettingsOption::~DiscordIntegrationSettingsOption(){
26-
library0.remove_listener(*this);
2725
this->remove_listener(*this);
2826
}
2927
DiscordIntegrationSettingsOption::DiscordIntegrationSettingsOption()
@@ -38,15 +36,6 @@ DiscordIntegrationSettingsOption::DiscordIntegrationSettingsOption()
3836
LockMode::LOCK_WHILE_RUNNING,
3937
false
4038
)
41-
, library0(
42-
"<b>Discord Integration Library:</b><br>Restart the program for this to take effect.",
43-
{
44-
{Library::SleepyDiscord, "sleepy", "Sleepy Discord (normal commands, deprecated)"},
45-
{Library::DPP, "dpp", "D++ (slash commands and normal commands)"},
46-
},
47-
LockMode::LOCK_WHILE_RUNNING,
48-
Library::DPP
49-
)
5039
, command_type(
5140
"<b>Discord Integration Command Type:</b><br>Restart the program for this to take effect.",
5241
{
@@ -68,11 +57,6 @@ DiscordIntegrationSettingsOption::DiscordIntegrationSettingsOption()
6857
LockMode::LOCK_WHILE_RUNNING,
6958
"^", "^"
7059
)
71-
, use_suffix(
72-
"<b>Use Suffix (Sleepy):</b><br>Use a suffix instead of a prefix for commands.",
73-
LockMode::LOCK_WHILE_RUNNING,
74-
false
75-
)
7660
, game_status(
7761
false,
7862
"<b>Discord Game Status:</b><br>Enter a status message your bot would display.",
@@ -85,87 +69,39 @@ DiscordIntegrationSettingsOption::DiscordIntegrationSettingsOption()
8569
LockMode::LOCK_WHILE_RUNNING,
8670
"", "Automation at your service!"
8771
)
88-
, sudo(
89-
false,
90-
"<b>Discord Sudo (Sleepy):</b><br>Enter user ID(s) to grant sudo access to.",
91-
LockMode::LOCK_WHILE_RUNNING,
92-
"", "123456789012345678"
93-
)
94-
, owner(
95-
false,
96-
"<b>Discord Owner (Sleepy):</b><br>Enter the bot owner's ID (your own ID).",
97-
LockMode::LOCK_WHILE_RUNNING,
98-
"", "123456789012345678"
99-
)
10072
, allow_buttons_from_users(
10173
"<b>Allow Buttons from Users:</b><br>Allow other users to issue button presses.",
10274
LockMode::LOCK_WHILE_RUNNING,
10375
false
10476
)
10577
{
10678
PA_ADD_OPTION(run_on_start);
107-
PA_ADD_OPTION(library0);
10879
PA_ADD_OPTION(command_type);
10980
PA_ADD_OPTION(token);
11081
PA_ADD_OPTION(command_prefix);
111-
PA_ADD_OPTION(use_suffix);
11282
PA_ADD_OPTION(game_status);
11383
PA_ADD_OPTION(hello_message);
114-
PA_ADD_OPTION(sudo);
115-
PA_ADD_OPTION(owner);
11684
PA_ADD_OPTION(allow_buttons_from_users);
11785
PA_ADD_OPTION(channels);
11886

11987
DiscordIntegrationSettingsOption::on_config_value_changed(this);
12088

12189
this->add_listener(*this);
122-
library0.add_listener(*this);
12390
}
12491
void DiscordIntegrationSettingsOption::on_config_value_changed([[maybe_unused]] void* object){
12592
// cout << this->enabled() << endl;
126-
#if (defined PA_SLEEPY || defined PA_DPP)
127-
bool options_enabled = this->enabled();
128-
switch (library0){
129-
#ifdef PA_SLEEPY
130-
case Library::SleepyDiscord:{
131-
options_enabled &= !SleepyDiscordRunner::is_running();
132-
ConfigOptionState state = options_enabled ? ConfigOptionState::ENABLED : ConfigOptionState::DISABLED;
133-
134-
library0.set_visibility(state);
135-
command_type.set_visibility(ConfigOptionState::HIDDEN);
136-
token.set_visibility(state);
137-
game_status.set_visibility(state);
138-
hello_message.set_visibility(state);
139-
140-
command_prefix.set_visibility(state);
141-
use_suffix.set_visibility(state);
142-
sudo.set_visibility(state);
143-
owner.set_visibility(state);
144-
allow_buttons_from_users.set_visibility(ConfigOptionState::HIDDEN);
145-
break;
146-
}
147-
#endif
14893
#ifdef PA_DPP
149-
case Library::DPP:{
150-
options_enabled &= !DppClient::Client::instance().is_initialized();
151-
ConfigOptionState state = options_enabled ? ConfigOptionState::ENABLED : ConfigOptionState::DISABLED;
152-
153-
library0.set_visibility(state);
154-
command_type.set_visibility(state);
155-
token.set_visibility(state);
156-
game_status.set_visibility(state);
157-
hello_message.set_visibility(state);
158-
allow_buttons_from_users.set_visibility(state);
159-
160-
command_prefix.set_visibility(state);
161-
use_suffix.set_visibility(ConfigOptionState::HIDDEN);
162-
sudo.set_visibility(ConfigOptionState::HIDDEN);
163-
owner.set_visibility(ConfigOptionState::HIDDEN);
164-
break;
165-
}
166-
#endif
167-
default:;
168-
}
94+
bool options_enabled = this->enabled();
95+
options_enabled &= !DppClient::Client::instance().is_initialized();
96+
ConfigOptionState state = options_enabled ? ConfigOptionState::ENABLED : ConfigOptionState::DISABLED;
97+
98+
command_type.set_visibility(state);
99+
token.set_visibility(state);
100+
game_status.set_visibility(state);
101+
hello_message.set_visibility(state);
102+
allow_buttons_from_users.set_visibility(state);
103+
104+
command_prefix.set_visibility(state);
169105
#endif
170106
}
171107

@@ -181,7 +117,7 @@ ConfigWidget* DiscordIntegrationSettingsOption::make_QtWidget(QWidget& parent){
181117
DiscordIntegrationSettingsWidget::DiscordIntegrationSettingsWidget(QWidget& parent, DiscordIntegrationSettingsOption& value)
182118
: GroupWidget(parent, value)
183119
{
184-
#if (defined PA_SLEEPY || defined PA_DPP)
120+
#ifdef PA_DPP
185121

186122
QWidget* control_buttons = new QWidget(this);
187123
m_options_layout->insertWidget(0, control_buttons);
@@ -207,38 +143,14 @@ DiscordIntegrationSettingsWidget::DiscordIntegrationSettingsWidget(QWidget& pare
207143
connect(
208144
button_start, &QPushButton::clicked,
209145
this, [this, &value](bool){
210-
switch (value.library0){
211-
#ifdef PA_SLEEPY
212-
case DiscordIntegrationSettingsOption::Library::SleepyDiscord:
213-
SleepyDiscordRunner::sleepy_connect();
214-
break;
215-
#endif
216-
#ifdef PA_DPP
217-
case DiscordIntegrationSettingsOption::Library::DPP:
218-
DppClient::Client::instance().connect();
219-
break;
220-
#endif
221-
default:;
222-
}
146+
DppClient::Client::instance().connect();
223147
value.on_config_value_changed(this);
224148
}
225149
);
226150
connect(
227151
button_stop, &QPushButton::clicked,
228152
this, [this, &value](bool){
229-
switch (value.library0){
230-
#ifdef PA_SLEEPY
231-
case DiscordIntegrationSettingsOption::Library::SleepyDiscord:
232-
SleepyDiscordRunner::sleepy_terminate();
233-
break;
234-
#endif
235-
#ifdef PA_DPP
236-
case DiscordIntegrationSettingsOption::Library::DPP:
237-
DppClient::Client::instance().disconnect();
238-
break;
239-
#endif
240-
default:;
241-
}
153+
DppClient::Client::instance().disconnect();
242154
value.on_config_value_changed(this);
243155
}
244156
);

0 commit comments

Comments
 (0)