Esempio n. 1
0
    async def commands(self, ctx):
        if str(ctx.author.id) in ranks:
            embed = discord.Embed(
                title="Command List: \n",
                description=f"{prefix}cmds => Shows this Message\n"
                f"{prefix}announce => Sending a Announcement though all Servers (Botowner only)\n"
                f"{prefix}addglobal => Setup Globalchat in a Channel\n"
                f"{prefix}removeglobal => Removes GlobalChat from a channel\n"
                f"{prefix}serverlist => Shows Servernames where im in\n"
                f"{prefix}joke => Generating a random joke using a API\n"
                f"\n\n[Support-Server]({supportinvite}) | [Bot-Invite]({botinvite}) | [GitHub]({githuburl})",
                color=ownercolor)

            embed.set_author(name=f"[Bot Developer] {ctx.author.name}",
                             icon_url=f"{owneremojiurl}")
            embed.set_thumbnail(url=f'{ctx.author.avatar_url}')
            embed.set_footer(
                text=f"User ID: {ctx.author.id} | Sent from: {ctx.guild.name}",
                icon_url=f"{ctx.author.avatar_url}")
            embed.timestamp = datetime.utcnow()
            await ctx.send(embed=embed)
            await ctx.message.delete()

        else:
            if not str(ctx.author.id) in ranks:
                embed = discord.Embed(
                    title="Command List: \n",
                    description=f"{prefix}cmds => Shows this Message\n"
                    f"{prefix}announce => Sending a Announcement though all Servers (Botowner only)\n"
                    f"{prefix}addglobal => Setup Globalchat in a Channel\n"
                    f"{prefix}removeglobal => Removes GlobalChat from a channel\n"
                    f"{prefix}serverlist => Shows Servernames where im in\n"
                    f"{prefix}joke => Generating a random joke using a API\n"
                    f"\n\n[Support-Server]({supportinvite}) | [Bot-Invite]({botinvite}) | [GitHub]({githuburl})",
                    color=commandcolor)

                embed.set_author(name=f"Unranked Normie | {ctx.author.name}",
                                 icon_url=f"{emojiurl}")
                embed.set_thumbnail(url=f"{ctx.author.avatar_url}")
                embed.set_footer(
                    text=
                    f"User ID: {ctx.author.id} | Sent from: {ctx.guild.name}",
                    icon_url=f"{ctx.author.avatar_url}")
                embed.timestamp = datetime.utcnow()
                await ctx.channel.send(embed=embed)
                await ctx.message.delete()
Esempio n. 2
0
	async def serverlist(self, ctx):
		serverlist = [server.name for server in bot.guilds]

		embed = discord.Embed(
			title=f"All Servers im curretly in: ({len(serverlist)})",
			description=" \n".join(serverlist),
			color=commandcolor
		)
		embed.set_thumbnail(url=f"{ctx.guild.icon_url}")
		embed.set_footer(text=f"Requested by: {ctx.author.name}", icon_url=f"{ctx.author.avatar_url}")
		embed.timestamp = datetime.utcnow()
		await ctx.message.delete()
		await ctx.send(embed=embed)
Esempio n. 3
0
    async def userinfo(self, ctx, member: discord.Member = None):

        if member is not None:
            # de = pytz.timezone('Europe/Berlin')
            embed = discord.Embed(
                title=f'> Userinfo for {member.display_name} | {ctx.author.id}',
                description='',
                color=0x4cd137)  # , timestamp=datetime.now().astimezone(tz=de)

            embed.add_field(
                name='Name',
                value=f'```{member.name}#{member.discriminator}```',
                inline=True)
            embed.add_field(
                name='Bot',
                value=
                f'```{("Look hes a Botuser lol" if member.bot else "Hes a Human imagine that!")}```',
                inline=True)
            embed.add_field(
                name='Nickname',
                value=
                f'```{(member.nick if member.nick else "No current Servernickname found!")}```',
                inline=True)
            for guildMember in ctx.guild.members:
                if guildMember == member:
                    embed.add_field(name='Server Joindate',
                                    value=f'```{member.joined_at}```',
                                    inline=True)
            embed.add_field(name='Account creation',
                            value=f'```{member.created_at}```',
                            inline=True)
            embed.add_field(name='Roles',
                            value=f'```{len(member.roles) -1}```',
                            inline=True)
            embed.add_field(name='Highest Role',
                            value=f'```{member.top_role.name}```',
                            inline=True)
            embed.add_field(name='Color',
                            value=f'```{member.color}```',
                            inline=True)
            embed.add_field(
                name='Booster',
                value=
                f'```{("Yes this guy is a booster :)" if member.premium_since else "No Booster :(")}```',
                inline=True)
            embed.set_footer(text=f'Developer: {developer}',
                             icon_url=ctx.author.avatar_url)
            await ctx.send(embed=embed)

        elif member is None:
            await ctx.channel.send("Member not found!")
