Capitalize ENV vars
This commit is contained in:
18
aquabot.py
18
aquabot.py
@@ -25,11 +25,11 @@ import sys
|
||||
import os
|
||||
|
||||
# SET VARS
|
||||
prefix = os.environ['PREFIX']
|
||||
token = os.environ['TOKEN']
|
||||
reddit_client_id = os.environ['REDDIT_CLIENT_ID']
|
||||
reddit_client_secret = os.environ['REDDIT_CLIENT_SECRET']
|
||||
reddit_client_useragent = os.environ['REDDIT_CLIENT_USERAGENT']
|
||||
PREFIX = os.environ['PREFIX']
|
||||
TOKEN = os.environ['TOKEN']
|
||||
REDDIT_CLIENT_ID = os.environ['REDDIT_CLIENT_ID']
|
||||
REDDIT_CLIENT_SECRET = os.environ['REDDIT_CLIENT_SECRET']
|
||||
REDDIT_CLIENT_USERAGENT = os.environ['REDDIT_CLIENT_USERAGENT']
|
||||
|
||||
avatar = "https://i.redd.it/0uajctrps9u41.jpg"
|
||||
|
||||
@@ -47,7 +47,7 @@ logger.addHandler(handler)
|
||||
|
||||
# INIT
|
||||
bot = commands.Bot(
|
||||
command_prefix=prefix,
|
||||
command_prefix=PREFIX,
|
||||
description="Holy Goddess Aqua!")
|
||||
|
||||
# LOAD COGS
|
||||
@@ -81,14 +81,14 @@ async def on_ready():
|
||||
startup = f"""
|
||||
Bot Name: {bot.user.name} - {bot.user.id}\n
|
||||
Owner: {bot.AppInfo.owner}\n
|
||||
Command Prefix: {prefix}\n
|
||||
Command Prefix: {PREFIX}\n
|
||||
discord.py Version: {discord.__version__}\n
|
||||
python Version: {platform.python_version()}\n
|
||||
OS: {platform.system()} {platform.release()} {platform.version()}\n
|
||||
"""
|
||||
print(startup)
|
||||
|
||||
name = f"with water | {prefix}aquabot"
|
||||
name = f"with water | {PREFIX}aquabot"
|
||||
activity = discord.Activity(name=name, type=discord.ActivityType.playing)
|
||||
await bot.change_presence(activity=activity)
|
||||
|
||||
@@ -96,6 +96,6 @@ async def on_ready():
|
||||
|
||||
# START BOT
|
||||
bot.run(
|
||||
token,
|
||||
TOKEN,
|
||||
bot=True,
|
||||
reconnect=True)
|
||||
|
||||
@@ -7,7 +7,7 @@ import discord
|
||||
from discord.ext import commands
|
||||
|
||||
# IMPORTS - internal
|
||||
from __main__ import prefix
|
||||
from __main__ import PREFIX
|
||||
|
||||
# COG INIT
|
||||
class Help(commands.Cog):
|
||||
@@ -24,7 +24,7 @@ class Help(commands.Cog):
|
||||
embed.set_thumbnail(url=ctx.me.avatar_url)
|
||||
|
||||
embed.add_field(name="Owner", value=self.bot.AppInfo.owner, inline=True)
|
||||
embed.add_field(name="Command Prefix", value=prefix, inline=True)
|
||||
embed.add_field(name="Command Prefix", value=PREFIX, inline=True)
|
||||
embed.add_field(name="Source Code", value="[GitHub](https://github.com/crammk/aquabot)", inline=True)
|
||||
|
||||
footer_text = "This Bot is a project by [MarcMK](https://marcmk.de)."
|
||||
|
||||
@@ -9,9 +9,9 @@ import random
|
||||
import praw
|
||||
|
||||
# IMPORTS - internal
|
||||
from __main__ import reddit_client_id
|
||||
from __main__ import reddit_client_secret
|
||||
from __main__ import reddit_client_useragent
|
||||
from __main__ import REDDIT_CLIENT_ID
|
||||
from __main__ import REDDIT_CLIENT_SECRET
|
||||
from __main__ import REDDIT_CLIENT_USERAGENT
|
||||
|
||||
# COG INIT
|
||||
class Reddit(commands.Cog):
|
||||
@@ -24,9 +24,9 @@ class Reddit(commands.Cog):
|
||||
"""
|
||||
Send a post from a subreddit to chat
|
||||
"""
|
||||
reddit = praw.Reddit(client_id=reddit_client_id,
|
||||
client_secret=reddit_client_secret,
|
||||
user_agent=reddit_client_useragent)
|
||||
reddit = praw.Reddit(client_id=REDDIT_CLIENT_ID,
|
||||
client_secret=REDDIT_CLIENT_SECRET,
|
||||
user_agent=REDDIT_CLIENT_USERAGENT)
|
||||
|
||||
posts = reddit.subreddit(sub).hot()
|
||||
rand_post = random.randint(1, 100)
|
||||
|
||||
Reference in New Issue
Block a user