IT WORKS COMMANDS CAN BE RESTRICTED TO CHANNELS

testing
sgoudham 5 years ago
parent 147512a8ee
commit 11e4f4a007

@ -5,19 +5,16 @@ from discord.ext import commands
# Bot Prefix
client = commands.Bot(command_prefix='~')
# Instantiates a list for all the cogs
extensions = ['cogs.WaifuImages', 'cogs.FunCommands']
# server_id = 663651584399507476
@client.event
@client.command()
@commands.has_any_role('Hamothy')
async def users(ctx):
id = client.get_guild(663651584399507476)
server_id = client.get_guild(663651584399507476)
await ctx.send(f"""Number of Members: {id.member_count}""")
# Instantiates a list for all the cogs
extensions = ['cogs.WaifuImages', 'cogs.FunCommands']
await ctx.send(f"""Number of Members: {server_id.member_count}""")
# Calls the cogs
if __name__ == '__main__':

@ -11,6 +11,8 @@ class Fun(commands.Cog):
@commands.command(aliases=['8ball', '8Ball'])
@cooldown(1, 3, BucketType.channel)
async def _8ball(self, ctx, *, question):
channels = ["bot-commands"]
if str(ctx.channel) in channels:
responses = [
"Hamothy is preoccupied with catching a case",
"The prophet Kate believes it will come true",
@ -70,6 +72,5 @@ class Fun(commands.Cog):
]
await ctx.send(f'Question: {question}\nAnswer: {random.choice(responses)}')
def setup(bot):
bot.add_cog(Fun(bot))

@ -1,4 +1,5 @@
import random
import discord
from discord.ext import commands
from discord.ext.commands import BucketType, cooldown
@ -11,6 +12,8 @@ class Waifus(commands.Cog):
@commands.command(aliases=['Kakashi'])
@cooldown(1, 5, BucketType.channel)
async def kakashi(self, ctx):
channels = ["bot-commands"]
if str(ctx.channel) in channels:
kakashi1 = "https://cdn.discordapp.com/attachments/714671068941647933/717201077346238514/image0.jpg"
kakashi2 = "https://cdn.discordapp.com/attachments/714671068941647933/717201077669331036/image1.jpg"
kakashi3 = "https://cdn.discordapp.com/attachments/714671068941647933/717201077941829722/image2.jpg"

Loading…
Cancel
Save