Skip to content

Commit

Permalink
Fix startup, temporarily sync sync so I don't have to sync sync to sy…
Browse files Browse the repository at this point in the history
…nc (#219)
  • Loading branch information
ibanner56 authored Feb 25, 2024
1 parent 4906fa7 commit 150c2df
Show file tree
Hide file tree
Showing 3 changed files with 22 additions and 4 deletions.
3 changes: 2 additions & 1 deletion conf.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -12,11 +12,12 @@ max_lookback: 100
parrot_channel: 1200077320292147220
parrot_interval: 1800
dave_id: 194865073943085056
isaac_id: 190531602084790273
self_id: 355497099762073600
bag_size: 10
user_bag_size: 4
greedy_time: 1800
guild_id: 1200077320292147220
guild_id: 328946766747533314

drunkdraw:
locales:
Expand Down
22 changes: 19 additions & 3 deletions otherdave/__main__.py
Original file line number Diff line number Diff line change
Expand Up @@ -323,6 +323,23 @@ async def cmd_spend(interaction: discord.Interaction) -> None:
store = Store(customer=interaction.user, webhook = interaction.followup)
await interaction.response.send_message(content = constants.storefrontMessage, view = store, ephemeral = True)

@client.tree.command(
name = "sync",
description = "Only Isaac can touch me there."
)
async def cmd_sync(interaction: discord.Interaction) -> None:
if (interaction.user.id == config.isaacid):
# Sync command tree
global synced
if (not synced):
await client.tree.sync()
synced = True
await interaction.response.send_message("Oooh that felt good, thanks.")
else:
await interaction.response.send_message("I'm already synced, thanks.")
else:
await interaction.response.send_message("Ew, no thanks.")

@client.tree.command(
name = "use",
description = "Uses an object in your inventory, or tells OtherDave to use an object in his."
Expand Down Expand Up @@ -413,12 +430,11 @@ async def on_ready() -> None:
# Sync command tree
global synced
if (not synced):
client.tree.copy_global_to(guild=discord.Object(id = config.guildid))
await client.tree.sync(guild=discord.Object(id = config.guildid))
await client.tree.sync()
synced = True

global otherotherdave
otherotherdave = await client.fetch_user(194865073943085056)
otherotherdave = await client.fetch_user(config.daveid)

logger.debug("Logged in as {0.user}".format(client))
await dlog(client, "Hi, I'm OtherDave and I'm BACK FOR BUSINESS.")
Expand Down
1 change: 1 addition & 0 deletions otherdave/util/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
parrotChan = loadedConfig["parrot_channel"]
parrotInterval = loadedConfig["parrot_interval"]
daveid = loadedConfig["dave_id"]
isaacid = loadedConfig["isaac_id"]
selfid = loadedConfig["self_id"]
selftag = "<@" + selfid + ">"
bagsize = int(loadedConfig["bag_size"])
Expand Down

0 comments on commit 150c2df

Please sign in to comment.