diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000000000000000000000000000000000000..8d865be6477ac25c5a8b35c1a3f45c0cc3f452da --- /dev/null +++ b/.gitignore @@ -0,0 +1 @@ +token diff --git a/bot.py b/bot.py new file mode 100644 index 0000000000000000000000000000000000000000..b736627669d7743c59ac216fcd9d3963a7d810db --- /dev/null +++ b/bot.py @@ -0,0 +1,25 @@ +import discord, asyncio +import os, sys + +def getPath(): + return os.path.dirname(os.path.realpath(__file__)) + +prefix = "!" +client = discord.Client() + +@client.event +async def on_ready(): + print(client.user.name + " booted up.") + await client.change_presence(activity = discord.Game(name = prefix + "help")) + +@client.event +async def on_member_join(member): + print(member) + +tokenFile = getPath() + "/token" +if (not os.path.isfile(tokenFile)): + print("Please create a 'token' file with the discord bot token in it.") + sys.exit(1) + +token = open(tokenFile, "r").read().strip() +client.run(token + " Joined.") \ No newline at end of file