コード例 #1
0
async def on_member_join(member):
    global member_join_time
    member_join_time = time()
    json_file = loads(read('config.json'))
    black_lista = [
        json_file['black_list'][key] for key in json_file['black_list']
    ]
    if member.id in black_lista:
        await member.ban()
        json_rem('config.json', ['black_list', str(member.id)])
        return
    image = discord_file('resources/join.gif', 'Witamy.gif', False)
    await vrb.ver_chan.send(
        f"Witamy serdecznie {member.display_name} na serwerze FurHeaven. Celem tego miejsca jest zrzeszanie osob interesujacych sie tematyka furry. Jest tu sporo osob z ktorymi mozna pogadac na przerozne tematy. Mamy nadzieje, ze bedzie Ci tu z nami milo :grin:\nOdpowiedz tylko na  pięć pytań.\n1. Ile masz lat?\n2. Czy jestes futrzakiem?\n3. Czy przeczytales regulamin i bedziesz go przestrzegac?\n4. Mężczyzna/Kobieta?\n5. Skąd masz zaproszenie?\n\nJeżeli odpowiedziałeś/aś na pytania a nikt z moderacji ani administracji jeszcze nic nie zrobił, oznacz kogoś z nich, na pewno od razu przeprowadzą weryfikację :3",
        file=image)
    image = discord_file('resources/join.mp4', 'Witamy.mp4', False)
    await vrb.main_chan.send(
        f"<@{member.id}> wlasnie wbil/a na serwer! Zaraz powinien/na do nas dolaczyc.",
        file=image)
    for role in vrb.dividing_roles:
        await member.add_roles(role)
    await vrb.commands_chan.send(embed=user_info(vrb.host, member, True))
    sleep(5)
    await vrb.ver_chan.send(f'<@{member.id}>')
    msg = await vrb.ver_chan.send(vrb.host.mention)
    await msg.delete()
コード例 #2
0
ファイル: message_delete.py プロジェクト: GilbertzRivi/smokel
async def on_bulk_message_delete(messages):
    attachments_saveing_channel = client.get_channel(555876098819227649)
    for message in messages:    
        if message.channel.id == 559910981392793601: return
        e = Embed(colour=message.author.color, timestamp=datetime.utcnow())
        e.set_author(name=f"Wiadomosc usunięta")
        e.add_field(name='Kanał', value=message.channel, inline=False)
        if len(message.content) > 0:
            e.add_field(name='Treść', value=message.content, inline=False)
        else:
            e.add_field(name='Treść', value='Brak zawartości', inline=False)
        e.set_footer(text=f'{message.author.name} {message.author.id}', icon_url=message.author.avatar_url)
        try:
            await vrb.logs_chan.send(embed=e)
        except: pass
        if len(message.attachments) > 0:
            await vrb.logs_chan.send('Załączniki załączone do wiadomości')
            for a in message.attachments:
                await a.save(fp=a.filename, use_cached=True)
                saveing_file = discord_file(a.filename, a.filename, False)
                saveing_msg = await attachments_saveing_channel.send(file=saveing_file)
                a_url = saveing_msg.attachments[0].url
                ea = Embed(colour=vrb.host.colour, timestamp=datetime.utcnow())
                ea.set_footer(text=f'{message.author.name} {message.author.id}', icon_url=message.author.avatar_url)
                ea.set_author(name='Pliki załączone do wiadomości')
                ea.set_image(url=a_url)
                await vrb.logs_chan.send(embed=ea)
                remove(a.filename)
