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>
@@ -41,7 +40,6 @@ DiscordIntegrationSettingsOption::DiscordIntegrationSettingsOption()
4140 , library0(
4241 " <b>Discord Integration Library:</b><br>Restart the program for this to take effect." ,
4342 {
44- {Library::SleepyDiscord, " sleepy" , " Sleepy Discord (normal commands, deprecated)" },
4543 {Library::DPP, " dpp" , " D++ (slash commands and normal commands)" },
4644 },
4745 LockMode::LOCK_WHILE_RUNNING,
@@ -68,11 +66,6 @@ DiscordIntegrationSettingsOption::DiscordIntegrationSettingsOption()
6866 LockMode::LOCK_WHILE_RUNNING,
6967 " ^" , " ^"
7068 )
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- )
7669 , game_status(
7770 false ,
7871 " <b>Discord Game Status:</b><br>Enter a status message your bot would display." ,
@@ -85,18 +78,6 @@ DiscordIntegrationSettingsOption::DiscordIntegrationSettingsOption()
8578 LockMode::LOCK_WHILE_RUNNING,
8679 " " , " Automation at your service!"
8780 )
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- )
10081 , allow_buttons_from_users(
10182 " <b>Allow Buttons from Users:</b><br>Allow other users to issue button presses." ,
10283 LockMode::LOCK_WHILE_RUNNING,
@@ -123,29 +104,9 @@ DiscordIntegrationSettingsOption::DiscordIntegrationSettingsOption()
123104}
124105void DiscordIntegrationSettingsOption::on_config_value_changed ([[maybe_unused]] void * object){
125106// cout << this->enabled() << endl;
126- #if (defined PA_SLEEPY || defined PA_DPP)
107+ #ifdef PA_DPP
127108 bool options_enabled = this ->enabled ();
128109 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
148- #ifdef PA_DPP
149110 case Library::DPP:{
150111 options_enabled &= !DppClient::Client::instance ().is_initialized ();
151112 ConfigOptionState state = options_enabled ? ConfigOptionState::ENABLED : ConfigOptionState::DISABLED;
@@ -158,12 +119,8 @@ void DiscordIntegrationSettingsOption::on_config_value_changed([[maybe_unused]]
158119 allow_buttons_from_users.set_visibility (state);
159120
160121 command_prefix.set_visibility (state);
161- use_suffix.set_visibility (ConfigOptionState::HIDDEN);
162- sudo.set_visibility (ConfigOptionState::HIDDEN);
163- owner.set_visibility (ConfigOptionState::HIDDEN);
164122 break ;
165123 }
166- #endif
167124 default :;
168125 }
169126#endif
@@ -181,7 +138,7 @@ ConfigWidget* DiscordIntegrationSettingsOption::make_QtWidget(QWidget& parent){
181138DiscordIntegrationSettingsWidget::DiscordIntegrationSettingsWidget (QWidget& parent, DiscordIntegrationSettingsOption& value)
182139 : GroupWidget(parent, value)
183140{
184- #if (defined PA_SLEEPY || defined PA_DPP)
141+ #ifdef PA_DPP
185142
186143 QWidget* control_buttons = new QWidget (this );
187144 m_options_layout->insertWidget (0 , control_buttons);
@@ -208,16 +165,9 @@ DiscordIntegrationSettingsWidget::DiscordIntegrationSettingsWidget(QWidget& pare
208165 button_start, &QPushButton::clicked,
209166 this , [this , &value](bool ){
210167 switch (value.library0 ){
211- #ifdef PA_SLEEPY
212- case DiscordIntegrationSettingsOption::Library::SleepyDiscord:
213- SleepyDiscordRunner::sleepy_connect ();
214- break ;
215- #endif
216- #ifdef PA_DPP
217168 case DiscordIntegrationSettingsOption::Library::DPP:
218169 DppClient::Client::instance ().connect ();
219170 break ;
220- #endif
221171 default :;
222172 }
223173 value.on_config_value_changed (this );
@@ -227,16 +177,9 @@ DiscordIntegrationSettingsWidget::DiscordIntegrationSettingsWidget(QWidget& pare
227177 button_stop, &QPushButton::clicked,
228178 this , [this , &value](bool ){
229179 switch (value.library0 ){
230- #ifdef PA_SLEEPY
231- case DiscordIntegrationSettingsOption::Library::SleepyDiscord:
232- SleepyDiscordRunner::sleepy_terminate ();
233- break ;
234- #endif
235- #ifdef PA_DPP
236180 case DiscordIntegrationSettingsOption::Library::DPP:
237181 DppClient::Client::instance ().disconnect ();
238182 break ;
239- #endif
240183 default :;
241184 }
242185 value.on_config_value_changed (this );
0 commit comments