Parcourir la source

removed local init_db.py to get new remote version

root il y a 1 an
Parent
commit
eb57869dd9
3 fichiers modifiés avec 6 ajouts et 97 suppressions
  1. 3 3
      README.md
  2. 3 3
      bot/events/angels.py
  3. 0 91
      bot/query/initialise_database.py

+ 3 - 3
README.md

@@ -2,8 +2,8 @@
 A Discord robot for the Angels Discord written in Python.
 
 ## Requirements
-* Python3
-* PostgreSQL (libpq-dev) 
+* Python3 & the python3-dev pacakge
+* PostgreSQL
 * Web server gateway interface like uWSGI or Gunicorn
 * A discord token
 
@@ -29,4 +29,4 @@ Expose django to the web. (TODO: more details)
 * https://fomantic-ui.com/introduction/getting-started.html
 
 ### Theming
-* https://fomantic-ui.com/usage/theming.html
+* https://fomantic-ui.com/usage/theming.html

+ 3 - 3
bot/events/angels.py

@@ -12,9 +12,9 @@ class AngelEvents(commands.Cog):
 
 	@commands.Cog.listener()
 	async def on_message(self, message: discord.Message):
-		feed_channels = [1184948763614253187]
+		feed_channels = [1184948763614253187, 1185045883985858610]
 		if message.channel.id in feed_channels:
-			news_channel = self.bot.get_channel(971796738484625468)
+			news_channel = self.bot.get_channel(1002655345795158077)
 			if message.type == discord.MessageType.channel_follow_add:
 				source_channel = self.bot.get_channel(message.reference.channel_id)
 				if source_channel:
@@ -29,4 +29,4 @@ class AngelEvents(commands.Cog):
 						source_invite = await source_channel.create_invite(unique=False, reason="Linking back to discord of which news is being repeated.")
 						msg = await news_channel.send(f"**[{message.author.name}](<{source_invite.url}>)**:\n\n{message.clean_content}")
 					else:
-						await news_channel.send("**" + message.author.name + "**:\n\n" + message.clean_content)
+						await news_channel.send("**" + message.author.name + "**:\n\n" + message.clean_content)

+ 0 - 91
bot/query/initialise_database.py

@@ -1,91 +0,0 @@
-async def check_db(pg):
-    await pg.fetchval("SELECT * FROM \"user\"")
-
-async def init_db(pg):
-    queries = [
-        "CREATE TABLE IF NOT EXISTS \
-            guild (\
-                id SERIAL PRIMARY KEY, \
-                guild_id BIGINT UNIQUE NOT NULL, \
-                report_deleted BOOL DEFAULT FALSE, \
-                report_edited BOOL DEFAULT FALSE\
-            )\
-        ",
-        "CREATE TABLE IF NOT EXISTS \
-            channel (\
-                id SERIAL PRIMARY KEY, \
-                channel_id BIGINT UNIQUE NOT NULL, \
-                guild BIGINT REFERENCES guild (guild_id), \
-                interact BOOL DEFAULT FALSE, \
-                games BOOL DEFAULT FALSE\
-            )\
-        ",
-        "ALTER TABLE guild \
-            ADD COLUMN output_channel BIGINT REFERENCES channel (channel_id) \
-        ",
-        "CREATE TABLE IF NOT EXISTS \
-            settings (\
-                id SERIAL PRIMARY KEY, \
-                crew_channel_id BIGINT UNIQUE NOT NULL\
-            )\
-        ",
-#        "CREATE TABLE IF NOT EXISTS \
-#            channel_settings (\
-#                id SERIAL PRIMARY KEY, \
-#                channel BIGINT UNIQUE NOT NULL REFERENCES channel (channel_id), \
-#                guild BIGINT REFERENCES guild (guild_id)\
-#            )\
-#        ",
-        "CREATE TABLE IF NOT EXISTS \
-            \"user\" (\
-                id SERIAL PRIMARY KEY, \
-                user_id BIGINT UNIQUE NOT NULL, \
-                ignore BOOL DEFAULT FALSE, \
-                level INT DEFAULT 0, \
-                xp_spent INT DEFAULT 0, \
-                invites_created INT DEFAULT 0, \
-                integrations_created INT DEFAULT 0, \
-                member_updated INT DEFAULT 0, \
-                user_updated INT DEFAULT 0, \
-                member_banned INT DEFAULT 0, \
-                member_unbanned INT DEFAULT 0, \
-                presence_updated INT DEFAULT 0, \
-                messages_edited INT DEFAULT 0, \
-                messages_deleted INT DEFAULT 0, \
-                reacted INT DEFAULT 0, \
-                events_created INT DEFAULT 0, \
-                events_joined INT DEFAULT 0, \
-                threads_created INT DEFAULT 0, \
-                threads_joined INT DEFAULT 0, \
-                ability_points_spent INT DEFAULT 0, \
-                coin INT DEFAULT 0, \
-                karma INT DEFAULT 0, \
-                defence_skill INT DEFAULT 0, \
-                attack_skill  INT DEFAULT 0, \
-                stealth_skill INT DEFAULT 0, \
-                perception_skill INT DEFAULT 0, \
-                theft_skill INT DEFAULT 0, \
-                created TIMESTAMP NOT NULL DEFAULT now()\
-            )\
-        ",
-        "CREATE TABLE IF NOT EXISTS \
-            guild_access_token (\
-                id SERIAL PRIMARY KEY, \
-                guild BIGINT REFERENCES guild (guild_id), \
-                \"user\" BIGINT NOT NULL REFERENCES \"user\" (user_id), \
-                token varchar[40] UNIQUE NOT NULL, \
-                created TIMESTAMP NOT NULL DEFAULT now()\
-            )\
-        ",
-        "CREATE TABLE IF NOT EXISTS \
-            channel_user (\
-                id SERIAL PRIMARY KEY, \
-                channel BIGINT NOT NULL REFERENCES channel (channel_id), \
-                \"user\" BIGINT NOT NULL REFERENCES \"user\" (user_id), \
-                total_messages BIGINT DEFAULT 1, \
-                UNIQUE (channel, \"user\")\
-            )\
-        ",
-    ]
-    for query in queries:
-        await pg.execute(query)