Coder Social home page Coder Social logo

Comments (7)

radinshayanfar avatar radinshayanfar commented on July 17, 2024 1

Yes. Actually there are two files missing because of security reasons.

  • First one is TOKEN in root directory of the project and it only includes your bot's token (which you obtain from @BotFather) on the first line.
  • Second one (as you just mentioned it) is /Database/DatabaseConfig.php file which contains some definitions for MySQL database connection. Here is an example of this file:
<?php

DEFINE('DB_USER', 'YOUR_USERNAME');
DEFINE('DB_PASSWORD', 'YOUR_PASSWORD');
DEFINE('DB_HOST', 'YOUR_DB_HOST');
DEFINE('DB_NAME', 'YOUR_DB_NAME');

And also remember to create the database structure with the following query:

CREATE TABLE 'subs' (
  'chat_id' int(11) NOT NULL AUTO_INCREMENT,
  'name' varchar(1000) COLLATE utf8_bin NOT NULL,
  'count' int(10) UNSIGNED NOT NULL DEFAULT '1',
  'last_time' timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
  PRIMARY KEY ('chat_id')
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_bin;

CREATE TABLE 'tracks' (
  'id' int(11) NOT NULL AUTO_INCREMENT,
  'link' varchar(1000) COLLATE utf8_bin NOT NULL,
  'ts_create' timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
  PRIMARY KEY ('id')
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_bin;

from rjbot.

radinshayanfar avatar radinshayanfar commented on July 17, 2024 1

Unfortunately you can’t.
Ask your questions here.

from rjbot.

Pakzamirh avatar Pakzamirh commented on July 17, 2024

Thanks but i have some problem :((
How can I contact you on the telegram ?

from rjbot.

Pakzamirh avatar Pakzamirh commented on July 17, 2024

PHP Parse error: syntax error, unexpected ':', expecting ';' or '{' in Database/Database.php on line 53
this error is for this line

public function autoIncrementStart(): int

from rjbot.

radinshayanfar avatar radinshayanfar commented on July 17, 2024

I think your PHP version is earlier than version 7.0 and this error is because of that. Try to use latest version of PHP.

from rjbot.

Pakzamirh avatar Pakzamirh commented on July 17, 2024

thanks for help ❤️
bot now working for me and my php version is 7
i send it link and bot send to me Music from link but it Does not work for search a artist Photo
i check my file manager and see this errors
25-Sep-2019 11:57:13 UTC] PHP Warning: include_once(../Helpers/StringHelper.php): failed to open stream: No such file or directory in /home/tgprotot/public_html/RJBot/Core/Video.php on line 10 [25-Sep-2019 11:57:13 UTC] PHP Warning: include_once(): Failed opening '../Helpers/StringHelper.php' for inclusion (include_path='.:/opt/alt/php70/usr/share/pear') in /home/tgprotot/public_html/RJBot/Core/Video.php on line 10 [25-Sep-2019 11:57:13 UTC] PHP Warning: include_once(../Helpers/StringHelper.php): failed to open stream: No such file or directory in /home/tgprotot/public_html/RJBot/Core/Audio.php on line 9 [25-Sep-2019 11:57:13 UTC] PHP Warning: include_once(): Failed opening '../Helpers/StringHelper.php' for inclusion (include_path='.:/opt/alt/php70/usr/share/pear') in /home/tgprotot/public_html/RJBot/Core/Audio.php on line 9 [25-Sep-2019 11:57:13 UTC] PHP Fatal error: Uncaught TypeError: Return value of Database::autoIncrementStart() must be of the type integer, null returned in /home/tgprotot/public_html/RJBot/Database/Database.php:60 Stack trace: #0 /home/tgprotot/public_html/RJBot/Update/TextMessage.php(203): Database->autoIncrementStart() #1 /home/tgprotot/public_html/RJBot/Update/TextMessage.php(122): Update\TextMessage->search() #2 /home/tgprotot/public_html/RJBot/Update/TextMessage.php(48): Update\TextMessage->extract() #3 /home/tgprotot/public_html/RJBot/Update/Action.php(50): Update\TextMessage->__construct(Array, Object(TelegramAPI), Object(Database)) #4 /home/tgprotot/public_html/RJBot/Update/Action.php(30): Update\Action->messageProcess() #5 /home/tgprotot/public_html/RJBot/Bot.php(23): Update\Action->__construct(Array, Object(TelegramAPI), Object(Database)) #6 {main} thrown in /home/tgprotot/public_html/RJBot/Database/Database.php on line 60

from rjbot.

radinshayanfar avatar radinshayanfar commented on July 17, 2024

@Pakzamirh This is because of PHP can't locate necessary files. Please double check the files exists. Try to convert relative paths to absolute path and check if it works.

from rjbot.

Related Issues (2)

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.