From 1c50615bf3b76c6b5d10eae193b707bd01d02d01 Mon Sep 17 00:00:00 2001 From: ReneCareenium Date: Mon, 20 Sep 2021 12:47:07 +0200 Subject: [PATCH] made it ignore most channels --- rengobot.py | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/rengobot.py b/rengobot.py index 1257556..03d9491 100644 --- a/rengobot.py +++ b/rengobot.py @@ -4,7 +4,6 @@ import time from datetime import datetime, timedelta import asyncio -#395277704007778325 import sgfengine import discord @@ -27,6 +26,9 @@ admins=[ 756220448118669463, # Young Sun 477895596141707264 # René ] +awesome_server_id= 767835617002258443 +permitted_channel_ids= [ 875353143867752489, 885498819385634816, 878649716269785150, 881984021192671242] + white_stone= "<:white_stone:882731089548939314>" black_stone= "<:black_stone:882730888453046342>" @@ -39,6 +41,7 @@ format="%Y_%m_%d_%H_%M_%S_%f" @bot.command() async def help(ctx): + if ctx.guild.id == awesome_server_id and ctx.channel.id not in permitted_channel_ids: return await ctx.send( '$help : shows this help\n\n'+ @@ -58,6 +61,7 @@ async def help(ctx): @bot.command() async def play(ctx, arg): + if ctx.guild.id == awesome_server_id and ctx.channel.id not in permitted_channel_ids: return channel_id= ctx.channel.id user = ctx.author guild= ctx.guild @@ -135,6 +139,7 @@ async def play(ctx, arg): @bot.command() async def edit(ctx, arg): #literally play but with less things + if ctx.guild.id == awesome_server_id and ctx.channel.id not in permitted_channel_ids: return # It should wait until the queue has 4 players or so channel_id= ctx.channel.id user = ctx.author @@ -183,6 +188,7 @@ async def edit(ctx, arg): #literally play but with less things @bot.command() async def board(ctx): + if ctx.guild.id == awesome_server_id and ctx.channel.id not in permitted_channel_ids: return channel_id= ctx.channel.id user = ctx.author guild= ctx.guild @@ -211,6 +217,7 @@ async def board(ctx): @bot.command() async def join(ctx): + if ctx.guild.id == awesome_server_id and ctx.channel.id not in permitted_channel_ids: return channel_id= ctx.channel.id user = ctx.author @@ -241,6 +248,7 @@ async def join(ctx): @bot.command() async def leave(ctx): + if ctx.guild.id == awesome_server_id and ctx.channel.id not in permitted_channel_ids: return channel_id= ctx.channel.id user = ctx.author @@ -271,6 +279,7 @@ async def leave(ctx): @bot.command() async def queue(ctx): + if ctx.guild.id == awesome_server_id and ctx.channel.id not in permitted_channel_ids: return channel_id= ctx.channel.id channel= bot.get_channel(channel_id) # thonk the order guild = channel.guild @@ -344,11 +353,13 @@ async def queue(ctx): @bot.command() async def sgf(ctx): + if ctx.guild.id == awesome_server_id and ctx.channel.id not in permitted_channel_ids: return file = discord.File(str(ctx.channel.id)+".sgf") await ctx.send(file=file) @bot.command() async def newgame(ctx, arg): + if ctx.guild.id == awesome_server_id and ctx.channel.id not in permitted_channel_ids: return channel_id= ctx.channel.id user = ctx.author @@ -380,6 +391,7 @@ async def newgame(ctx, arg): @bot.command() async def resign(ctx, arg): + if ctx.guild.id == awesome_server_id and ctx.channel.id not in permitted_channel_ids: return channel_id= ctx.channel.id user = ctx.author