Some small improvements
This commit is contained in:
@@ -2,16 +2,14 @@
|
||||
Admin commands, that can be used from within the discord-client-chat
|
||||
"""
|
||||
|
||||
# IMPORTS
|
||||
import discord
|
||||
from discord.ext import commands
|
||||
|
||||
# COG INIT
|
||||
|
||||
class Admin(commands.Cog):
|
||||
def __init__(self, bot):
|
||||
self.bot = bot
|
||||
|
||||
# COG BODY
|
||||
|
||||
@commands.command(name="load", hidden=True)
|
||||
@commands.is_owner()
|
||||
async def load(self, ctx, *, cog: str):
|
||||
@@ -55,6 +53,5 @@ class Admin(commands.Cog):
|
||||
await ctx.send('**`SUCCESS`**')
|
||||
|
||||
|
||||
# COG ENDING
|
||||
def setup(bot):
|
||||
bot.add_cog(Admin(bot))
|
||||
|
||||
@@ -2,20 +2,17 @@
|
||||
Some anime-related commands
|
||||
"""
|
||||
|
||||
# IMPORTS - external
|
||||
import discord
|
||||
from discord.ext import commands
|
||||
import random
|
||||
|
||||
# IMPORTS - internal
|
||||
import loaddata
|
||||
|
||||
# COG INIT
|
||||
|
||||
class Anime(commands.Cog):
|
||||
def __init__(self, bot):
|
||||
self.bot = bot
|
||||
|
||||
# COG BODY
|
||||
|
||||
@commands.command(name="animepic")
|
||||
async def animemedia(self, ctx):
|
||||
"""
|
||||
@@ -26,6 +23,7 @@ class Anime(commands.Cog):
|
||||
media = random.choice(media_type)
|
||||
await ctx.send(media)
|
||||
|
||||
|
||||
@commands.command(name="waifupic")
|
||||
async def waifumedia(self, ctx, name: str):
|
||||
"""
|
||||
@@ -54,6 +52,5 @@ class Anime(commands.Cog):
|
||||
await ctx.send(text)
|
||||
|
||||
|
||||
# COG ENDING
|
||||
def setup(bot):
|
||||
bot.add_cog(Anime(bot))
|
||||
|
||||
@@ -2,19 +2,16 @@
|
||||
Some help for the users
|
||||
"""
|
||||
|
||||
# IMPORTS - external
|
||||
import discord
|
||||
from discord.ext import commands
|
||||
|
||||
# IMPORTS - internal
|
||||
from __main__ import PREFIX
|
||||
|
||||
# COG INIT
|
||||
|
||||
class Help(commands.Cog):
|
||||
def __init__(self, bot):
|
||||
self.bot = bot
|
||||
|
||||
# COG BODY
|
||||
|
||||
@commands.command(name="aquabot")
|
||||
async def aquabot(self, ctx):
|
||||
"""
|
||||
@@ -33,6 +30,5 @@ class Help(commands.Cog):
|
||||
await ctx.send(embed=embed)
|
||||
|
||||
|
||||
# COG ENDING
|
||||
def setup(bot):
|
||||
bot.add_cog(Help(bot))
|
||||
|
||||
@@ -2,20 +2,17 @@
|
||||
Send spicy memes to chat
|
||||
"""
|
||||
|
||||
# IMPORTS - external
|
||||
import discord
|
||||
from discord.ext import commands
|
||||
import random
|
||||
|
||||
# IMPORTS - internal
|
||||
import memes
|
||||
|
||||
# COG INIT
|
||||
|
||||
class Meme(commands.Cog):
|
||||
def __init__(self, bot):
|
||||
self.bot = bot
|
||||
|
||||
# COG BODY
|
||||
|
||||
@commands.command(name="meme")
|
||||
async def meme(self, ctx, meme: str):
|
||||
"""
|
||||
@@ -40,7 +37,5 @@ class Meme(commands.Cog):
|
||||
await ctx.send("Meme not found in database")
|
||||
|
||||
|
||||
|
||||
# COG ENDING
|
||||
def setup(bot):
|
||||
bot.add_cog(Meme(bot))
|
||||
|
||||
@@ -1,12 +1,10 @@
|
||||
"""
|
||||
Play Music
|
||||
|
||||
A COG NOT WRITTEN BY ME! ALTERED FROM THIS ONE:
|
||||
A COG ORIGINALLY CREATED BY ME, I ALTERED THIS ONE TO FIT MY NEEDS
|
||||
https://gist.github.com/vbe0201/ade9b80f2d3b64643d854938d40a0a2d
|
||||
"""
|
||||
|
||||
# IMPORTS - external
|
||||
import discord
|
||||
from discord.ext import commands
|
||||
import youtube_dl
|
||||
import functools
|
||||
@@ -16,7 +14,6 @@ import math
|
||||
import random
|
||||
from async_timeout import timeout
|
||||
|
||||
# COG BODY
|
||||
|
||||
class VoiceError(Exception):
|
||||
pass
|
||||
@@ -300,6 +297,7 @@ class Music(commands.Cog):
|
||||
ctx.voice_state.voice = await destination.connect()
|
||||
await ctx.message.add_reaction('🤙')
|
||||
|
||||
|
||||
@commands.command(name="leave", aliases=["dc"])
|
||||
async def leave(self, ctx: commands.Context):
|
||||
"""
|
||||
@@ -312,6 +310,7 @@ class Music(commands.Cog):
|
||||
del self.voice_states[ctx.guild.id]
|
||||
await ctx.message.add_reaction('👋')
|
||||
|
||||
|
||||
@commands.command(name="now", aliases=["np"])
|
||||
async def now(self, ctx: commands.Context):
|
||||
"""
|
||||
@@ -319,6 +318,7 @@ class Music(commands.Cog):
|
||||
"""
|
||||
await ctx.send(embed=ctx.voice_state.current.create_embed())
|
||||
|
||||
|
||||
@commands.command(name='pause')
|
||||
async def pause(self, ctx: commands.Context):
|
||||
"""
|
||||
@@ -328,6 +328,7 @@ class Music(commands.Cog):
|
||||
ctx.voice_state.voice.pause()
|
||||
await ctx.message.add_reaction('⏯')
|
||||
|
||||
|
||||
@commands.command(name='resume')
|
||||
async def resume(self, ctx: commands.Context):
|
||||
"""
|
||||
@@ -337,6 +338,7 @@ class Music(commands.Cog):
|
||||
ctx.voice_state.voice.resume()
|
||||
await ctx.message.add_reaction('⏯')
|
||||
|
||||
|
||||
@commands.command(name="skip")
|
||||
async def skip(self, ctx: commands.Context):
|
||||
"""
|
||||
@@ -348,6 +350,7 @@ class Music(commands.Cog):
|
||||
await ctx.message.add_reaction('⏭')
|
||||
ctx.voice_state.skip()
|
||||
|
||||
|
||||
@commands.command(name="clear")
|
||||
async def clear(self, ctx: commands.Context):
|
||||
"""
|
||||
@@ -356,6 +359,7 @@ class Music(commands.Cog):
|
||||
ctx.voice_state.songs.clear()
|
||||
await ctx.message.add_reaction('⏹')
|
||||
|
||||
|
||||
@commands.command(name='play')
|
||||
async def play(self, ctx: commands.Context, *, search: str):
|
||||
"""
|
||||
@@ -376,6 +380,7 @@ class Music(commands.Cog):
|
||||
await ctx.voice_state.songs.put(song)
|
||||
await ctx.send('Enqueued {}'.format(str(source)))
|
||||
|
||||
|
||||
@join.before_invoke
|
||||
@play.before_invoke
|
||||
async def ensure_voice_state(self, ctx: commands.Context):
|
||||
@@ -423,6 +428,6 @@ class Music(commands.Cog):
|
||||
.set_footer(text='Viewing page {}/{}'.format(page, pages)))
|
||||
await ctx.send(embed=embed)
|
||||
|
||||
# COG ENDING
|
||||
|
||||
def setup(bot):
|
||||
bot.add_cog(Music(bot))
|
||||
|
||||
@@ -2,23 +2,20 @@
|
||||
Fetch pictures from subreddits
|
||||
"""
|
||||
|
||||
# IMPORTS - external
|
||||
import discord
|
||||
from discord.ext import commands
|
||||
import random
|
||||
import praw
|
||||
|
||||
# IMPORTS - internal
|
||||
from __main__ import REDDIT_CLIENT_ID
|
||||
from __main__ import REDDIT_CLIENT_SECRET
|
||||
from __main__ import REDDIT_CLIENT_USERAGENT
|
||||
|
||||
# COG INIT
|
||||
|
||||
class Reddit(commands.Cog):
|
||||
def __init__(self, bot):
|
||||
self.bot = bot
|
||||
|
||||
# COG BODY
|
||||
|
||||
@commands.command(name="reddit")
|
||||
async def reddit(self, ctx, sub: str):
|
||||
"""
|
||||
@@ -37,6 +34,6 @@ class Reddit(commands.Cog):
|
||||
await ctx.send(f"> '{post.title}' by {post.author.name}")
|
||||
await ctx.send(post.url)
|
||||
|
||||
# COG ENDING
|
||||
|
||||
def setup(bot):
|
||||
bot.add_cog(Reddit(bot))
|
||||
|
||||
@@ -2,18 +2,15 @@
|
||||
A simple reminder option
|
||||
"""
|
||||
|
||||
# IMPORTS
|
||||
import discord
|
||||
from discord.ext import commands
|
||||
|
||||
# COG INIT
|
||||
|
||||
class Reminder(commands.Cog):
|
||||
def __init__(self, bot):
|
||||
self.bot = bot
|
||||
|
||||
# COG BODY
|
||||
|
||||
|
||||
# COG ENDING
|
||||
|
||||
def setup(bot):
|
||||
bot.add_cog(Reminder(bot))
|
||||
|
||||
@@ -2,17 +2,15 @@
|
||||
Some (more or less) handy utility
|
||||
"""
|
||||
|
||||
# IMPORTS - external
|
||||
import discord
|
||||
from discord.ext import commands
|
||||
import random
|
||||
|
||||
# COG INIT
|
||||
|
||||
class Utility(commands.Cog):
|
||||
def __init__(self, bot):
|
||||
self.bot = bot
|
||||
|
||||
# COG BODY
|
||||
|
||||
@commands.command(name="invitelink", aliases=["invite"])
|
||||
async def invite_link(self, ctx, age=60*10, uses=100):
|
||||
"""
|
||||
@@ -57,6 +55,5 @@ class Utility(commands.Cog):
|
||||
await ctx.send(response)
|
||||
|
||||
|
||||
# COG ENDING
|
||||
def setup(bot):
|
||||
bot.add_cog(Utility(bot))
|
||||
|
||||
@@ -2,16 +2,14 @@
|
||||
Welcoming new users etc.
|
||||
"""
|
||||
|
||||
# IMPORTS
|
||||
import discord
|
||||
from discord.ext import commands
|
||||
|
||||
# COG INIT
|
||||
|
||||
class Welcome(commands.Cog):
|
||||
def __init__(self, bot):
|
||||
self.bot = bot
|
||||
|
||||
# COG BODY
|
||||
|
||||
@commands.Cog.listener()
|
||||
async def on_member_join(self, member):
|
||||
"""
|
||||
@@ -30,6 +28,5 @@ class Welcome(commands.Cog):
|
||||
await ctx.send(f"Hello {ctx.author.mention}!")
|
||||
|
||||
|
||||
# COG ENDING
|
||||
def setup(bot):
|
||||
bot.add_cog(Welcome(bot))
|
||||
|
||||
Reference in New Issue
Block a user