def __init__(self, bot):
     self.DEBUG = False
     self.bot = bot
     self.config = BdoBotConfig()
     Functions.logging_settings()
     self.function = BossFunctions()
     self.jsonn = {}
Example #2
0
 def __init__(self, username, config=None):
     Functions.logging_settings()
     self.user_url = None
     self.config = config
     self.username = username
     self.character_list = ""
     self.all_character_list = []
     self.name()
 def __init__(self):
     Functions.logging_settings()
     self.ip = 'localhost'
     self.port = 5432
     self.username = '******'
     self.password = '******'
     self.database_name = 'dbname'
     self.engine = self.create_engine()
Example #4
0
 def __init__(self, bot):
     """
     :param bot: dict with message data
     """
     Functions.logging_settings()
     self.DEBUG = False
     self.bot = bot
     self.function = BossFunctions()
     self.jsonn = {}
     self.server_id = 0
Example #5
0
    async def on_message(self, ctx):
        date = datetime.datetime.now().strftime('%Y-%m-%d %H:%M:%S')
        data = Functions.assign_data(ctx)
        data = {
            'date': date,
            'server_name': data['server_name'],
            'channel_name': data['channel_name'],
            'author_nick': data['author_nick'],
            'author_name': data['author_name'],
            'server_id': data['server_id'],
            'channel_id': data['channel_id'],
            'author_id': data['author_id'],
            'attachment_url': data['attachment_url'],
            'message': str(ctx.content)
        }

        if self.bot.user != ctx.author:
            if '$' != str(data['message'][0]):
                if data['server_name'] is None:
                    return
                if data['author_nick'] is None:
                    data['author_nick'] = data['author_name']
                self.db.add_to_database(data)
                if self.DEBUG:
                    await ctx.channel.send(f"```{data}```")
Example #6
0
 def __init__(self):
     Functions.logging_settings()
Example #7
0
from discord.ext import commands
import os
from functions.bot_functions import Functions
import datetime
import sys

currentdir = os.path.dirname(os.path.realpath(__file__))
parentdir = os.path.dirname(currentdir)
sys.path.append(parentdir)

bot = commands.Bot(command_prefix='$')
bot.remove_command('help')

api_key = Functions.get_api_keys()

#if __name__ == '__main__':
#    for filename in os.listdir('./cogs'):
#        if filename.endswith('.py'):
#            bot.load_extension(f'cogs.{filename[:-3]}')

### or

if __name__ == '__main__':
    bot.load_extension('cogs.bot')
    bot.load_extension('cogs.dev_commands')
    bot.load_extension('cogs.bdo_bot')

bot.run(api_key[0])
Example #8
0
 def __init__(self, bot):
     Functions.logging_settings()
     self.DEBUG = False
     self.bot = bot
     self.db = DatabaseSender()
     self.jsonn = {}