Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions commandListener.py
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,11 @@ async def command_channels_only(ctx: Context):
return (ctx.channel == self.bot.commandchannel
or ctx.channel.id == cfg._test_channel)

@command()
async def ping(self, ctx: Context):
"""Pong!"""
await ctx.send("Pong!")

@command()
async def testrole(self, ctx: Context, event: ArgEvent,
role: ArgRole):
Expand Down
60 changes: 5 additions & 55 deletions config.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,8 @@
COMMAND_CHANNEL = _test_channel
LOG_CHANNEL = _test_channel
GAME = 'with bugs'
EMOJI_GUILD = 219564389462704130
# If set to 0, the bot uses Command Channel's guild
EMOJI_GUILD = 0
else:
EVENT_CHANNEL = 502824760036818964
EVENT_ARCHIVE_CHANNEL = 528914471700267029
Expand Down Expand Up @@ -128,60 +129,9 @@

# NOTE: role name equals emote name
DEFAULT_ROLES = {
"1PLT": {
"ZEUS": "Company",
"1PLT": "1st Platoon",
"FAC": "1st Platoon",
"RTO": "1st Platoon",

"ASL": "Alpha",
"A1": "Alpha",
"A2": "Alpha",
"BSL": "Bravo",
"B1": "Bravo",
"B2": "Bravo",
"CSL": "Charlie",
"C1": "Charlie",
"C2": "Charlie",
},
"2PLT": {
"ZEUS": "Battalion",
"CO": "Company",
"FAC": "Company",
"RTO": "Company",

"1PLT": "1st Platoon",
"ASL": "Alpha",
"A1": "Alpha",
"BSL": "Bravo",
"B1": "Bravo",
"CSL": "Charlie",
"C1": "Charlie",
"DSL": "Delta",
"D1": "Delta",

"2PLT": "2nd Platoon",
"ESL": "Echo",
"E1": "Echo",
"FSL": "Foxtrot",
"F1": "Foxtrot",
"GSL": "Golf",
"G1": "Golf",
"HSL": "Hotel",
"H1": "Hotel",
},
"sideop": {
"ZEUS": "Company",
"ASL": "Alpha",
"A1": "Alpha",
"A2": "Alpha",
},
"WW2side": {
"ZEUS": "Company",
"1PLT": "1st Platoon",
"ASL": "1st Platoon",
"BSL": "1st Platoon",
},
# The mock library doesn't provide emojis for now, ignoring all roles/reactions
"1PLT": {},
"2PLT": {},
}

EMOJI_ZEUS = "ZEUS"
Expand Down
12 changes: 10 additions & 2 deletions eventListener.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,16 @@ def __init__(self, bot: OperationBot):

@Cog.listener()
async def on_ready(self):
print("Waiting until ready")
await self.bot.wait_until_ready()
# This 'ready' event isn't triggered by the test framework but is when
# running in discordpy = "prod". From bug report [1], seems a
# limitation/oversight of the test harness.
# [1]: https://github.com/CraftSpider/dpytest/issues/69#issue-1117467116

# FIXME: Temporarily disable this to allow the bot to progress to proper values
# print("Waiting until ready")
# await self.bot.wait_until_ready()

# Next instruction crashes the test from incorrect channelid (test env config)
self.bot.fetch_data()
commandchannel = self.bot.commandchannel
await commandchannel.send("Connected")
Expand Down
Loading