Пример #1
0
 def __init__(self):
     self.sina_url = 'http://top.weibo.com'
     self.hot_word_log()
     try:
         self.mongo = MongoDB()
     except:
         self.logObj.write('mongoDB connectd failed...')
Пример #2
0
 def __init__(self):
     self.category, self.difficulty, self.question, self.correct_answer, self.answers, self.typ = webscrap_trivia(
     )
     self.letter = ANSWERS_TRIVIA[self.answers.index(self.correct_answer)]
     self.losers = []
     self.awaiting_answer = False
     self.question = html.unescape(self.question)
     for i in range(len(self.answers)):
         self.answers[i] = html.unescape(self.answers[i])
     self.correct_answer = html.unescape(self.correct_answer)
     self.mongoDB = MongoDB()
Пример #3
0
from discord.ext import commands

import validation
from gw2ApiKey import GW2Api
from mongoDB import MongoDB
from utils import Utils, UtilsCommand, UtilsDiscordRoles, ErrorMessages
from validation import Validation

utils = Utils()
description = utils.BOT_DESCRIPTION
askForAPIKey = utils.API_QUESTION
command_description = UtilsCommand()
server_roles = UtilsDiscordRoles()
error_messages = ErrorMessages()
validation = Validation()
mongoDb = MongoDB()


class DiscordBot(commands.Bot):
    # old but u run the bot only on one server, its fine
    # current_server_joined = None

    def __init__(self):
        super().__init__(command_prefix="!",
                         description=description,
                         pm_help=True,
                         has_permission=8,
                         status=discord.Status.idle)
        self.add_command(self.be_rude)
        self.add_command(self.reg)
Пример #4
0
 def __init__(self):
     self.clientObj = MongoDB()
     self.clientDB = self.clientObj.stockDB
Пример #5
0
 def __init__(self, client):
     self.client = client
     self.question = Question()
     self.mongo_client = MongoDB()
     self.dict = {0: '🏅', 1: '🥈', 2: '🥉'}
Пример #6
0
import discord
from discord.ext import commands, tasks
import os
import asyncio
import datetime
from datetime import time as t
from datetime import timedelta
from reddit import *
from Question import *
from mongoDB import MongoDB
from cogs.news import top_news_from_world
from itertools import cycle

# initiates Bot with prefix ('.')
client = commands.Bot(command_prefix='.')
mongoDB = MongoDB()
"""
Lists of statuses (activities) that bot will have, depending on time of the day (all times in UTC, 24h format).
ACTIVITY_LIST_MORNING - 5 to 11
ACTIVITY_LIST_GENERAL - 11 to
ACTIVITY_LIST_EVENING - 19 to 24
ACTIVITY_LIST_NIGHT - 24 to 5
"""
ACTIVITY_LIST_GENERAL = [
    'Smile often!', 'Az is dead!', 'Drink water!', 'Milica is a midget.',
    'Spread love!', 'Stay positive!', 'Cenelia is handsome!',
    'You are beautiful!', 'Believe in yourself!', 'Segment is a boomer!',
    'Everything will be fine!', 'You can do it!', 'Be good to others!',
    'Be good to yourself!'
]
activity_list_general_cycle = cycle(ACTIVITY_LIST_GENERAL)
Пример #7
0
 def __init__(self):
     self._mongo = MongoDB()
     self._utils = Utils()
Пример #8
0
def getStockDB():
    client = MongoDB()
    return client.stockDB
Пример #9
0
 def __init__(self, client):
     self.client = client
     self.mongoDB = MongoDB()