Skip to content

Conversation

seekheart
Copy link
Member

This PR closes out #7 with the addition of a bot.py file and a settings file. You'll need to make a config.json file. It looks like this:

{
  "clientId": <CLIENT_ID>,
  "clientSecret": <CLIENT_SECRET>,
  "botPrefix": <BOT_PREFIX>,
  "token": <TOKEN>
}

@LaVieEstDure
Copy link
Member

I'd change it so that it generates an empty JSON file if it doesn't find the config and gives an error telling used to fill it in. More convenient and better ensures that the user doesn't make any mistakes while making the file.

@seekheart
Copy link
Member Author

The issue with empty json file would be the same. We could include a template if it helps?

@LaVieEstDure
Copy link
Member

example_config.json? Sounds good to me

@seekheart
Copy link
Member Author

@LaVieEstDure @Heasummn can you guys check and approve and one of you merge?

def init_bot():
"""Creates a discord client connection"""
return discord.Client()

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should we be using the discord.bot.ext frameworks? Also this feels like an unpythonic function.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

not sure what that is

@client.event
async def on_ready():
"""Logs the bot in for operations"""
print('logged in as {}'.format(client.user.name))
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We said we'd support 3.6+, yeah? Should use f-strings where we can then

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I've never used them, can you clone and make the changes? I would like to see.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants