Some small improvements
This commit is contained in:
@@ -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))
|
||||
|
||||
Reference in New Issue
Block a user