Esempio n. 1
0
 def __init__(self, bot):
     self.bot = bot
     self.karma = karma.Karma(bot, karma_r)
     self.check = room_check.RoomCheck(bot)
     self._leaderboard_formatter = utils.make_pts_column_row_formatter(
         Database_karma.karma.name)
     self._positive_formatter = utils.make_pts_column_row_formatter(
         Database_karma.positive.name)
     self._negative_formatter = utils.make_pts_column_row_formatter(
         Database_karma.negative.name)
Esempio n. 2
0
bot = commands.Bot(command_prefix=commands.when_mentioned_or(
                                      *config.command_prefix),
                   help_command=None,
                   case_insensitive=True)

# Repositories (data access layer)
user_r = user_repo.UserRepository()
karma_r = karma_repo.KarmaRepository()

# Logic (functionality used by features or rubbergod directly)
roll_dice = roll_dice.Roll()
rng = rng.Rng()

# Features (layer talking to Discord)
verification = verification.Verification(bot, user_r)
karma = karma.Karma(bot, karma_r)
presence = presence.Presence(bot)
reaction = reaction.Reaction(bot, karma_r)

arcas_time = (datetime.datetime.utcnow() -
              datetime.timedelta(hours=config.arcas_delay))
boottime = datetime.datetime.now().replace(microsecond=0)
uhoh_counter = 0


async def botroom_check(message):
    room = await get_room(message)
    if room is not None and room.id not in config.allowed_channels:
        await message.channel.send(messages.bot_room_redirect.format(
            utils.generate_mention(message.author.id),
            config.bot_room))
Esempio n. 3
0
 def __init__(self, bot):
     self.bot = bot
     self.karma = karma.Karma(bot, karma_r)
     self.check = room_check.RoomCheck(bot)