Compare commits
No commits in common. "58adc111b58415ca81c7ab6f0fdee9ad6e27cef3" and "a71795424f5197d0007086b7ed6bdf0c8ffaf8b9" have entirely different histories.
58adc111b5
...
a71795424f
|
@ -2,18 +2,18 @@
|
||||||
|
|
||||||
A bot written for the Linux General Discord Server
|
A bot written for the Linux General Discord Server
|
||||||
|
|
||||||
### Setup
|
### How to run
|
||||||
|
|
||||||
- Install the necessary packages:
|
- Install the necessary packages:
|
||||||
```sh
|
```sh
|
||||||
pip install -r requirements.txt
|
pip install -r requirements.txt
|
||||||
```
|
```
|
||||||
|
|
||||||
### Running
|
- On the last line, replace `TOKEN` with your bot token
|
||||||
|
|
||||||
- Run the `bot.py`file passing the bot token as argument:
|
- Then, run the `main.py`file:
|
||||||
```sh
|
```sh
|
||||||
python3 bot.py TOKEN_HERE
|
python3 main.py
|
||||||
```
|
```
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -1 +1,2 @@
|
||||||
discord.py==2.1.0
|
discord.py==2.1.0
|
||||||
|
psutil==5.9.4
|
||||||
|
|
|
@ -7,13 +7,13 @@ from discord import app_commands
|
||||||
import typing
|
import typing
|
||||||
from discord.ext import commands
|
from discord.ext import commands
|
||||||
import discord.utils
|
import discord.utils
|
||||||
|
import psutil
|
||||||
import time
|
import time
|
||||||
import sys
|
from sys import platform
|
||||||
|
|
||||||
BOOT_TIME = time.time()
|
|
||||||
|
|
||||||
def seconds_elapsed():
|
def seconds_elapsed():
|
||||||
return time.time() - BOOT_TIME
|
return time.time() - psutil.boot_time()
|
||||||
|
|
||||||
|
|
||||||
class MyClient(discord.Client):
|
class MyClient(discord.Client):
|
||||||
|
@ -190,10 +190,10 @@ async def report_message(interaction: discord.Interaction, message: discord.Mess
|
||||||
async def status(interaction: discord.Interaction):
|
async def status(interaction: discord.Interaction):
|
||||||
embed = discord.Embed(title='System Stats')
|
embed = discord.Embed(title='System Stats')
|
||||||
embed.description = f"""Uptime: {seconds_elapsed()}
|
embed.description = f"""Uptime: {seconds_elapsed()}
|
||||||
System: {sys.platform}"""
|
System: {platform}"""
|
||||||
url_view = discord.ui.View()
|
url_view = discord.ui.View()
|
||||||
await interaction.response.send_message(embed=embed, view=url_view)
|
await interaction.response.send_message(embed=embed, view=url_view)
|
||||||
|
|
||||||
|
|
||||||
client.tree.sync()
|
client.tree.sync()
|
||||||
client.run(sys.argv[1])
|
client.run('TOKEN')
|
Loading…
Reference in New Issue