Пример #1
0
async def leave_logger(ev, member):
    response = discord.Embed(color=0xDB0000, timestamp=arrow.utcnow().datetime)
    response.set_author(name=f'A Member Has Left', icon_url=user_avatar(member))
    response.add_field(name='📤 Leaving Member', value=f'{member.mention}\n{member.name}#{member.discriminator}')
    new_acc, diff_msg = get_time_difference(member, leave=True)
    response.add_field(name='🕑 Member Joined', value=f'{diff_msg.title()}', inline=True)
    response.set_footer(text=f'UserID: {member.id}')
    await log_event(ev.db, member.guild, response)
Пример #2
0
async def leave_logger(ev: SigmaEvent, member):
    response = discord.Embed(color=0xBE1931, timestamp=arrow.utcnow().datetime)
    response.set_author(name=f'A Member Has Left', icon_url=user_avatar(member))
    response.add_field(name='📤 Leaving Member', value=f'{member.mention}\n{member.name}#{member.discriminator}')
    new_acc, diff_msg = get_time_difference(member, leave=True)
    response.add_field(name='🕑 Member Joined', value=f'{diff_msg.title()}')
    response.set_footer(text=f'user_id: {member.id}')
    await log_event(ev.bot, member.guild, ev.db, response, 'log_movement')
Пример #3
0
async def join_logger(ev: SigmaEvent, member):
    response = discord.Embed(color=0x66CC66, timestamp=arrow.utcnow().datetime)
    response.set_author(name=f'A Member Has Joined', icon_url=user_avatar(member))
    response.add_field(name='📥 Joining Member', value=f'{member.mention}\n{member.name}#{member.discriminator}')
    new_acc, diff_msg = get_time_difference(member)
    if new_acc:
        response.add_field(name='❕ Account Is New', value=f'Made {diff_msg.title()}')
    else:
        response.add_field(name='🕑 Account Created', value=f'{diff_msg.title()}')
    response.set_footer(text=f'UserID: {member.id}')
    await log_event(ev.bot, member.guild, ev.db, response, 'LogMovement')
async def leave_logger(ev, pld):
    """
    :param ev: The event object referenced in the event.
    :type ev: sigma.core.mechanics.event.SigmaEvent
    :param pld: The event payload data to process.
    :type pld: sigma.core.mechanics.payload.MemberPayload
    """
    member = pld.member
    response = discord.Embed(color=0xBE1931, timestamp=arrow.utcnow().datetime)
    response.set_author(name='A Member Has Left', icon_url=user_avatar(member))
    response.add_field(
        name='📤 Leaving Member',
        value=f'{member.mention}\n{member.name}#{member.discriminator}')
    new_acc, diff_msg = get_time_difference(member, leave=True)
    response.add_field(name='🕑 Member Joined', value=f'{diff_msg.title()}')
    response.set_footer(text=f'User ID: {member.id}')
    await log_event(ev.bot, pld.settings, response, 'log_movement')