update
This commit is contained in:
1 parent
73f97cfb20
commit
e6c5285b86
2 files changed
+10
-1
No files matched your search
@@ -14,6 +14,7 @@ from contextlib import redirect_stdout
|
|||||||
import aiofiles
|
import aiofiles
|
||||||
import aiohttp
|
import aiohttp
|
||||||
import discord
|
import discord
|
||||||
|
import pnwkit
|
||||||
from discord.ext import commands
|
from discord.ext import commands
|
||||||
|
|
||||||
from utils.paginator import Paginator
|
from utils.paginator import Paginator
|
||||||
@@ -27,6 +28,12 @@ class REPL(commands.Cog):
|
|||||||
self._last_result = None
|
self._last_result = None
|
||||||
self.sessions = set()
|
self.sessions = set()
|
||||||
self.session = aiohttp.ClientSession(loop=bot.loop)
|
self.session = aiohttp.ClientSession(loop=bot.loop)
|
||||||
|
self.kit = pnwkit.QueryKit(
|
||||||
|
api_key=os.getenv("pnwAPIKEY"),
|
||||||
|
bot_key=os.getenv("pnwBOTKEY"),
|
||||||
|
bot_key_api_key=os.getenv("pnwACCKEY"),
|
||||||
|
aiohttp_session=aiohttp.ClientSession(loop=self.bot.loop),
|
||||||
|
)
|
||||||
|
|
||||||
def cleanup_code(self, content):
|
def cleanup_code(self, content):
|
||||||
"Automatically removes code blocks from the code."
|
"Automatically removes code blocks from the code."
|
||||||
|
|||||||
+3
-1
@@ -496,9 +496,11 @@ class WarMonitor(commands.Cog):
|
|||||||
async def inrange(self, ctx: CustomCtx):
|
async def inrange(self, ctx: CustomCtx):
|
||||||
category = await self.bot.fetch_channel(CATEGORY)
|
category = await self.bot.fetch_channel(CATEGORY)
|
||||||
if ctx.channel not in category.text_channels:
|
if ctx.channel not in category.text_channels:
|
||||||
await ctx.send(f"this command only works inside {category.name}")
|
await ctx.send(f"this command only works inside {category.name}", delete_after=5)
|
||||||
return
|
return
|
||||||
id = int(ctx.channel.name.split("-")[-1])
|
id = int(ctx.channel.name.split("-")[-1])
|
||||||
|
if not id:
|
||||||
|
return await ctx.send("> can only use in tracked war channels with IDs in their name.")
|
||||||
await self.calc_inrange(id, ctx.channel)
|
await self.calc_inrange(id, ctx.channel)
|
||||||
|
|
||||||
async def setup(bot: Brahmos):
|
async def setup(bot: Brahmos):
|
||||||
|
|||||||
Reference in new issue
Block a user