Fixed some issues
This commit is contained in:
@@ -42,8 +42,6 @@ using namespace ts;
|
||||
using namespace ts::server;
|
||||
using namespace ts::token;
|
||||
|
||||
extern ts::server::InstanceHandler *serverInstance;
|
||||
|
||||
#define QUERY_PASSWORD_LENGTH 12
|
||||
|
||||
//TODO: Map permsid!
|
||||
@@ -6512,7 +6510,7 @@ CommandResult ConnectedClient::handleCommandMusicBotCreate(Command& cmd) {
|
||||
shared_lock server_channel_lock(this->server->channel_tree_lock);
|
||||
auto channel = cmd[0].has("cid") ? this->server->channelTree->findChannel(cmd["cid"]) : this->currentChannel;
|
||||
if(!channel) {
|
||||
if(cmd[0].has("cid")) return {findError("client_invalid_id")};
|
||||
if(cmd[0].has("cid")) return {findError("channel_invalid_id")};
|
||||
} else {
|
||||
CHANNEL_PERMISSION_TEST(permission::i_channel_description_view_power, permission::i_channel_needed_description_view_power, channel, false);
|
||||
auto permission_granted = this->calculate_permission_value(permission::i_channel_join_power, channel->channelId());
|
||||
@@ -6549,6 +6547,7 @@ CommandResult ConnectedClient::handleCommandMusicBotCreate(Command& cmd) {
|
||||
);
|
||||
}
|
||||
bot->properties()[property::CLIENT_LAST_CHANNEL] = channel ? channel->channelId() : 0;
|
||||
bot->properties()[property::CLIENT_COUNTRY] = config::geo::countryFlag;
|
||||
|
||||
if(permissions[permission::i_client_music_delete_power] > 0) {
|
||||
bot->clientPermissions->set_permission(permission::i_client_music_needed_delete_power, {permissions[permission::i_client_music_delete_power],0}, permission::v2::set_value, permission::v2::do_nothing);
|
||||
@@ -7304,11 +7303,13 @@ CommandResult ConnectedClient::handleCommandHelp(Command& cmd) {
|
||||
|
||||
auto file = fs::u8path("commanddocs/" + command + ".txt");
|
||||
if(!fs::exists(file)) return {findError("file_not_found"), "Could not resolve file " + file.string()};
|
||||
|
||||
string line;
|
||||
ifstream stream(file);
|
||||
if(!stream) return {findError("file_io_error"), "Could not read documentation file " + file.string()};
|
||||
while(getline(stream, line))
|
||||
this->sendCommand(Command(line));
|
||||
this->sendCommand(Command{line});
|
||||
|
||||
return CommandResult::Success;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user