Added custom activity types
This commit is contained in:
parent
5ff49ed052
commit
df1732fa97
@ -3,7 +3,10 @@
|
|||||||
"owner": 0,
|
"owner": 0,
|
||||||
"guild": 0,
|
"guild": 0,
|
||||||
"admins": [],
|
"admins": [],
|
||||||
"status": "crying clowns",
|
"status": {
|
||||||
|
"type": "playing",
|
||||||
|
"message": "on your nerves"
|
||||||
|
},
|
||||||
"database": {
|
"database": {
|
||||||
"user": null,
|
"user": null,
|
||||||
"password": null,
|
"password": null,
|
||||||
|
31
main.py
31
main.py
@ -31,9 +31,38 @@ except ImportError:
|
|||||||
@client.event
|
@client.event
|
||||||
async def on_ready():
|
async def on_ready():
|
||||||
logger.info(f"Logged in as {client.user}")
|
logger.info(f"Logged in as {client.user}")
|
||||||
|
|
||||||
|
activity_type = await config_get("type", "status")
|
||||||
|
activity_message = await config_get("message", "status")
|
||||||
|
|
||||||
|
if activity_type == "playing":
|
||||||
await client.change_presence(
|
await client.change_presence(
|
||||||
activity=Activity(type=ActivityType.listening, name=await config_get("status"))
|
activity=Activity(type=ActivityType.playing, name=activity_message)
|
||||||
)
|
)
|
||||||
|
elif activity_type == "watching":
|
||||||
|
await client.change_presence(
|
||||||
|
activity=Activity(type=ActivityType.watching, name=activity_message)
|
||||||
|
)
|
||||||
|
elif activity_type == "listening":
|
||||||
|
await client.change_presence(
|
||||||
|
activity=Activity(type=ActivityType.listening, name=activity_message)
|
||||||
|
)
|
||||||
|
elif activity_type == "streaming":
|
||||||
|
await client.change_presence(
|
||||||
|
activity=Activity(type=ActivityType.streaming, name=activity_message)
|
||||||
|
)
|
||||||
|
elif activity_type == "competing":
|
||||||
|
await client.change_presence(
|
||||||
|
activity=Activity(type=ActivityType.competing, name=activity_message)
|
||||||
|
)
|
||||||
|
elif activity_type == "custom":
|
||||||
|
await client.change_presence(
|
||||||
|
activity=Activity(type=ActivityType.custom, name=activity_message)
|
||||||
|
)
|
||||||
|
else:
|
||||||
|
return
|
||||||
|
|
||||||
|
logger.info(f"Set activity type to {activity_type} with message {activity_message}")
|
||||||
|
|
||||||
|
|
||||||
def main():
|
def main():
|
||||||
|
Loading…
Reference in New Issue
Block a user