Skip to content

Commit 523df6e

Browse files
committed
- Addressed #22 -
Script now looks in a `botconf` folder for the configuration file (secrets file is still expected to be in the same directory as the script) Script now looks for the library at `botconf.library` There are no PyPi packages named `botconf` so there shouldn't be any naming issues.
1 parent caf85bd commit 523df6e

File tree

4 files changed

+24
-24
lines changed

4 files changed

+24
-24
lines changed

botScript.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
config = ConfigParser()
1212

1313
# Generate the absolute path of the config file (the directory the script is in + the name of the config file)
14-
config_file_path = os.path.join(os.path.abspath(os.path.dirname(__file__)), 'config.ini')
14+
config_file_path = os.path.join(os.path.abspath(os.path.dirname(__file__)), 'botconf', 'config.ini')
1515
secrets_file_path = os.path.join(os.path.abspath(os.path.dirname(__file__)), 'secrets.ini')
1616

1717
# Load the configuration settings from the config files.
@@ -45,7 +45,7 @@
4545

4646
# After installing all the dependencies it can load the custom library
4747
try:
48-
import library
48+
import botconf.library as library
4949
except ModuleNotFoundError as e:
5050
print(f'Module not found: {e.msg}')
5151
quit()

botconf/__init__.py

Whitespace-only changes.
Lines changed: 22 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -1,22 +1,22 @@
1-
[settings]
2-
token =
3-
guild_id =
4-
command_prefix = !
5-
greetings = hello|hi|hey
6-
7-
[dependencies]
8-
9-
[command.help]
10-
type = static
11-
content = I can respond to the following commands:`
12-
!help
13-
!meetingtime`
14-
15-
[command.meetingtime]
16-
type = static
17-
content = The current meeting time is:
18-
Every Wednesday at 5:30pm
19-
20-
[command.echo]
21-
type = dynamic
22-
function = command_echo
1+
[settings]
2+
token =
3+
guild_id =
4+
command_prefix = !
5+
greetings = hello|hi|hey
6+
7+
[dependencies]
8+
9+
[command.help]
10+
type = static
11+
content = I can respond to the following commands:`
12+
!help
13+
!meetingtime`
14+
15+
[command.meetingtime]
16+
type = static
17+
content = The current meeting time is:
18+
Every Wednesday at 5:30pm
19+
20+
[command.echo]
21+
type = dynamic
22+
function = command_echo
File renamed without changes.

0 commit comments

Comments
 (0)