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)