Exemplo n.º 1
0
 def __init__(self):
     self.bot = None
     intents = discord.Intents.default()
     intents.members = True
     super().__init__(
         command_prefix=self.get_prefix,
         case_insensitive=True,
         intents=intents,
         owner_ids={809587169520910346},
         description="Penguin is a simple and easy-to-use Discord bot"
     )
     self._BotBase__cogs = commands.core._CaseInsensitiveDict()
     self.author_id = 809587169520910346
     self.session = aiohttp.ClientSession()
     self.embed_color = 0x89CFF0# discord.Color.green()  # 0x9c5cb4
     self.prefixes = collections.defaultdict(list)
     self.command_list = []
     self.deleted_messages = collections.defaultdict(list)
     self.default_prefix = 'p!'
     self.config = config
     self.support_invite = "https://discord.gg/NTNgvHkjSp"
     self.invite = "https://discord.com/oauth2/authorize?client_id=810570659968057384&scope=bot&permissions=70646849"
     self.alex = alexflipnote.Client(self.get_config('alex_api_key'))
     self.timetime = time.time()
     self.case_insensitive = True
     self.perspective = self.get_config("perspective_key")
Exemplo n.º 2
0
 def run(self, *args, **kwargs):
     # self.ipc.start()
     subprocess.check_output("pip install speedtest-cli", shell=True)
     self.before_invoke(self.start_typing)
     self.utils = utils
     self.deleted_message_cache = LimitedSizeDict()
     self.concurrency = []
     self.color = 0x00ff6a
     self.psutil_process = psutil.Process()
     self._message_cache = {}
     self.prefixes = {}
     self.socket_receive = 0
     self.start_time = time.time()
     self.socket_stats = Counter()
     self.command_counter = 0
     self.commandsusages = Counter()
     self.session = aiohttp.ClientSession(
         headers={
             "User-Agent":
             f"python-requests/2.25.1 The Anime Bot/1.1.0 Python/{sys.version_info[0]}.{sys.version_info[1]}.{sys.version_info[2]} aiohttp/{aiohttp.__version__}"
         })
     self.mystbin = mystbin.Client(session=self.session)
     self.vacefron_api = vacefron.Client(session=self.session,
                                         loop=self.loop)
     self.dag = Client(api_token, session=self.session, loop=self.loop)
     self.alex = alexflipnote.Client(alex_,
                                     session=self.session,
                                     loop=self.loop)
     self.ball = eight_ball.ball()
     self.zaneapi = aiozaneapi.Client(zane_api)
     for command in self.commands:
         self.command_list.append(str(command))
         self.command_list.extend([alias for alias in command.aliases])
         if isinstance(command, commands.Group):
             for subcommand in command.commands:
                 self.command_list.append(str(subcommand))
                 self.command_list.extend([
                     f"{command} {subcommand_alias}"
                     for subcommand_alias in subcommand.aliases
                 ])
                 if isinstance(subcommand, commands.Group):
                     for subcommand2 in subcommand.commands:
                         self.command_list.append(str(subcommand2))
                         self.command_list.extend([
                             f"{subcommand} {subcommand2_alias}"
                             for subcommand2_alias in subcommand2.aliases
                         ])
                         if isinstance(subcommand2, commands.Group):
                             for subcommand3 in subcommand2.commands:
                                 self.command_list.append(str(subcommand3))
                                 self.command_list.extend([
                                     f"{subcommand2} {subcommand3_alias}"
                                     for subcommand3_alias in
                                     subcommand3.aliases
                                 ])
     super().run(*args, **kwargs)