Esempio n. 4
0
async def announce(ctx, *, text):
    if str(ctx.author.id) not in ranks:
        embed = discord.Embed(
            title="Globalbot Errormessage: \n",
            description=
            "You are missing Botowner permission(s) to run this command.\n"
            f"\n\n[Support-Server]({supportinvite}) | [Bot-Invite]({botinvite}) | [GitHub]({githuburl})",
            color=commandcolor)

        embed.set_author(name=f"{ctx.author.name}", icon_url=f"{emojiurl}")
        embed.set_thumbnail(url=f"{ctx.author.avatar_url}")
        embed.set_footer(
            text=f"User ID: {ctx.author.id} | Sent from: {ctx.guild.name}",
            icon_url=f"{ctx.author.avatar_url}")
        embed.timestamp = datetime.utcnow()
        await ctx.send(embed=embed)
        await ctx.message.delete()

    elif str(ctx.author.id) in ranks:
        embed = discord.Embed(
            title="➜ Important Announcement!",
            description=
            f"{text} \n\n[Support-Server]({supportinvite}) | [Bot-Invite]({botinvite}) | [GitHub]({githuburl})",
            color=announcecolor)
        embed.set_thumbnail(url=f"{ctx.author.avatar_url}")
        embed.set_footer(
            text=f"User ID: {ctx.author.id} | Sent from: {ctx.guild.name}",
            icon_url=f"{ctx.author.avatar_url}")
        embed.timestamp = datetime.utcnow()

        for server in servers["servers"]:
            guild: Guild = bot.get_guild(int(server["guildid"]))
            if guild:
                channel: TextChannel = guild.get_channel(
                    int(server["channelid"]))
                if channel:
                    await channel.send(embed=embed)
        await ctx.message.delete()
Esempio n. 5
0
async def removeglobal(ctx):
    if guild_exists(ctx.guild.id):
        globalid = get_globalchat_id(ctx.guild.id)
        if globalid != -1:
            servers["servers"].pop(globalid)
            with open('servers.json', 'w') as f:
                json.dump(servers, f, indent=4)

        embed = discord.Embed(
            description=
            f"Sucessfully removed Globalchat from Channel: {ctx.channel.mention}.",
            color=0xc0392b)

        await ctx.send(embed=embed)
        await ctx.message.delete()
Esempio n. 6
0
async def addglobal(ctx):
    if not guild_exists(ctx.guild.id):
        server = {
            "guildid": ctx.guild.id,
            "guild_name": ctx.guild.name,
            "channelid": ctx.channel.id,
            "invite": f'{(await ctx.channel.create_invite()).url}'
        }

        servers["servers"].append(server)
        with open('servers.json', 'w') as f:
            json.dump(servers, f, indent=4)

        if not str(ctx.author.id) in ranks or str(ctx.author.id) in ranks:
            await ctx.message.delete()
            embed = discord.Embed(
                title='New Globalchat Added!',
                description=
                f'The Server: `{ctx.guild.name}` with a total of `{len(ctx.guild.members)} Members` is now in the Globalgang!',
                color=0x1abc9c)

            embed.set_thumbnail(url=f"{ctx.author.avatar_url}")
            embed.set_footer(text='Sent from Server {}'.format(ctx.guild.name),
                             icon_url=f"{ctx.guild.icon_url}")

            links = f"[Support-Server]({supportinvite}) | [Bot Invite]({botinvite}) | [GitHub]({githuburl})"

            embed.add_field(name='⠀', value='⠀', inline=False)
            embed.add_field(name='Links & Help', value=links, inline=False)

            for server in servers["servers"]:
                guild: Guild = bot.get_guild(int(server["guildid"]))
                if guild:
                    if guild.id is ctx.guild.id:
                        continue
                    channel: TextChannel = guild.get_channel(
                        int(server["channelid"]))
                    if channel:
                        perms: Permissions = channel.permissions_for(
                            guild.get_member(bot.user.id))
                        if perms.send_messages:
                            if perms.embed_links and perms.attach_files and perms.external_emojis:
                                await channel.send(embed=embed)
                            else:
                                await channel.send(
                                    'I not have enough Permissions. I need following:'
                                    '`Send Messages` `Embed Links` `Attach Files`'
                                    '`Use External Emojis`')
