Przeglądaj źródła

Deploy on Railway (#110)

Tejas 5 lat temu
rodzic
commit
f146a0b02b
5 zmienionych plików z 15 dodań i 7 usunięć
  1. 9 1
      README.md
  2. 1 1
      app.json
  3. 2 2
      sample_config.env
  4. 2 2
      sample_config.py
  5. 1 1
      wbb/__init__.py

+ 9 - 1
README.md

@@ -65,6 +65,14 @@ thehamkercat@arch:~$ cp sample_config.py config.py
 ```console
 ```console
 thehamkercat@arch:~$ python3 -m wbb
 thehamkercat@arch:~$ python3 -m wbb
 ```
 ```
+<h1>
+    <p align="center">
+        <a href="https://railway.app/new/template?template=https%3A%2F%2Fgithub.com%2FTheHamkerCat%2FWilliamButcherBot&plugins=mongodb&envs=BOT_TOKEN%2CAPI_ID%2CAPI_HASH%2CSESSION_STRING%2CSUDO_USERS_ID%2CLOG_GROUP_ID%2CGBAN_LOG_GROUP_ID%2CWELCOME_DELAY_KICK_SEC%2CARQ_API_URL%2CMESSAGE_DUMP_CHAT%2CARQ_API_KEY%2CLOG_MENTIONS%2CUSERBOT_PREFIX%2CRSS_DELAY%2CPM_PERMIT&optionalEnvs=SESSION_STRING%2CUSERBOT_PREFIX&BOT_TOKENDesc=Obtain+a+Telegram+bot+token+by+contacting+%40BotFather&API_IDDesc=API_ID+of+your+Telegram+Account+my.telegram.org%2Fapps&API_HASHDesc=API_HASH+of+your+Telegram+Account+my.telegram.org%2Fapps&SESSION_STRINGDesc=Need+for+Userbot+Module+So+u+can+execute+.sh+%26+.l+cmd&SUDO_USERS_IDDesc=Sudo+users+have+full+access+to+everythin%2C+don%27t+trust+anyone...+ex%3A-+123456+654311+123456&LOG_GROUP_IDDesc=For+logs+channel+to+note+down+important+bot+level+events%2C+recommend+to+make+this+public.+ex%3A+%27-123456%27&GBAN_LOG_GROUP_IDDesc=gban+logs.+ex%3A+%27-123456%27&WELCOME_DELAY_KICK_SECDesc=Welcome+Delay+Kick+Sec&ARQ_API_URLDesc=For+Music+Downloading+And+Many+More+Things...+Don%27t+change+this+value&MESSAGE_DUMP_CHATDesc=Chat_id+of+the+group+where+useless+things+will+go&ARQ_API_KEYDesc=Get+this+from+%40ARQRobot.&LOG_MENTIONSDesc=Fill+1+to+turn+this+on%2C+or+0+to+turn+it+off.&USERBOT_PREFIXDesc=Userbot+command+prefix%2C+Leave+it+empty+if+you+don%27t+know+what+that+is.&RSS_DELAYDesc=Delay+in+which+RSS+will+send+updates+in+chat&PM_PERMITDesc=Pm+permit%2C+fill+1+to+enable+or+0+to+disable+it.&WELCOME_DELAY_KICK_SECDefault=300&ARQ_API_URLDefault=https%3A%2F%2Fthearq.tech&LOG_MENTIONSDefault=1&RSS_DELAYDefault=300&PM_PERMITDefault=1&referralCode=QLc1H6">
+            <img src="https://railway.app/button.svg" alt="Deploy on Railway">
+        </a>
+    </p>
+</h1>
+
 <h1>
 <h1>
     <p align="center">
     <p align="center">
         <a href="https://heroku.com/deploy?template=https://github.com/thehamkercat/WilliamButcherBot">
         <a href="https://heroku.com/deploy?template=https://github.com/thehamkercat/WilliamButcherBot">
@@ -130,4 +138,4 @@ async def some_function(_, message):
 
 
 <h3 align="center"> 
 <h3 align="center"> 
    And put that file in wbb/modules/, restart and test your bot.
    And put that file in wbb/modules/, restart and test your bot.
-</h3>
+</h3>

+ 1 - 1
app.json

@@ -46,7 +46,7 @@
             "value": "300",
             "value": "300",
             "required": true
             "required": true
         },
         },
