Skip to content

Commit

Permalink
Merge pull request #7 from TimKingtonFC/main
Browse files Browse the repository at this point in the history
Added volume, tweaks to startup
  • Loading branch information
katie-oh authored Oct 9, 2023
2 parents f56f570 + 0d6fd09 commit 21b2459
Show file tree
Hide file tree
Showing 2 changed files with 26 additions and 17 deletions.
4 changes: 4 additions & 0 deletions fly.toml
Original file line number Diff line number Diff line change
Expand Up @@ -15,3 +15,7 @@ primary_region = "ord"
auto_stop_machines = false
auto_start_machines = true
min_machines_running = 0

[mounts]
source="rengobot_data"
destination="/data"
39 changes: 22 additions & 17 deletions rengobot.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
# raw_input()

intents = discord.Intents.default()
# intents.message_content = True
intents.message_content = True
# client = discord.Client(intents=intents)
# bot = commands.Bot(command_prefix='$', intents=intents)
bot = commands.Bot(command_prefix='$', intents=intents, help_command=None)
Expand All @@ -36,24 +36,32 @@
# Later we might replace this with checking for a role.
admins=[ 463380651467472896, # Devin
907684282145849375, # David
631824578934734848 # Katie
631824578934734848, # Katie
489423695102869535 # Tim
]

teachers=[ 463380651467472896, # Devin
907684282145849375, # David
631824578934734848 # Katie
631824578934734848, # Katie
489423695102869535 # Tim
]

server_id= 1060261462733496320 # Columbus Go Club
# server_id= 1115830515396792342
permitted_channel_ids= [ 1115612796734943374 ] #zen-go channel
#permitted_channel_ids= [ 1115830516046893109 ] #my channel
# server_id= 1115830515396792342 # Katie's test server
# server_id = 1132772102504726708 # Tim's test server

server_name = "Columbus Go Club"
# server_name = "Tim's Server"

permitted_channel_ids= [ 1115612796734943374 ] # zen-go channel
# permitted_channel_ids= [ 1115830516046893109 ] # Katie's test channel
# permitted_channel_ids = [ 1132772102504726710 ] # Tim's test channel

white_stone= "<:white_stone:882731089548939314>"
black_stone= "<:black_stone:882730888453046342>"

with open("token.txt") as f:
token = f.readlines()[0] # Get your own token and put it in token.txt
token = f.readlines()[0].strip() # Get your own token and put it in token.txt

format="%Y_%m_%d_%H_%M_%S_%f"

Expand Down Expand Up @@ -480,7 +488,7 @@ async def background_task():
await bot.wait_until_ready()
print("bot ready!")

guild=discord.utils.get(bot.guilds, name="Columbus Go Club")
guild=discord.utils.get(bot.guilds, name=server_name)
game=discord.Game("multiplayer Baduk! $help for command list")
await bot.change_presence(status=discord.Status.online, activity=game)

Expand Down Expand Up @@ -546,14 +554,11 @@ async def background_task():
except ConnectionResetError:
print("Connection error")

bot.loop.create_task(background_task())
bot.run(token)


# @bot.event
# async def on_ready():
# background_task.start()
# bot.run(token)
async def main():
os.chdir("/data")
async with bot:
bot.loop.create_task(background_task())
await bot.start(token)

# background_task.start()
# bot.run(token)
asyncio.run(main())

0 comments on commit 21b2459

Please sign in to comment.