Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/main'
Browse files Browse the repository at this point in the history
# Conflicts:
#	cogs/setserver.py
  • Loading branch information
JoshuaSlui committed Jan 31, 2023
2 parents 52e31b2 + 0296265 commit 21c936c
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 12 deletions.
3 changes: 1 addition & 2 deletions CONFIGURATION.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
# Configuration
Pingernos py offers three different ways to configure it, a config file, environment variables and a .env
If you wish to use the config file, just copy the [example.config.json](./example.config.json) to a new file called config.json in the root folder and modify the options in it.
If you wish to use environment variables, you must set the `use_json` variable in [getdata](./utils.py) to `False`.
If you wish to use the config file, you must set the `use_json` variable in [getdata](./utils.py) to `True` and copy the [example.config.json](./example.config.json) to a new file called config.json in the root folder and modify the options in it.
If you wish to use a .env file, just copy the [example.env](./example.env) to a new file called .env in the root folder and modify the options in it, you can use environment variables and a .env file at the same time if you so desire.
Environment variables use `SCREAMING_SNAKE_CASE`, the configuration file uses `PascalCase`.

Expand Down
4 changes: 2 additions & 2 deletions cogs/checkip.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,10 +28,10 @@ async def checkip(self, ctx, address = None):
server = await JavaServer.async_lookup(address)
stat = await server.async_status()
if stat.version.name == "⚠ Error":
embed.description=f"**{nip}.aternos.me** is free to use!\nTo use it as your server address, head to **[the options of your server](https://aternos.org/options)**"
embed.description=f"**{address}** is free to use!\nTo use it as your server address, head to **[the options of your server](https://aternos.org/options)**"
embed.colour = Utils.Colors.green
else:
embed.description=f"**{nip}.aternos.me** is already taken!"
embed.description=f"**{address}** is already taken!"
embed.colour = Utils.Colors.red
await ctx.respond(embed=embed)

Expand Down
13 changes: 6 additions & 7 deletions cogs/setserver.py
Original file line number Diff line number Diff line change
@@ -1,14 +1,13 @@
from discord.ext import commands, bridge
from discord.ext import commands#, bridge
class SetServer(commands.Cog):
def __init__(self, bot):
self.bot = bot

@bridge.bridge_command(aliases=["set"], description="Set the default server to use if no argument is provided in the status command.")
async def setserver(self, ctx, server = None):
return await ctx.respond("We are working hard to add this command back. Please manually use the status command for now.")
# if server is None:
# return await ctx.respond("Please provide a server IP.")
# await ctx.defer()
#@bridge.bridge_command(aliases=["set"], description="Set the default server to use if no argument is provided in the status command.")
#async def setserver(self, ctx, server = None):
# if server is None:
# return await ctx.respond("Please provide a server IP.")
# await ctx.defer()
#This is up to Miataboy to implement

def setup(bot):
Expand Down
2 changes: 1 addition & 1 deletion utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ class Colors:
orange = 0xfaa61a
@staticmethod
def get_data() -> dict:
usejson = False #Set to False to use enviorment variables instead of config.json
usejson = False #Set to True to a config.json
if usejson:
try:
with open('config.json', 'r', encoding="UTF-8") as file:
Expand Down

0 comments on commit 21c936c

Please sign in to comment.