diff --git a/.idea/.gitignore b/.idea/.gitignore
new file mode 100644
index 0000000..26d3352
--- /dev/null
+++ b/.idea/.gitignore
@@ -0,0 +1,3 @@
+# Default ignored files
+/shelf/
+/workspace.xml
diff --git a/.idea/dictionaries/cekey.xml b/.idea/dictionaries/cekey.xml
new file mode 100644
index 0000000..373a768
--- /dev/null
+++ b/.idea/dictionaries/cekey.xml
@@ -0,0 +1,19 @@
+
+
+
+ cooldown
+ couldn
+ dataframe
+ emoji
+ gamertag
+ platformid
+ playerdata
+ playerid
+ psyonix
+ qqfcwij
+ racker
+ rlstats
+ xbox
+
+
+
\ No newline at end of file
diff --git a/.idea/discordbotto.iml b/.idea/discordbotto.iml
new file mode 100644
index 0000000..c17db0d
--- /dev/null
+++ b/.idea/discordbotto.iml
@@ -0,0 +1,10 @@
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/.idea/inspectionProfiles/profiles_settings.xml b/.idea/inspectionProfiles/profiles_settings.xml
new file mode 100644
index 0000000..105ce2d
--- /dev/null
+++ b/.idea/inspectionProfiles/profiles_settings.xml
@@ -0,0 +1,6 @@
+
+
+
+
+
+
\ No newline at end of file
diff --git a/.idea/misc.xml b/.idea/misc.xml
new file mode 100644
index 0000000..8038df2
--- /dev/null
+++ b/.idea/misc.xml
@@ -0,0 +1,4 @@
+
+
+
+
\ No newline at end of file
diff --git a/.idea/modules.xml b/.idea/modules.xml
new file mode 100644
index 0000000..b67b725
--- /dev/null
+++ b/.idea/modules.xml
@@ -0,0 +1,8 @@
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/__pycache__/configloader.cpython-37.pyc b/__pycache__/configloader.cpython-37.pyc
new file mode 100644
index 0000000..9a26247
Binary files /dev/null and b/__pycache__/configloader.cpython-37.pyc differ
diff --git a/__pycache__/index.cpython-37.pyc b/__pycache__/index.cpython-37.pyc
new file mode 100644
index 0000000..10ddf29
Binary files /dev/null and b/__pycache__/index.cpython-37.pyc differ
diff --git a/commands/__pycache__/admin.cpython-37.pyc b/commands/__pycache__/admin.cpython-37.pyc
new file mode 100644
index 0000000..a4af971
Binary files /dev/null and b/commands/__pycache__/admin.cpython-37.pyc differ
diff --git a/commands/__pycache__/help.cpython-37.pyc b/commands/__pycache__/help.cpython-37.pyc
new file mode 100644
index 0000000..6fc2d14
Binary files /dev/null and b/commands/__pycache__/help.cpython-37.pyc differ
diff --git a/commands/admin.py b/commands/admin.py
new file mode 100644
index 0000000..a1630f9
--- /dev/null
+++ b/commands/admin.py
@@ -0,0 +1,65 @@
+from discord.ext import commands
+from config import cogs
+import configloader
+
+
+class Admin(commands.Cog):
+ def __init__(self, bot):
+ self.bot = bot
+
+ async def cog_check(self, ctx):
+ return await ctx.bot.is_owner(ctx.author)
+
+ @commands.command(description='Shows existing Cogs',
+ usage=f'{configloader.__prefix__}cogs',
+ hidden=True)
+ @commands.cooldown(1, 2, commands.BucketType.user)
+ async def cogs(self, ctx):
+ await ctx.send(cogs.__cogs__)
+
+ @commands.command(name='load',
+ description='Loads a Module',
+ usage=f'{configloader.__prefix__}load ',
+ hidden=True)
+ @commands.cooldown(1, 2, commands.BucketType.user)
+ async def load_cog(self, ctx, cog):
+ try:
+ self.bot.load_extension(f"commands.{cog}")
+ except Exception as err:
+ print(f"{cog} couldn't be loaded")
+ raise err
+ else:
+ await ctx.send(f'{cog} : Successfully loaded')
+
+ @commands.command(name='unload',
+ description='Unloads a Module',
+ usage=f'{configloader.__prefix__}unload ',
+ hidden=True)
+ @commands.cooldown(1, 2, commands.BucketType.user)
+ async def unload_cog(self, ctx, cog):
+ try:
+ self.bot.unload_extension(f"commands.{cog}")
+ except Exception as err:
+ print(f"{cog} : couldn't be unloaded")
+ raise err
+ else:
+ await ctx.send(f'{cog} : Successfully unloaded')
+
+ @commands.command(name='reload',
+ description='Reloads a Module',
+ usage=f'{configloader.__prefix__}reload ',
+ hidden=True)
+ @commands.cooldown(1, 2, commands.BucketType.user)
+ async def reload_cog(self, ctx, cog):
+ try:
+ self.bot.unload_extension(f"commands.{cog}")
+ self.bot.load_extension(f'commands.{cog}')
+ except Exception as err:
+ print(f"'{cog} : couldn't be reloaded")
+ raise err
+ else:
+ await ctx.send(f'{cog} : Successfully reloaded')
+
+
+def setup(bot):
+ bot.add_cog(Admin(bot))
diff --git a/commands/help.py b/commands/help.py
new file mode 100644
index 0000000..b644fdc
--- /dev/null
+++ b/commands/help.py
@@ -0,0 +1,12 @@
+from discord.ext import commands
+import configloader
+
+
+class Help(commands.Cog):
+ def __init__(self, bot):
+ pass
+
+
+def setup(bot):
+ bot.remove_command("help")
+ bot.add_cog(Help(bot))
diff --git a/config/__pycache__/cogs.cpython-37.pyc b/config/__pycache__/cogs.cpython-37.pyc
new file mode 100644
index 0000000..4dfe7ac
Binary files /dev/null and b/config/__pycache__/cogs.cpython-37.pyc differ
diff --git a/config/__pycache__/config.cpython-37.pyc b/config/__pycache__/config.cpython-37.pyc
new file mode 100644
index 0000000..724939f
Binary files /dev/null and b/config/__pycache__/config.cpython-37.pyc differ
diff --git a/config/cogs.py b/config/cogs.py
new file mode 100644
index 0000000..12f5c5e
--- /dev/null
+++ b/config/cogs.py
@@ -0,0 +1,5 @@
+__cogs__ = [
+ 'commands.admin',
+ 'commands.help',
+ 'handlers.errorHandling'
+]
diff --git a/config/config.py b/config/config.py
new file mode 100644
index 0000000..48d72c4
--- /dev/null
+++ b/config/config.py
@@ -0,0 +1,4 @@
+__token__ = "YOUR TOKEN"
+__prefix__ = "!"
+__greet_channel__ = "YOUR GREET CHANNEL ID"
+__api_key__ = ""
diff --git a/configloader.py b/configloader.py
new file mode 100644
index 0000000..00d5f14
--- /dev/null
+++ b/configloader.py
@@ -0,0 +1,11 @@
+from config.cogs import __cogs__
+from utils import embed
+
+try:
+ from config.config import __token__, __prefix__, __greet_channel__, __api_key__
+except ImportError:
+ import os
+ __token__ = os.environ.get('DISCORD_TOKEN')
+ __prefix__ = os.environ.get('DISCORD_PREFIX')
+ __greet_channel__ = os.environ.get('DISCORD_GREET_CHANNEL')
+ __api_key__ = os.environ.get('DISCORD_API_KEY')
diff --git a/db/db.db b/db/db.db
new file mode 100644
index 0000000..9999b2f
Binary files /dev/null and b/db/db.db differ
diff --git a/handlers/__pycache__/errorHandling.cpython-37.pyc b/handlers/__pycache__/errorHandling.cpython-37.pyc
new file mode 100644
index 0000000..2b3ab1b
Binary files /dev/null and b/handlers/__pycache__/errorHandling.cpython-37.pyc differ
diff --git a/handlers/errorHandling.py b/handlers/errorHandling.py
new file mode 100644
index 0000000..f3b9821
--- /dev/null
+++ b/handlers/errorHandling.py
@@ -0,0 +1,41 @@
+import traceback
+import sys
+from discord.ext import commands
+import discord
+import configloader
+
+
+class ErrorHandler(commands.Cog):
+ def __init__(self, bot):
+ self.bot = bot
+
+ @commands.Cog.listener()
+ async def on_command_error(self, ctx, error):
+ bot_app_info = await self.bot.application_info()
+
+ ignore_error = (commands.CommandNotFound, commands.UserInputError)
+
+ if isinstance(error, ignore_error):
+ return
+ elif isinstance(error, commands.CommandOnCooldown):
+ embed = configloader.embed.messageEmbed(f"This command is ratelimited, please try again in",
+ "{:.2f}s".format(error.retry_after),
+ f"{bot_app_info.owner}", f"{bot_app_info.icon_url}")
+ return await ctx.send(embed=embed)
+ elif isinstance(error, commands.NoPrivateMessage):
+ try:
+ embed = configloader.embed.messageEmbed(f"This Command can't be used in Private Messages.",
+ "{:.2f}s".format(ctx.command),
+ f"{bot_app_info.owner}", f"{bot_app_info.icon_url}")
+ return await ctx.author.send(embed=embed)
+ except:
+ pass
+ elif isinstance(error, commands.MissingPermissions):
+ embed = configloader.embed.messageEmbed(f"You don't have Permissions to use this command",
+ "{:.2f}s".format(ctx.command),
+ f"{bot_app_info.owner}", f"{bot_app_info.icon_url}")
+ return await ctx.send(embed=embed)
+
+
+def setup(bot):
+ bot.add_cog(ErrorHandler(bot))
diff --git a/index.py b/index.py
new file mode 100644
index 0000000..9b069dc
--- /dev/null
+++ b/index.py
@@ -0,0 +1,60 @@
+import discord
+from discord.ext import commands
+import sqlite3
+import configloader
+import random
+import logging
+from logging.handlers import RotatingFileHandler
+
+logger = logging.getLogger('discord')
+logger.setLevel(logging.WARNING)
+handler = RotatingFileHandler(filename='logs/bot.log', maxBytes=1024 * 5, backupCount=2, encoding='utf-8', mode='w')
+handler.setFormatter(logging.Formatter('%(asctime)s:%(levelname)s:%(name)s: %(message)s'))
+logger.addHandler(handler)
+
+__version__ = '0.0.1'
+bot = commands.Bot(command_prefix=configloader.__prefix__)
+
+
+def Database(db):
+ with sqlite3.connect(db) as con:
+ c = con.cursor()
+ c.execute('''CREATE TABLE IF NOT EXISTS `users` (`name`,`id`, `platform`);''')
+ con.commit()
+ c.close()
+
+
+@bot.event
+async def on_ready():
+ bot_app_info = await bot.application_info()
+ print("------------------------------------")
+ print(f"Owner: {bot_app_info.owner}")
+ print(f"Bot-Name: {bot.user.name}")
+ print(f"Bot-ID: {bot.user.id}")
+ print(f"Bot Version: {__version__}")
+ print("------------------------------------")
+ for cog in configloader.__cogs__:
+ try:
+ bot.load_extension(cog)
+ print(f"{cog} loaded")
+ except Exception as err:
+ print(f"Couldn't load cog: {cog}")
+ raise err
+ Database("db/db.db")
+ await bot.change_presence(activity=discord.Activity(type=discord.ActivityType.watching, name="Juicy developing."))
+
+
+@bot.event
+async def on_member_join(member):
+ bot_app_info = await bot.application_info()
+ emoji = [':wink:', ':wave:', ':tada:']
+ channel = bot.get_channel(int(configloader.__greet_channel__))
+ guild = member.guild
+ embed = configloader.embed.messageEmbed(f"Willkommen bei {guild.name} {random.choice(emoji)}",
+ f"{member.mention}",
+ f"{bot_app_info.owner}", f"{bot_app_info.icon_url}")
+ await channel.send(embed=embed)
+
+
+if __name__ == "__main__":
+ bot.run(configloader.__token__)
diff --git a/logs/bot.log b/logs/bot.log
new file mode 100644
index 0000000..76643e9
--- /dev/null
+++ b/logs/bot.log
@@ -0,0 +1,10 @@
+2020-05-05 11:41:55,808:WARNING:discord.client: PyNaCl is not installed, voice will NOT be supported
+2020-05-05 11:42:44,589:WARNING:discord.client: PyNaCl is not installed, voice will NOT be supported
+2020-05-05 12:02:46,688:WARNING:discord.client: PyNaCl is not installed, voice will NOT be supported
+2020-05-05 12:05:01,635:WARNING:discord.client: PyNaCl is not installed, voice will NOT be supported
+2020-05-05 12:08:16,694:WARNING:discord.client: PyNaCl is not installed, voice will NOT be supported
+2020-05-05 12:10:00,026:WARNING:discord.client: PyNaCl is not installed, voice will NOT be supported
+2020-05-05 12:11:03,303:WARNING:discord.client: PyNaCl is not installed, voice will NOT be supported
+2020-05-05 12:13:57,539:WARNING:discord.client: PyNaCl is not installed, voice will NOT be supported
+2020-05-05 12:14:11,853:WARNING:discord.client: PyNaCl is not installed, voice will NOT be supported
+2020-05-05 12:21:59,614:WARNING:discord.client: PyNaCl is not installed, voice will NOT be supported
diff --git a/requirements.txt b/requirements.txt
new file mode 100644
index 0000000..148bd51
--- /dev/null
+++ b/requirements.txt
@@ -0,0 +1,3 @@
+discord.py
+pandas
+requests
\ No newline at end of file
diff --git a/utils/__pycache__/embed.cpython-37.pyc b/utils/__pycache__/embed.cpython-37.pyc
new file mode 100644
index 0000000..5d0b9ec
Binary files /dev/null and b/utils/__pycache__/embed.cpython-37.pyc differ
diff --git a/utils/embed.py b/utils/embed.py
new file mode 100644
index 0000000..8fe3659
--- /dev/null
+++ b/utils/embed.py
@@ -0,0 +1,9 @@
+import discord
+from datetime import date
+
+
+def messageEmbed(title, text, owner, icon):
+ embed = discord.Embed(color=0xffd540)
+ embed.add_field(name=f"{title}", value=f"{text}")
+ embed.set_footer(text=f"© {owner} • {date.today()}", icon_url=f"{icon}")
+ return embed