From 6c603a953e29f90a54a67e8a0f4d3ac2d399365e Mon Sep 17 00:00:00 2001 From: Etzelia Date: Wed, 29 Aug 2018 11:03:50 -0500 Subject: [PATCH 1/4] Add cogs to setup.py I forgot, this will also be needed to make a dist. --- setup.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/setup.py b/setup.py index 2980556..2809e04 100644 --- a/setup.py +++ b/setup.py @@ -3,7 +3,7 @@ from distutils.core import setup setup( name='Geoffrey', version=__import__('geoffrey').__version__, - packages=['geoffrey'], + packages=['geoffrey', 'geoffrey.cogs'], install_requires=['discord.py', 'SQLAlchemy', 'pymysql', 'requests'], long_description=open('README.txt').read(), ) From 8db428019ff0bf61997d6d24c106ad141fdce8cb Mon Sep 17 00:00:00 2001 From: Etzelia Date: Wed, 29 Aug 2018 11:20:00 -0500 Subject: [PATCH 2/4] Update change_presence Discord.py updated their method to use an activity instead. Based on their example, this should work. --- geoffrey/bot.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/geoffrey/bot.py b/geoffrey/bot.py index f0de364..f24f0a4 100644 --- a/geoffrey/bot.py +++ b/geoffrey/bot.py @@ -52,7 +52,7 @@ async def on_ready(): info = await bot.application_info() url = oauth_url(info.id) logger.info("Bot url: %s", url) - await bot.change_presence(game=Game(name=bot_config.status)) + await bot.change_presence(activity=Game(bot_config.status)) @bot.event From e89c3cc76644aba0427c51e12b3696e7ddbd505f Mon Sep 17 00:00:00 2001 From: Etzelia Date: Wed, 29 Aug 2018 11:21:24 -0500 Subject: [PATCH 3/4] Updated change_presence in mod command --- geoffrey/cogs/Admin_Commands.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/geoffrey/cogs/Admin_Commands.py b/geoffrey/cogs/Admin_Commands.py index 71d3964..fdd2a5a 100644 --- a/geoffrey/cogs/Admin_Commands.py +++ b/geoffrey/cogs/Admin_Commands.py @@ -122,7 +122,7 @@ class Admin_Commands: """ Updates "playing [game]" status of the bot. """ - await self.bot.change_presence(game=Game(name=status)) + await self.bot.change_presence(activity=Game(status)) await self.bot.say('{}, status has been changed'.format(ctx.message.author.mention)) From ae4715123735e904c2b4dedfe9021a99e5c61d2e Mon Sep 17 00:00:00 2001 From: Etzelia Date: Wed, 29 Aug 2018 11:27:49 -0500 Subject: [PATCH 4/4] Change table names --- geoffrey/DatabaseModels.py | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/geoffrey/DatabaseModels.py b/geoffrey/DatabaseModels.py index 559b9b6..5112849 100644 --- a/geoffrey/DatabaseModels.py +++ b/geoffrey/DatabaseModels.py @@ -121,7 +121,7 @@ class Dimension(enum.Enum): class Player(SQL_Base): - __tablename__ = 'Players' + __tablename__ = 'geoffrey_players' id = Column(Integer, primary_key=True, autoincrement=True) mc_uuid = Column(String(128)) discord_uuid = Column(String(128)) @@ -140,7 +140,7 @@ class Player(SQL_Base): class Tunnel(SQL_Base): - __tablename__ = 'Tunnels' + __tablename__ = 'geoffrey_tunnels' id = Column(Integer, primary_key=True, autoincrement=True) tunnel_number = Column(Integer) tunnel_direction = Column(Enum(TunnelDirection)) @@ -171,7 +171,7 @@ class Tunnel(SQL_Base): class Location(SQL_Base): - __tablename__ = 'Locations' + __tablename__ = 'geoffrey_locations' id = Column(Integer, primary_key=True) name = Column(String(128), unique=True) @@ -228,7 +228,7 @@ class Location(SQL_Base): class Base(Location): - __tablename__ = 'Bases' + __tablename__ = 'geoffrey_bases' base_id = Column(Integer, ForeignKey('Locations.id', ondelete='CASCADE'), primary_key=True) name = column_property(Column(String(128)), Location.name) @@ -238,7 +238,7 @@ class Base(Location): class Shop(Location): - __tablename__ = 'Shops' + __tablename__ = 'geoffrey_shops' shop_id = Column(Integer, ForeignKey('Locations.id', ondelete='CASCADE'), primary_key=True) name = column_property(Column(String(128)), Location.name) inventory = relationship('ItemListing', back_populates='shop', cascade='all, delete-orphan', lazy='dynamic') @@ -270,7 +270,7 @@ class Shop(Location): class ItemListing(SQL_Base): - __tablename__ = 'Items' + __tablename__ = 'geoffrey_items' id = Column(Integer, primary_key=True, autoincrement=True) name = Column(String(128)) @@ -290,4 +290,4 @@ class ItemListing(SQL_Base): return '**{}** **{}** for **{}D**'.format(self.amount, self.name, self.price) def __str__(self): - return '**{}**, selling {}'.format(self.shop.name, self.listing_str()) \ No newline at end of file + return '**{}**, selling {}'.format(self.shop.name, self.listing_str())