-        "MONGO_DB_URI": {
+        "MONGO_URL": {
             "description": "Get From Here. https://telegra.ph/How-To-get-Mongodb-URI-04-06",
             "description": "Get From Here. https://telegra.ph/How-To-get-Mongodb-URI-04-06",
             "required": true
             "required": true
         },
         },

+ 2 - 2
sample_config.env

@@ -20,13 +20,13 @@ MESSAGE_DUMP_CHAT=-173738999
 
 
 WELCOME_DELAY_KICK_SEC=300 # Edit if u want
 WELCOME_DELAY_KICK_SEC=300 # Edit if u want
 
 
-MONGO_DB_URI=your_mongodb_uri
+MONGO_URL=your_mongodb_url
 
 
 ARQ_API_URL=https://thearq.tech # Leave it like this
 ARQ_API_URL=https://thearq.tech # Leave it like this
 
 
 ARQ_API_KEY=your_api_key # Get it from @ARQRobot
 ARQ_API_KEY=your_api_key # Get it from @ARQRobot
 
 
-LOG_MENTIONS=0 # Make It 1 if you want to enable it
+LOG_MENTIONS=0 # Make it 1 if you want to enable it
 
 
 RSS_DELAY=300 # In seconds
 RSS_DELAY=300 # In seconds
 
 

+ 2 - 2
sample_config.py

@@ -23,7 +23,7 @@ if HEROKU:
     WELCOME_DELAY_KICK_SEC = int(
     WELCOME_DELAY_KICK_SEC = int(
         environ.get("WELCOME_DELAY_KICK_SEC", None)
         environ.get("WELCOME_DELAY_KICK_SEC", None)
     )
     )
-    MONGO_DB_URI = environ.get("MONGO_DB_URI", None)
+    MONGO_URL = environ.get("MONGO_URL", None)
     ARQ_API_URL = environ.get("ARQ_API_URL", None)
     ARQ_API_URL = environ.get("ARQ_API_URL", None)
     ARQ_API_KEY = environ.get("ARQ_API_KEY", None)
     ARQ_API_KEY = environ.get("ARQ_API_KEY", None)
     LOG_MENTIONS = bool(int(environ.get("LOG_MENTIONS", None)))
     LOG_MENTIONS = bool(int(environ.get("LOG_MENTIONS", None)))
@@ -43,7 +43,7 @@ else:
     GBAN_LOG_GROUP_ID = -100125431255
     GBAN_LOG_GROUP_ID = -100125431255
     MESSAGE_DUMP_CHAT = -1001181696437
     MESSAGE_DUMP_CHAT = -1001181696437
     WELCOME_DELAY_KICK_SEC = 300
     WELCOME_DELAY_KICK_SEC = 300
-    MONGO_DB_URI = "mongodb+srv://username:password@cluster0.ksiis.mongodb.net/YourDataBaseName?retryWrites=true&w=majority"
+    MONGO_URL = "mongodb+srv://username:password@cluster0.ksiis.mongodb.net/YourDataBaseName?retryWrites=true&w=majority"
     ARQ_API_KEY = "Get this from @ARQRobot"
     ARQ_API_KEY = "Get this from @ARQRobot"
     ARQ_API_URL = "https://thearq.tech"
     ARQ_API_URL = "https://thearq.tech"
     LOG_MENTIONS = True
     LOG_MENTIONS = True

+ 1 - 1
wbb/__init__.py

@@ -53,7 +53,7 @@ bot_start_time = time.time()
 
 
 # MongoDB client
 # MongoDB client
 print("[INFO]: INITIALIZING DATABASE")
 print("[INFO]: INITIALIZING DATABASE")
-mongo_client = MongoClient(MONGO_DB_URI)
+mongo_client = MongoClient(MONGO_URL)
 db = mongo_client.wbb
 db = mongo_client.wbb