Python discord.__version__() Examples
The following are 10
code examples of discord.__version__().
You can vote up the ones you like or vote down the ones you don't like,
and go to the original project or source file by following the links above each example.
You may also want to check out all available functions/classes of the module
discord
, or try the search function
.
Example #1
Source File: util.py From DueUtil with GNU General Public License v3.0 | 6 votes |
def botinfo(ctx, **_): """ [CMD_KEY]botinfo General information about DueUtil. """ info_embed = discord.Embed(title="DueUtil's Information", type="rich", color=gconf.DUE_COLOUR) info_embed.description = "DueUtil is customizable bot to add fun commands, quests and battles to your server." info_embed.add_field(name="Created by", value="[MacDue#4453](https://dueutil.tech/)") info_embed.add_field(name="Framework", value="[discord.py %s :two_hearts:](http://discordpy.readthedocs.io/en/latest/)" % discord.__version__) info_embed.add_field(name="Version", value=gconf.VERSION), info_embed.add_field(name="Invite Due!", value="https://dueutil.tech/invite", inline=False) info_embed.add_field(name="Support server", value="For help with the bot or a laugh join **https://discord.gg/n4b94VA**!") await util.say(ctx.channel, embed=info_embed)
Example #2
Source File: general.py From modmail with GNU Affero General Public License v3.0 | 5 votes |
def stats(self, ctx): guilds = sum(await self.bot.cogs["Communication"].handler("guild_count", self.bot.cluster_count)) channels = sum(await self.bot.cogs["Communication"].handler("channel_count", self.bot.cluster_count)) users = sum(await self.bot.cogs["Communication"].handler("user_count", self.bot.cluster_count)) embed = discord.Embed(title=f"{self.bot.user.name} Statistics", colour=self.bot.primary_colour) embed.add_field(name="Owner", value="CHamburr#2591") embed.add_field(name="Bot Version", value=self.bot.version) embed.add_field(name="Uptime", value=self.get_bot_uptime(brief=True)) embed.add_field(name="Clusters", value=f"{self.bot.cluster}/{self.bot.cluster_count}") if ctx.guild: embed.add_field(name="Shards", value=f"{ctx.guild.shard_id + 1}/{self.bot.shard_count}") else: embed.add_field(name="Shards", value=f"{self.bot.shard_count}") embed.add_field(name="Servers", value=str(guilds)) embed.add_field(name="Channels", value=str(channels)) embed.add_field(name="Users", value=str(users)) embed.add_field(name="CPU Usage", value=f"{psutil.cpu_percent()}%") embed.add_field(name="RAM Usage", value=f"{psutil.virtual_memory().percent}%") embed.add_field(name="Python Version", value=platform.python_version()) embed.add_field(name="discord.py Version", value=discord.__version__) embed.set_thumbnail(url=self.bot.user.avatar_url) embed.set_footer( text=f"Made with ❤ using discord.py", icon_url="https://www.python.org/static/opengraph-icon-200x200.png", ) await ctx.send(embed=embed)
Example #3
Source File: nullctf.py From NullCTF with GNU General Public License v3.0 | 5 votes |
def on_ready(): print(f"{bot.user.name} - Online") print(f"discord.py {discord.__version__}\n") print("-------------------------------") await bot.change_presence(activity=discord.Game(name=">help | >report \"x\""))
Example #4
Source File: botinformation.py From apex-sigma-core with GNU General Public License v3.0 | 5 votes |
def botinformation(cmd, pld): """ :param cmd: The command object referenced in the command. :type cmd: sigma.core.mechanics.command.SigmaCommand :param pld: The payload with execution data and details. :type pld: sigma.core.mechanics.payload.CommandPayload """ version = cmd.bot.info.get_version() authors = cmd.bot.info.get_authors().authors full_version = f'{version.major}.{version.minor}.{version.patch}' if version.beta: full_version += ' Beta' sigma_title = f'Apex Sigma: v{full_version} {version.codename}' env_text = f'Language: **Python** {sys.version.split()[0]}' env_text += f'\nLibrary: **discord.py** {discord.__version__}' env_text += f'\nPlatform: **{sys.platform.upper()}**' auth_text = '' for author in authors: auth = await cmd.bot.get_user(author.id) if auth: auth_text += f'\n**{auth.name}**#{auth.discriminator}' else: auth_text += f'\n**{author.name}**#{author.discriminator}' response = discord.Embed(color=0x1B6F5F, timestamp=arrow.get(version.timestamp).datetime) response.set_author(name=sigma_title, icon_url=sigma_image, url=support_url) response.add_field(name='Authors', value=auth_text) response.add_field(name='Environment', value=env_text) response.set_footer(text=f'Last updated {arrow.get(version.timestamp).humanize()}') await pld.msg.channel.send(embed=response)
Example #5
Source File: run.py From rhinobot_heroku with MIT License | 5 votes |
def req_check_deps(): try: import discord if discord.version_info.major < 1: log.critical("This version of MusicBot requires a newer version of discord.py (1.0+). Your version is {0}. Try running update.py.".format(discord.__version__)) bugger_off() except ImportError: # if we can't import discord.py, an error will be thrown later down the line anyway pass
Example #6
Source File: bot.py From graham_discord_bot with MIT License | 5 votes |
def on_ready(): logger.info(f"Starting Graham v{__version__}") logger.info(f"Discord.py version {discord.__version__}") logger.info(f"Bot name: {client.user.name}") logger.info(f"Bot Discord ID: {client.user.id}") await client.change_presence(activity=discord.Game(config.playing_status)) # Process any transactions in our DB that are outstanding logger.info(f"Re-queueing any unprocessed transactions") unprocessed_txs = await Transaction.filter(block_hash=None, destination__not_isnull=True).all().prefetch_related('sending_user', 'receiving_user') for tx in unprocessed_txs: await TransactionQueue.instance(bot=client).put(tx) logger.info(f"Re-queued {len(unprocessed_txs)} transactions")
Example #7
Source File: nanochan.py From nano-chan with MIT License | 5 votes |
def __init__(self, config, misc_config, logger, test, pg_controller: PostgresController, chanreact, blacklist): """ init for bot class """ self.pg_controller = pg_controller self.start_time = int(time()) self.version = discord.__version__ if test: self.credentials = os.environ['TOKEN'] else: self.credentials = config['token'] self.guild_id = config['guild_id'] self.mod_log = config['mod_log'] self.mod_info = config['mod_info'] self.emoji_ignore_channels = config['emoji_ignore_channels'] self.traffic_ignore_channels = config['traffic_ignore_channels'] self.filter_channels = config['filter_channels'] self.filter_allowed = config['filter_allowed'] self.spoiler_channels = config['spoiler_channels'] self.wait_time = config['wait_time'] self.clover_days = config['clover_days'] self.dm_forward = config['dm_forward'] self.timeout_id = misc_config['timeout_id'] self.logger = logger self.chanreact = chanreact self.blglobal = blacklist super().__init__('-')
Example #8
Source File: run.py From MusicBot with MIT License | 5 votes |
def req_check_deps(): try: import discord if discord.version_info.major < 1: log.critical("This version of MusicBot requires a newer version of discord.py (1.0+). Your version is {0}. Try running update.py.".format(discord.__version__)) bugger_off() except ImportError: # if we can't import discord.py, an error will be thrown later down the line anyway pass
Example #9
Source File: utility.py From discord_bot with MIT License | 5 votes |
def status(self, ctx): '''Infos über den Bot''' timeUp = time.time() - self.bot.startTime hours = timeUp / 3600 minutes = (timeUp / 60) % 60 seconds = timeUp % 60 admin = self.bot.AppInfo.owner users = 0 channel = 0 if len(self.bot.commands_used.items()): commandsChart = sorted(self.bot.commands_used.items(), key=lambda t: t[1], reverse=False) topCommand = commandsChart.pop() commandsInfo = '{} (Top-Command: {} x {})'.format(sum(self.bot.commands_used.values()), topCommand[1], topCommand[0]) else: commandsInfo = str(sum(self.bot.commands_used.values())) for guild in self.bot.guilds: users += len(guild.members) channel += len(guild.channels) embed = discord.Embed(color=ctx.me.top_role.colour) embed.set_footer(text='Dieser Bot ist Open-Source auf GitHub: https://github.com/Der-Eddy/discord_bot') embed.set_thumbnail(url=ctx.me.avatar_url) embed.add_field(name='Admin', value=admin, inline=False) embed.add_field(name='Uptime', value='{0:.0f} Stunden, {1:.0f} Minuten und {2:.0f} Sekunden\n'.format(hours, minutes, seconds), inline=False) embed.add_field(name='Beobachtete Benutzer', value=users, inline=True) embed.add_field(name='Beobachtete Server', value=len(self.bot.guilds), inline=True) embed.add_field(name='Beobachtete Channel', value=channel, inline=True) embed.add_field(name='Ausgeführte Commands', value=commandsInfo, inline=True) embed.add_field(name='Bot Version', value=self.bot.botVersion, inline=True) embed.add_field(name='Discord.py Version', value=discord.__version__, inline=True) embed.add_field(name='Python Version', value=platform.python_version(), inline=True) # embed.add_field(name='Speicher Auslastung', value=f'{round(memory_usage(-1)[0], 3)} MB', inline=True) embed.add_field(name='Betriebssystem', value=f'{platform.system()} {platform.release()} {platform.version()}', inline=False) await ctx.send('**:information_source:** Informationen über diesen Bot:', embed=embed)
Example #10
Source File: main.py From discord_bot with MIT License | 5 votes |
def on_ready(): if bot.user.id == 701915238488080457: bot.dev = True else: bot.dev = False print('Logged in as') print(f'Bot-Name: {bot.user.name}') print(f'Bot-ID: {bot.user.id}') print(f'Dev Mode: {bot.dev}') print(f'Discord Version: {discord.__version__}') print(f'Bot Version: {__version__}') bot.AppInfo = await bot.application_info() print(f'Owner: {bot.AppInfo.owner}') print('------') for cog in loadconfig.__cogs__: try: bot.load_extension(cog) except Exception: print(f'Couldn\'t load cog {cog}') bot.commands_used = Counter() bot.startTime = time.time() bot.botVersion = __version__ bot.userAgentHeaders = {'User-Agent': f'linux:shinobu_discordbot:v{__version__} (by Der-Eddy)'} bot.gamesLoop = asyncio.ensure_future(_randomGame()) _setupDatabase('reaction.db')