コード例 #3
0
ファイル: member_leave.py プロジェクト: GilbertzRivi/smokel
async def on_member_remove(member):
    if sbk.silent_ban_kick_user == member: return
    if bk.kicked_user == member:
        image = discord_file('resources/kicked.png',
                             'Wyjebało jak gagarina.png', False)
        await vrb.main_chan.send(
            f'A co to? Czy to ptak? Czy to samolot? Nie to {member.name} został wyjebany na orbitę niczym gagarin w 1961',
            file=image)
        return
    bans = await member.guild.bans()
    if member.id in [ban.user.id for ban in bans]:
        image = discord_file('resources/banned.gif', 'Only gulag for ya~.gif',
                             False)
        await vrb.main_chan.send(f'{member.name} dostał bana', file=image)
        return
    try:
        if time() - join.member_join_time < 60:
            try:
                async for msg in vrb.main_chan.history(limit=100):
                    if member.mention in msg.content and msg.author == client.user:
                        await msg.delete()
            except:
                pass
            image = discord_file('resources/left_fast.gif',
                                 'To było szybkie.gif', False)
            await vrb.main_chan.send(
                f'{member.name} niestety nie wytrzymał presji weryfikacji',
                file=image)
            return
    except:
        pass
    image = discord_file('resources/left.png', 'Do zobaczenia.png', False)
    await vrb.main_chan.send(f'{member.name} opuścił serwer', file=image)
    sleep(5)
    temp = vrb.msg_num_chan.fetch_message(
        vrb.msg_num_chan.last_message_id).content.split(' ')
    if int(temp[0]) == member.id:
        wiad_num = temp[1]
        await vrb.tech_chan.send(
            f'Użytkownik {member.name} który właśnie opuścił serwer miał {wiad_num} wiadomości'
        )
コード例 #4
0
async def rmem(ctx, *, meme):
    await ctx.message.delete()
    memes = listdir('resources/reaction_memes')
    names = []
    for name in memes:
        names.append(name.split('.')[0])
        if meme == name.split('.')[0]: 
            extension = name.split('.')[-1]
    if meme == 'help':
        memes_formated = '\n-'.join(names)
        await ctx.author.send(f'Lista reaction memów dostępnych do wysłania:\n-{memes_formated}')
        return
    try: await ctx.send(f'{ctx.author.name} reaguje:', file=discord_file(f'resources/reaction_memes/{meme}.{extension}', f'{meme}.{extension}', False))
    except: await ctx.send('W mojej bazie nie ma takiego mema')
コード例 #5
0
ファイル: fight.py プロジェクト: GilbertzRivi/smokel
async def fight(ctx, member: Member):
    if ctx.author == member:
        await ctx.send('*nom*', file=discord_file('resources/gryz_w_ogon.jpg', 'nom.jpg', False))
        return
    hpa = 100
    hpo = 100
    autor = ctx.author.display_name
    oponent = member.display_name
    e = Embed(color=ctx.author.color, timestamp=ctx.message.created_at)
    e.add_field(name=f'{autor} vs {oponent}', value='***fight!***', inline=False)
    e.add_field(name=autor, value=100, inline=True)
    e.add_field(name=oponent, value=100, inline=True)
    e.set_footer(text='O bogowie, walka!', icon_url=client.user.avatar_url)
    await ctx.send(embed=e)
    content = ''
    while True:
        msg = ''
        async for message in ctx.channel.history(limit=100):
            if message.author == client.user and message.embeds[0].timestamp == ctx.message.created_at:
                msg = message
                break

        for field in msg.embeds[0].fields:
            temp = ''
            for line in field.value.split('\n')[-6:]:
                temp += line + '\n'
            content = temp
            break

        damage = randint(1, 20)
        weapon = choice(weapons)
        text = f'**{autor}** uzyl **{weapon}** i zadal **{oponent}** {damage} obrazen'
        if damage > 15:
            text = f'Uderzenie krytyczne! **{autor}** uzyl **{weapon}** i zadal **{oponent}** {damage} obrazen'
        text = content + '\n' + text
        e.set_field_at(index=0, name=f'{autor} vs {oponent}', value=text, inline=False)
        hpo -= damage
        e.set_field_at(index=2, name=oponent, value=hpo, inline=True)
        await msg.edit(embed=e)
        if hpo <= 0:
            text2 = text + '\n' + '\n' + f'**{autor}** wygrywa!'
            e.set_field_at(index=0, name=f'{autor} vs {oponent}', value=text2, inline=False)
            e.set_field_at(index=2, name=oponent, value=0, inline=True)
            await msg.edit(embed=e)
            break
        await msg.edit(embed=e)
        sleep(1)
        
        msg = ''
        async for message in ctx.channel.history(limit=100):
            if message.author == client.user and message.embeds[0].timestamp == ctx.message.created_at:
                msg = message
                break

        for field in msg.embeds[0].fields:
            temp = ''
            for line in field.value.split('\n')[-6:]:
                temp += line + '\n'
            content = temp
            break

        damage2 = randint(1, 20)
        weapon2 = choice(weapons)
        text = f'**{oponent}** uzyl **{weapon2}** i zadal **{autor}** {damage2} obrazen'
        if damage2 > 15:
            text = f'Uderzenie krytyczne! **{oponent}** uzyl **{weapon2}** i zadal **{autor}** {damage2} obrazen'
        text = content + '\n' + text
        e.set_field_at(index=0, name=f'{autor} vs {oponent}', value=text, inline=False)
        hpa -= damage2
        e.set_field_at(index=1, name=autor, value=hpa, inline=True)
        await msg.edit(embed=e)
        if hpa <= 0:
            text2 = text + '\n' + '\n' + f'**{oponent}** wygrywa!'
            e.set_field_at(index=0, name=f'{autor} vs {oponent}', value=text2, inline=False)
            e.set_field_at(index=1, name=autor, value=0, inline=True)
            await msg.edit(embed=e)
            break
        await msg.edit(embed=e)
        sleep(1)