Exemplo n.º 3
0
    def __init__(self, *args, **kwargs):
        super().__init__(*args, **kwargs)
        self._BotBase__cogs = commands.core._CaseInsensitiveDict()

        # Base variables for core functionality
        with open("config.toml") as f:
            self.settings = toml.loads(f.read())
        self.session = aiohttp.ClientSession()
        self.embed_color = 0x89CFF0

        self.support_invite = self.settings["misc"]["support_server_invite"]
        self.invite = self.settings["misc"]["invite"]

        # Cache so I don't have to use DB
        self.prefixes = collections.defaultdict(list)
        self.default_prefix = "p!"
        self.command_list = []
        self.afk = {}
        self.highlights = {}
        self.blacklist = {}
        self.usage_counter = 0
        self.command_usage = collections.Counter()

        # Webhooks
        self.error_webhook = discord.Webhook.from_url(
            self.settings["misc"]["error_webhook"],
            adapter=discord.AsyncWebhookAdapter(self.session),
        )
        self.guild_webhook = discord.Webhook.from_url(
            self.settings["misc"]["guild_webhook"],
            adapter=discord.AsyncWebhookAdapter(self.session),
        )

        # API stuff
        self.alex = alexflipnote.Client(self.settings["keys"]["alexflipnote"])
        self.perspective = self.settings["keys"]["perspective"]

        # Bot management
        self.maintenance = False
        self.context = commands.Context
Exemplo n.º 4
0
 def __init__(self):
     self.bot = None
     intents = discord.Intents.default()
     intents.members = True
     intents.presences = True
     super().__init__(command_prefix=self.get_prefix,
                      case_insensitive=True,
                      intents=intents,
                      owner_ids={809587169520910346},
                      description='system 32 will be deleted')
     self._BotBase__cogs = commands.core._CaseInsensitiveDict()
     self.author_id = 809587169520910346
     self.session = aiohttp.ClientSession()
     self.embed_color = discord.Color.green()  #0x9c5cb4
     self.prefixes = {}
     self.command_list = []
     self.deleted_messages = collections.defaultdict(list)
     self.default_prefix = 'ch!'
     self.alex = alexflipnote.Client(self.get_config('alex_api_key'))
     self.timetime = time.time()
     self.case_insensitive = True
     self.perspective = self.get_config("perspective_key")
Exemplo n.º 5
0
import discord
from discord.ext import commands
import os
import requests, json, string, random
from PIL import Image, ImageDraw, ImageFont, ImageFilter
from datetime import datetime
import urllib.parse
import alexflipnote
import time, asyncio

#this is the fun cog


alex = alexflipnote.Client("A4r4T7opKWOTnLnwOXDLYKLnlEkvi2cbgkIMTci5")

rkey = os.environ['rkey']
def em(ctx,title, msg):
  e = discord.Embed(title=title, description=msg, color= ctx.author.color)
  return e
def err(msg):
  er = discord.Embed(title="", description='', color=0xe74c3c)
  er.set_author(name=msg,icon_url="https://cdn.discordapp.com/attachments/804212727869866006/824902921505865749/772509.png")
  return er
prefix = os.environ['prefix']

class Fun(commands.Cog):


  def __init__(self, bot):
    self.bot = bot
Exemplo n.º 6
0
 def __init__(self, bot):
     self.bot = bot
     self.afapi = alexflipnote.Client(os.getenv('AF_TOKEN'),
                                      loop=self.bot.loop)
     self.srapi = sr_api.Client()
Exemplo n.º 7
0
 def __init__(self, bot):
     self.bot = bot
     self.bot.alex = alexflipnote.Client(flipnotetoken)
Exemplo n.º 8
0
from keep_alive import keep_alive
import wikipedia
from youtube import GetYoutubeVideo
from discord_slash import SlashCommand, SlashContext
import asyncio

###################################
#this sets all the variable and values required
defaults = os.listdir()
description = 'description'
intents = discord.Intents.default()
intents.members = True
bot = commands.Bot(command_prefix='+',
                   description=description,
                   intents=intents)
alex_api = alexflipnote.Client(os.getenv("apitoken"))
cogs = ["on_message"]
slash = SlashCommand(bot)


#####################################
#bot event... basically tells you the bot has started
#and shows affirimation to the console
@bot.event
async def on_ready():
    print('Logged in as')
    print(bot.user.name)
    print(bot.user.id)
    print('------')
    print("The bot is ready!")
    for cog in cogs: