just last line in pybot-f.py and to have all changes on the gitea :)
This commit is contained in:
parent
d3292efa09
commit
b8c56195c0
2 changed files with 4 additions and 5 deletions
1
.idea/pybot-f.iml
generated
1
.idea/pybot-f.iml
generated
|
@ -3,6 +3,7 @@
|
||||||
<component name="NewModuleRootManager">
|
<component name="NewModuleRootManager">
|
||||||
<content url="file://$MODULE_DIR$">
|
<content url="file://$MODULE_DIR$">
|
||||||
<excludeFolder url="file://$MODULE_DIR$/venv" />
|
<excludeFolder url="file://$MODULE_DIR$/venv" />
|
||||||
|
<excludeFolder url="file://$MODULE_DIR$/botdev" />
|
||||||
</content>
|
</content>
|
||||||
<orderEntry type="jdk" jdkName="Python 3.10 (pybot-f)" jdkType="Python SDK" />
|
<orderEntry type="jdk" jdkName="Python 3.10 (pybot-f)" jdkType="Python SDK" />
|
||||||
<orderEntry type="sourceFolder" forTests="false" />
|
<orderEntry type="sourceFolder" forTests="false" />
|
||||||
|
|
|
@ -18,20 +18,17 @@ logger.addHandler(handler)
|
||||||
# The bots' description
|
# The bots' description
|
||||||
description = '''Testing this bot stuff :)'''
|
description = '''Testing this bot stuff :)'''
|
||||||
|
|
||||||
|
|
||||||
# Intents
|
# Intents
|
||||||
intents = discord.Intents.default()
|
intents = discord.Intents.default()
|
||||||
intents.members = True
|
intents.members = True
|
||||||
intents.message_content = True
|
intents.message_content = True
|
||||||
|
|
||||||
|
|
||||||
# Config loading
|
# Config loading
|
||||||
config = configparser.ConfigParser()
|
config = configparser.ConfigParser()
|
||||||
config.read('bot.ini')
|
config.read('bot.ini')
|
||||||
|
|
||||||
bottoken = config['General']['bottoken']
|
bottoken = config['General']['bottoken']
|
||||||
|
|
||||||
|
|
||||||
# Setting up commands.Bot
|
# Setting up commands.Bot
|
||||||
bot = commands.Bot(command_prefix='.', description=description, intents=intents)
|
bot = commands.Bot(command_prefix='.', description=description, intents=intents)
|
||||||
|
|
||||||
|
@ -51,7 +48,8 @@ async def repeat(ctx, times: int, content='repeating...'):
|
||||||
|
|
||||||
@bot.command()
|
@bot.command()
|
||||||
@commands.is_owner()
|
@commands.is_owner()
|
||||||
async def sync(ctx: commands.Context, guilds: commands.Greedy[discord.Object], spec: typing.Optional[typing.Literal["~", "*"]] = None) -> None:
|
async def sync(ctx: commands.Context, guilds: commands.Greedy[discord.Object],
|
||||||
|
spec: typing.Optional[typing.Literal["~", "*"]] = None) -> None:
|
||||||
if not guilds:
|
if not guilds:
|
||||||
if spec == "~":
|
if spec == "~":
|
||||||
fmt = await ctx.bot.tree.sync(guild=ctx.guild)
|
fmt = await ctx.bot.tree.sync(guild=ctx.guild)
|
||||||
|
@ -96,4 +94,4 @@ async def main():
|
||||||
await bot.start(bottoken)
|
await bot.start(bottoken)
|
||||||
|
|
||||||
|
|
||||||
asyncio.run(main())
|
asyncio.run(main())
|
||||||
|
|
Loading…
Add table
Reference in a new issue