This commit is contained in:
Ian Burgess 2024-06-22 19:32:58 -06:00
parent 109bd3cec2
commit 0a544b1dde
6 changed files with 14 additions and 11 deletions

7
bot.py
View File

@ -1,11 +1,12 @@
from os import environ as env from os import environ as env
import discord import discord
from discord.ext import bridge from discord.ext import bridge, commands
from motor.motor_asyncio import AsyncIOMotorClient as MongoClient from motor.motor_asyncio import AsyncIOMotorClient as MongoClient
from bin.storage import storage from bin.storage import storage
bot = bridge.Bot( bot = bridge.Bot(
help_command=None, help_command=commands.MinimalHelpCommand(),
description="!help for more info",
command_prefix="!", command_prefix="!",
intents=discord.Intents.all(), intents=discord.Intents.all(),
activity=discord.Activity( activity=discord.Activity(
@ -15,7 +16,7 @@ bot = bridge.Bot(
# 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"

View File

@ -29,13 +29,13 @@ 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 {await store('counting', 'channel')}") await ctx.respond(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, count:int):
store = storage(ctx.guild.id, self.bot.store).store store = storage(ctx.guild.id, self.bot.db).store
await store('counting', 'count', args) await store('counting', 'count', count)
await ctx.send(f"count set to {args}") await ctx.respond(f"count set to {count}")

View File

View File

@ -22,7 +22,5 @@ class Misc(commands.Cog):
print("------") print("------")
def setup(bot): def setup(bot):
bot.add_cog(Misc(bot)) bot.add_cog(Misc(bot))

View File

@ -8,6 +8,9 @@ class Settings(commands.Cog):
@bridge.bridge_group(aliases=["set", "s"], invoke_without_command=True) @bridge.bridge_group(aliases=["set", "s"], invoke_without_command=True)
async def settings(self, ctx): async def settings(self, ctx):
await ctx.respond("invalid command, see !help settings for more info") await ctx.respond("invalid command, see !help settings for more info")
@settings.command()

View File

@ -1,4 +1,5 @@
py-cord[audio] py-cord[audio]
pymongo pymongo
PyNaCl PyNaCl
motor motor
wavelink