-
Notifications
You must be signed in to change notification settings - Fork 3
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Linking #19
base: master
Are you sure you want to change the base?
Linking #19
Conversation
Created a very crude account linking method that allows the user to link a steam account to 1 discord account (discord accounts can only have 1 linked account but steam accounts can have multiple connected discord accounts). Also created a text file to store linked accounts
Didn't think leaving my bot token would be a good idea :P
@@ -0,0 +1 @@ | |||
298910672731766784:76561198404047726 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This does not need to be committed.
But I like the format of it
@@ -274,9 +276,49 @@ def chunks(l, n): | |||
args = ctx.message.content.split(" ") | |||
|
|||
if len(args) < 2: | |||
await bot.send_message(ctx.message.channel, | |||
PastUsers = open("UserIDs.txt", "r+") | |||
NotLinked = True |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We should load this at bot startup instead of at every call
except ImportError: | ||
print('Unable to run bot, as token does not exist!') | ||
sys.exit() | ||
|
||
bot = Bot(BOT_PREFIX) | ||
bot.remove_command("help") | ||
|
||
NotLinked = True |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
load it into a map at bot startup and then not have a global variable
@@ -13,14 +13,16 @@ | |||
from discord.ext.commands import Bot | |||
|
|||
try: | |||
from config import TOKEN, BOT_PREFIX | |||
from config_example import TOKEN, BOT_PREFIX |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This needs to be reverted.
async def test(ctx): | ||
#Gets id that is being linked to | ||
args = ctx.message.content.split(" ") | ||
UserID = args[1] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Snake case for all variables please.
for line in PastUsers: | ||
check = line | ||
check = check.strip() | ||
check = check.split(":") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Same thing as the other comment. Possibly put this code in a function so you don't have to write it twice.
Co-Authored-By: Matthew Mage <[email protected]>
I have no clue how to use github, but I think this works :P . Seriously though, how do I use this.