Skip to content

Commit a7389e6

Browse files
committed
Made freigabe() pep conform und streamlined Cog naming
1 parent 2aa0274 commit a7389e6

File tree

2 files changed

+11
-13
lines changed

2 files changed

+11
-13
lines changed

KiddoBot.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
from discord.ext import commands
1414
from music_handler import Music
1515
from help_system import HelpCommand
16-
from command_handler import KiddoBot
16+
from command_handler import Commands
1717
from weather_handler import Weather
1818

1919

@@ -79,7 +79,7 @@ async def on_ready():
7979

8080
print("Moiners werter Herr :3 <3")
8181

82-
await bot.add_cog(KiddoBot(bot))
82+
await bot.add_cog(Commands(bot))
8383
await bot.add_cog(Music(bot))
8484
await bot.add_cog(Weather(bot))
8585
await bot.tree.sync()

command_handler.py

Lines changed: 9 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,33 +1,31 @@
1-
import time
21
import random
3-
import typing
42
import asyncio
53
import discord
64
import requests
75
import yt_handler
8-
import music_handler
9-
import weather_handler
106
from Buttons import HL_Buttons, Setup_Button, Switch_Buttons
117
from discord.ext import commands
128
from help_system import HelpCommand
139

10+
1411
#from Sparboss_implement import SparbossCommand
1512

1613
# import pathlib
1714

1815

19-
class KiddoBot(commands.Cog):
16+
def freigabe():
17+
async def case(ctx):
18+
return (ctx.author.id == 695885580629704734) or (ctx.author.id == 408627107795828746)
19+
20+
return commands.check(case)
21+
22+
23+
class Commands(commands.Cog):
2024
bot = commands.AutoShardedBot(commands.when_mentioned_or('!!'), intents=discord.Intents.all())
2125

2226
def __init__(self, bot):
2327
self.bot = bot
2428

25-
def freigabe():
26-
async def case(ctx):
27-
return (ctx.author.id == 695885580629704734) or (ctx.author.id == 408627107795828746)
28-
29-
return commands.check(case)
30-
3129
@bot.hybrid_command()
3230
@freigabe()
3331
async def switchpls(self, ctx):

0 commit comments

Comments
 (0)