First official build of bot!
Co-authored-by: iakrules <64628083+iakrules@noreply.github.com>
This commit is contained in:
parent
953c89ead0
commit
2b8e2345f9
32 changed files with 1164 additions and 383 deletions
23
cogs/owner/loaderCog.py
Normal file
23
cogs/owner/loaderCog.py
Normal file
|
|
@ -0,0 +1,23 @@
|
|||
import discord
|
||||
from discord.ext import commands
|
||||
|
||||
class LoaderCog(commands.Cog):
|
||||
|
||||
def __init__(self, bot):
|
||||
self.bot = bot
|
||||
|
||||
# Commands
|
||||
@commands.is_owner()
|
||||
@commands.command()
|
||||
async def load(self, ctx, extension):
|
||||
"""Loads a cog"""
|
||||
self.bot.load_extension(f'cogs.{extension}')
|
||||
|
||||
@commands.is_owner()
|
||||
@commands.command()
|
||||
async def unload(self, ctx, extension):
|
||||
"""Unloads a cog"""
|
||||
self.bot.unload_extension(f'cogs.{extension}')
|
||||
|
||||
def setup(bot):
|
||||
bot.add_cog(LoaderCog(bot))
|
||||
18
cogs/owner/sayCog.py
Normal file
18
cogs/owner/sayCog.py
Normal file
|
|
@ -0,0 +1,18 @@
|
|||
import discord
|
||||
from discord.ext import commands
|
||||
|
||||
class SayCog(commands.Cog):
|
||||
|
||||
def __init__(self, bot):
|
||||
self.bot = bot
|
||||
|
||||
# Commands
|
||||
@commands.command(aliases=['speak'])
|
||||
@commands.is_owner()
|
||||
async def say(self, ctx, *, content):
|
||||
"""Lets the bot say given arguments"""
|
||||
await ctx.message.delete()
|
||||
await ctx.send(content)
|
||||
|
||||
def setup(bot):
|
||||
bot.add_cog(SayCog(bot))
|
||||
29
cogs/owner/statusCog.py
Normal file
29
cogs/owner/statusCog.py
Normal file
|
|
@ -0,0 +1,29 @@
|
|||
import discord
|
||||
from discord.ext import commands
|
||||
|
||||
class StatusCog(commands.Cog):
|
||||
|
||||
def __init__(self, bot):
|
||||
self.bot = bot
|
||||
|
||||
# Commands
|
||||
@commands.command(aliases=['botstatus', 'stat'])
|
||||
@commands.is_owner()
|
||||
async def status(self, ctx):
|
||||
"""Gives bot statistics"""
|
||||
# Total members of all servers bot is in
|
||||
total_guild_users = 0
|
||||
for guild in ctx.bot.guilds:
|
||||
total_guild_users += guild.member_count
|
||||
|
||||
embed = discord.Embed(
|
||||
title=f"Bot Status",
|
||||
description=(f'`{ctx.bot.user.name}` is online.'
|
||||
f'\nBot is in `{len(ctx.bot.guilds)}` guilds.'
|
||||
f'\nGuilds have `{total_guild_users}` members.'),
|
||||
color=ctx.guild.get_member(ctx.bot.user.id).color
|
||||
)
|
||||
await ctx.send(embed=embed)
|
||||
|
||||
def setup(bot):
|
||||
bot.add_cog(StatusCog(bot))
|
||||
Loading…
Add table
Add a link
Reference in a new issue