Esempio n. 7
0
    async def unlock(self, ctx, channel):

        # Get channel
        channel = re.findall(r'\d+', channel)  # Get only numbers from channel
        channel = self.bot.get_channel(int(channel[0]))

        if channel:
            await channel.edit(name=channel.name.replace("🔒-", "", 1))
            await channel.set_permissions(ctx.guild.default_role,
                                          send_messages=True)
            embed = discord.Embed(
                title=f"#{channel.name} unlocked with success!",
                description=f"",
                color=0x2fa737)  # Green
            await ctx.channel.send(embed=embed)
        else:
            await ctx.channel.send("Channel not found!")
Esempio n. 8
0
async def sendAll(message, member):
    bad_words = ["Hurensohn", "ficke", "Ficker", "Wichser", "bitch"]
    bad_word_detection = []

    for word in message.content.split():
        if word not in bad_words:
            bad_word_detection.append(False)
        else:
            bad_word_detection.append(True)

    if True in bad_word_detection:
        embed = discord.Embed(
            title="Blacklisted Word Detected! \n",
            description=
            f"I have detected that you used {word} what is blacklisted. Please stop doing that!\n"
            f"Words on Blacklist:\n {bad_words}"
            f"\n\n[Support-Server]({supportinvite}) | [Bot-Invite]({botinvite}) | [GitHub]({githuburl})",
            color=commandcolor)

        embed.set_author(name=f"{message.author.name}", icon_url=f"{emojiurl}")
        embed.set_thumbnail(url=f"{message.author.avatar_url}")
        embed.set_footer(
            text=
            f"User ID: {message.author.id} | Sent from: {message.guild.name}",
            icon_url=f"{message.author.avatar_url}")
        embed.timestamp = datetime.utcnow()
        await message.channel.send(embed=embed)
        await message.delete()

    else:

        # If user is Blacklised:
        if str(message.author.id) in blacklist:
            await message.channel.send(
                f"{message.author.mention} You are not allowed to use the Bot during your Blacklist!"
            )
            return

        # Wenn UserID  nicht in ranks variable: #
        if not str(message.author.id) in ranks:
            embed = discord.Embed(
                title="",
                description=
                f"{message.content} \n\n[Support-Server]({supportinvite}) | [Bot-Invite]({botinvite}) | [GitHub]({githuburl})",
                color=usercolor)

            embed.set_author(name=f"{member.name}", icon_url=f"{emojiurl}")
            embed.set_thumbnail(url=f"{message.author.avatar_url}")
            embed.set_footer(
                text=
                f"User ID: {message.author.id} | Sent from: {message.guild.name}",
                icon_url=f"{message.author.avatar_url}")
            embed.timestamp = datetime.utcnow()

            for server in servers["servers"]:
                guild: Guild = bot.get_guild(int(server["guildid"]))
                if guild:
                    channel: TextChannel = guild.get_channel(
                        int(server["channelid"]))
                    if channel:
                        await channel.send(embed=embed)
            await message.delete()

        # Wenn UserID in ranks variable: #
        if str(message.author.id) in ranks:
            embed = discord.Embed(
                title="",
                description=
                f"{message.content} \n\n[Support-Server]({supportinvite}) | [Bot-Invite]({botinvite}) | [GitHub]({githuburl})",
                color=ownercolor)

            embed.set_author(name=f"{member.name} [Bot Developer]",
                             icon_url=f"{emojiurl}")
            embed.set_thumbnail(url=f"{message.author.avatar_url}")
            embed.set_footer(
                text=
                f"User ID: {message.author.id} | Sent from: {message.guild.name}",
                icon_url=f"{message.author.avatar_url}")
            embed.timestamp = datetime.utcnow()

            for server in servers["servers"]:
                guild: Guild = bot.get_guild(int(server["guildid"]))
                if guild:
                    channel: TextChannel = guild.get_channel(
                        int(server["channelid"]))
                    if channel:
                        await channel.send(embed=embed)
            await message.delete()