Jump to content

dam

Members
  • Posts

    15
  • Joined

  • Last visited

Posts posted by dam

  1. Are you on cellular internet or a hotspot of some kind? Mobile internet service can change your IP regularly, as often as on every request.

     

    The usual solution to this is to use non-mobile internet, or to use a VPN or proxy so you always have one IP.

    Also all the common home contracts from ISPs don't guarantee a static IP address, it usually changes every time you restart your home router

  2.  

    Hi dam

     

    You mean this script below ?

    It doesn't matter.

    You can locate your script where ever you want.

    The script connect to discord server from where it is on the disc.

     

    Do a try

    #!/usr/bin/python3.6
    
    import os
    import discord
    from dotenv import load_dotenv
    
    load_dotenv()
    token = os.getenv('DISCORD_TOKEN')
    
    client = discord.Client()
    
    @client.event
    async def on_member_join(member):
        await member.create_dm()
        await member.dm_channel.send(
            f'Hi {member.name}, welcome to my Discord server!'
        )
    
    @client.event
    async def on_message(message):
        if message.author == client.user:
            return
    
        if message.content == '!heliobot':
            await message.channel.send(f'Hello, how are you today?')
    
    client.run(token)
    

    No, i mean the start.py and stop.py scripts, that make the bot start and stop

  3. Can someone explain to me what each instruction in the discord bot python scripts work? (this guide here) I kinda want to try to customise my bot code directory position, but i don't know how the script works. I see that it reads the file directly in the guide but I'm don't know python enough to make sense of it

  4. So I ended up getting mine to work.

    In username/node do you have app.js packages.json and node_modules folder?

     

    You added node to application manager?

     

    And you have start.py and stop.py in cgi-bin folder?

    I did some kind of customisation, like the folder in which i saved the bot's files because i was planning on having more than one, so i can't say for sure, but i'm confident everything is as it should.

    Only thing is the file is not called app.js from when i tried to use the python scripts it looked like you could use any name you wanted as long as the paths were correct in the scripts, and it doesn't look like the guides are related to each other

  5. I will also be going down this path, or python. Will let you know if I find anything.

     

    https://www.helionet.org/index/topic/40834-is-it-possible-to-run-a-nodejs-script-continuously-without-having-an-active-browser-tab-open/

     

    might be a fix.

    I tried following what was suggested on that post, all I got was 500 server errors when i try to start the python script, i'm not sure if it has something to do with how my folder structure is though

  6. I'm currently trying to host a discord bot (written with discord.js). I followed this guide but I kept getting phusion passenger errors like the one in the screenshot (the error id is always different).

    I tried both using the bot main file as the file to execute and also creating a webserver (with express first and node http next) that would then call client.login(token) to start the bot.

     

    Sidenote: at first the main file name was index.js but i then changed it to app.js to be sure that wasn't a problem but it still happened, so i was wondering if it's actually a problem not to main the main file index.js as that's what i'm used to call my main files.

     

    account name: dam

    main domain: dam.heliohost.us

    server: tommy

     

    post-204933-0-78457100-1616498493_thumb.png

    • Like 1
×
×
  • Create New...