refactor
This commit is contained in:
parent
0823552a2d
commit
109bd3cec2
14
bot.py
14
bot.py
@ -13,22 +13,14 @@ bot = bridge.Bot(
|
|||||||
name="you")
|
name="you")
|
||||||
)
|
)
|
||||||
|
|
||||||
bot.load_extension("cogs.triggers")
|
# bot.load_extension("cogs.triggers")
|
||||||
bot.load_extension("cogs.counting")
|
bot.load_extension("cogs.counting")
|
||||||
bot.load_extension("cogs.settings")
|
# bot.load_extension("cogs.settings")
|
||||||
bot.load_extension("cogs.misc")
|
bot.load_extension("cogs.misc")
|
||||||
|
|
||||||
uri = f"mongodb://{env['DB_USERNAME']}:{env['DB_PASSWORD']}@{env['DB_HOST']}/?authSource=admin"
|
uri = f"mongodb://{env['DB_USERNAME']}:{env['DB_PASSWORD']}@{env['DB_HOST']}/?authSource=admin"
|
||||||
bot.db = MongoClient(uri)["turdbot"]
|
bot.db = MongoClient(uri)["turdbot"]
|
||||||
|
|
||||||
bot.version = "4.0.0ALPHA"
|
bot.version = "4.5.0BETA"
|
||||||
|
|
||||||
@bot.event
|
|
||||||
async def on_ready():
|
|
||||||
print("Logged in as")
|
|
||||||
print(bot.user.name)
|
|
||||||
print(bot.user.id)
|
|
||||||
print(bot.version)
|
|
||||||
print("------")
|
|
||||||
|
|
||||||
bot.run(env["BOT_TOKEN"])
|
bot.run(env["BOT_TOKEN"])
|
||||||
@ -29,7 +29,7 @@ class Counting(commands.Cog):
|
|||||||
async def channel(self, ctx):
|
async def channel(self, ctx):
|
||||||
store = storage(ctx.guild.id, self.bot.db).store
|
store = storage(ctx.guild.id, self.bot.db).store
|
||||||
await store('counting', 'channel', ctx.channel.id)
|
await store('counting', 'channel', ctx.channel.id)
|
||||||
await ctx.send(f"counting channel set to {store('counting', 'channel')}")
|
await ctx.send(f"counting channel set to {await store('counting', 'channel')}")
|
||||||
|
|
||||||
@bridge.bridge_command()
|
@bridge.bridge_command()
|
||||||
async def setcount(self, ctx, args):
|
async def setcount(self, ctx, args):
|
||||||
|
|||||||
10
cogs/misc.py
10
cogs/misc.py
@ -12,6 +12,16 @@ class Misc(commands.Cog):
|
|||||||
@bridge.bridge_command()
|
@bridge.bridge_command()
|
||||||
async def version(self, ctx):
|
async def version(self, ctx):
|
||||||
await ctx.send(self.bot.version)
|
await ctx.send(self.bot.version)
|
||||||
|
|
||||||
|
@commands.Cog.listener()
|
||||||
|
async def on_ready(self):
|
||||||
|
print("Logged in as")
|
||||||
|
print(self.bot.user.name)
|
||||||
|
print(self.bot.user.id)
|
||||||
|
print(self.bot.version)
|
||||||
|
print("------")
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
def setup(bot):
|
def setup(bot):
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user