コード例 #6
0
async def gay(ctx, *, member: Member):
    await ctx.message.delete()
    await ctx.send(f"Udowodnione naukowo jest, ze {member.mention} jest h**o", file=discord_file('resources/h**o.png', 'h**o.png', False))
コード例 #7
0
async def gimp_papryka(ctx):
    papryka = discord_file('resources/papryka.png', 'gimp_papryka.png', True)
    await ctx.send(file=papryka)
コード例 #8
0
ファイル: owo_uwu.py プロジェクト: GilbertzRivi/smokel
async def owo(ctx):
    await ctx.message.delete()
    file = discord_file('resources/owo.png', 'owo.png', False)
    await ctx.send(file=file)
コード例 #9
0
ファイル: owo_uwu.py プロジェクト: GilbertzRivi/smokel
async def uwu(ctx):
    await ctx.message.delete()
    file = discord_file('resources/uwu.png', 'uwu.png', False)
    await ctx.send(file=file)
コード例 #10
0
async def on_message(message):

    await client.process_commands(message)

    if message.author != client.user and not message.mention_everyone:

        if message.author.id == vrb.geralt_id:
            if 'pizda' in message.content.lower() or 'pizdo' in message.content.lower() or 'pizdą' in message.content.lower() or 'pizdy' in message.content.lower():
                await message.channel.send('Pizda <:harold:625405098255843331>', file=discord_file(f'resources/gerwazy_pizda{randint(1,3)}.png', 'gerwazy.png', True))

        if message.content.lower().startswith("rawr"):
            await message.channel.send(choice(["RAWRR!", 'ror']))

        if message.content.lower().startswith("awoo"):
            await message.channel.send(f'*Awo{randint(3, 19)*"o"}!*')
        
        if message.content.split(' ')[0].lower() == "f":
            num = loads(read('config.json'))['counters']['f'] + 1
            if vrb.fem in message.author.roles:
                ending = "oddała"
            else:
                ending = "oddał"
            dedycation = message.content.split(' ')[1:]
            if len(dedycation) > 0:
                if 'dla' in [i.lower() for i in dedycation]:
                    dedycation = ' '.join(dedycation)
                else:
                    dedycation = 'dla ' + ' '.join(dedycation)
            if randint(1, 40) == 10:
                F = discord_file('resources/f.jpg', 'f.jpg', False)
                if len(dedycation) == 0:
                    await  message.channel.send(f"{message.author.display_name} {ending} honory\nHonory oddane w sumie: {num}", file=F)
                else:
                    await  message.channel.send(f'{message.author.display_name} {ending} honory {dedycation}\nHonory oddane w sumie: {num}', file=F)
            else:
                if len(dedycation) == 0:
                    await  message.channel.send(f"{message.author.display_name} {ending} honory\nHonory oddane w sumie: {num}")
                else:
                    await  message.channel.send(f'{message.author.display_name} {ending} honory {dedycation}\nHonory oddane w sumie: {num}')
            json_add('config.json', ['counters', 'f'], num)
        
        if "owo whats this" in message.content or "owo what's this" in message.content:
            owo_whats_this = discord_file('resources/owo.gif', 'owo.gif', False)
            await message.channel.send(file=owo_whats_this)
        
        if message.content.lower() == "whym":
            await message.channel.send("Whymming in progress")
            async for msg in message.channel.history(limit=5):
                if msg.content == "Whymming in progress":
                    break
            for i in range(9):
                await msg.edit(content=f'Whymming in progress{(i%3+1)*"."}')
                sleep(1)
            await msg.edit(content='Whymming complete!', delete_after=5)
        
        bad_words = loads(read('config.json'))['bad_words']
        bad_words_num = loads(read('config.json'))['counters']['bad_words']
        if chk_list_cohesion(bad_words, [i.lower() for i in message.content.split(' ')]):
            counter = 0
            for word in message.content.split(' '):
                if word.lower() in bad_words:
                    counter += 1
            bad_words_num += counter
            json_add('config.json', ['counters', 'bad_words'], bad_words_num)

        if message.content == '.u w u': 
            await message.delete()
            await message.channel.send('u w  u')
            async for msg in message.channel.history(limit=5):
                if msg.content == "u w  u":
                    break
            for i in range(10):
                if i%2 == 0:
                    await msg.edit(content='u  w u')
                else: 
                    await msg.edit(content='u w  u')
                sleep(0.5)
            await msg.delete()

        if message.content.count('kobiet') > 0:
            num = randint(1,100)
            if num == 50:
                await message.channel.send('jezu fuj, weź, kobiety <:tfu:614167432172535831>')

    if len(message.mentions) > 7:
        mentions_no_duplicates = []
        for i in message.mentions:
            if not i in mentions_no_duplicates:
                mentions_no_duplicates.append(i)
        if len(mentions_no_duplicates) > 10:
            message_member = message.guild.get_member(message.author.id)
            try: message_member.remove_roles(vrb.futrzak)
            except: pass
            try: message_member.remove_roles(vrb.nowy)
            except: pass
            await message_member.add_roles(vrb.izolatka)
            for i in vrb.nsfw_chans:
                try: await message_member.remove_roles(i)
                except: pass
            await vrb.tech_chan.send(f'{message.author.mention} oznaczyl wiecej niz 10 osob i dostal izloatke')

    if len(message.mentions) > 0 and client.get_user(614628305047388161) != message.author and message.content[0] != '-' and message.author != client.user:
        for member in message.mentions:
            if str(member.status) == 'idle':
                async for msg in message.channel.history(limit=25):
                    if msg.author.id == member.id:
                        return
                json_file = loads(read('commands/zw.json'))
                if str(member.id) in json_file['dnd']:
                    info = json_file['dnd'][str(member.id)]
                    e = Embed(color=member.color, timestamp=message.created_at)
                    e.set_author(name=f"Użytkownik afk")
                    e.set_thumbnail(url=member.avatar_url)
                    e.add_field(name=f"{member.display_name} jest afk, zostawił wiadomość", value=info)
                    e.set_footer(text='Wiadomość została zostawiona', icon_url=member.avatar_url)
                    await message.channel.send(embed=e)

    if message.content.lower() in responses and message.author != client.user:
        await message.channel.send(responses[message.content.lower()])