From af3d6a7edba9f6582f4c8e1179ed5d81a38208b8 Mon Sep 17 00:00:00 2001 From: Zevaryx Date: Fri, 16 Jul 2021 18:13:09 -0600 Subject: [PATCH] Restrict dbrand and ctc2 commands to Stark Industry and dbrand servers --- jarvis/cogs/ctc2.py | 6 ++++-- jarvis/cogs/dbrand.py | 27 +++++++++++++++------------ 2 files changed, 19 insertions(+), 14 deletions(-) diff --git a/jarvis/cogs/ctc2.py b/jarvis/cogs/ctc2.py index 5c5729f..2a07c0a 100644 --- a/jarvis/cogs/ctc2.py +++ b/jarvis/cogs/ctc2.py @@ -6,6 +6,8 @@ import jarvis from jarvis.config import get_config from jarvis.utils.db import DBManager +guild_ids = [578757004059738142, 520021794380447745, 862402786116763668] + class CTCCog(commands.Cog): def __init__(self, bot): @@ -19,7 +21,7 @@ class CTCCog(commands.Cog): base="ctc2", name="about", description="CTC2 related commands", - guild_ids=[862402786116763668, 578757004059738142], + guild_ids=guild_ids, ) async def _about(self, ctx): await ctx.send("See https://completethecode.com for more information") @@ -28,7 +30,7 @@ class CTCCog(commands.Cog): base="ctc2", name="pw", description="Guess a password for https://completethecodetwo.cards", - guild_ids=[862402786116763668, 578757004059738142], + guild_ids=guild_ids, ) async def _pw(self, ctx, guess: str): guessed = self.db.ctc2.guesses.find_one({"guess": guess}) diff --git a/jarvis/cogs/dbrand.py b/jarvis/cogs/dbrand.py index c001deb..2d9823f 100644 --- a/jarvis/cogs/dbrand.py +++ b/jarvis/cogs/dbrand.py @@ -1,15 +1,18 @@ import re import aiohttp -import jarvis from discord.ext import commands from discord_slash import cog_ext from discord_slash.utils.manage_commands import create_option + +import jarvis from jarvis.config import get_config from jarvis.data.dbrand import shipping_lookup from jarvis.utils import build_embed from jarvis.utils.field import Field +guild_ids = [578757004059738142, 520021794380447745, 862402786116763668] + class DbrandCog(commands.Cog): """ @@ -29,7 +32,7 @@ class DbrandCog(commands.Cog): @cog_ext.cog_subcommand( base="db", name="skin", - guild_ids=[862402786116763668, 578757004059738142], + guild_ids=guild_ids, description="See what skins are available", ) async def _skin(self, ctx): @@ -38,7 +41,7 @@ class DbrandCog(commands.Cog): @cog_ext.cog_subcommand( base="db", name="robotcamo", - guild_ids=[862402786116763668, 578757004059738142], + guild_ids=guild_ids, description="Get some robot camo. Make Tony Stark proud", ) async def _camo(self, ctx): @@ -47,7 +50,7 @@ class DbrandCog(commands.Cog): @cog_ext.cog_subcommand( base="db", name="grip", - guild_ids=[862402786116763668, 578757004059738142], + guild_ids=guild_ids, description="See devices with Grip support", ) async def _grip(self, ctx): @@ -56,7 +59,7 @@ class DbrandCog(commands.Cog): @cog_ext.cog_subcommand( base="db", name="contact", - guild_ids=[862402786116763668, 578757004059738142], + guild_ids=guild_ids, description="Contact support", ) async def _contact(self, ctx): @@ -67,7 +70,7 @@ class DbrandCog(commands.Cog): @cog_ext.cog_subcommand( base="db", name="support", - guild_ids=[862402786116763668, 578757004059738142], + guild_ids=guild_ids, description="Contact support", ) async def _support(self, ctx): @@ -78,7 +81,7 @@ class DbrandCog(commands.Cog): @cog_ext.cog_subcommand( base="db", name="orderstat", - guild_ids=[862402786116763668, 578757004059738142], + guild_ids=guild_ids, description="Get your order status", ) async def _orderstat(self, ctx): @@ -87,7 +90,7 @@ class DbrandCog(commands.Cog): @cog_ext.cog_subcommand( base="db", name="orders", - guild_ids=[862402786116763668, 578757004059738142], + guild_ids=guild_ids, description="Get your order status", ) async def _orders(self, ctx): @@ -96,7 +99,7 @@ class DbrandCog(commands.Cog): @cog_ext.cog_subcommand( base="db", name="status", - guild_ids=[862402786116763668, 578757004059738142], + guild_ids=guild_ids, description="dbrand status", ) async def _status(self, ctx): @@ -105,7 +108,7 @@ class DbrandCog(commands.Cog): @cog_ext.cog_subcommand( base="db", name="buy", - guild_ids=[862402786116763668, 578757004059738142], + guild_ids=guild_ids, description="Give us your money!", ) async def _buy(self, ctx): @@ -114,7 +117,7 @@ class DbrandCog(commands.Cog): @cog_ext.cog_subcommand( base="db", name="extortion", - guild_ids=[862402786116763668, 578757004059738142], + guild_ids=guild_ids, description="(not) extortion", ) async def _extort(self, ctx): @@ -126,7 +129,7 @@ class DbrandCog(commands.Cog): base="db", name="ship", description="Get shipping information for your country", - guild_ids=[862402786116763668, 578757004059738142], + guild_ids=guild_ids, options=[ ( create_option(