mirror of
https://github.com/TotalFreedomMC/TotalFreedomBot.git
synced 2024-12-22 15:44:57 +00:00
Update miscellaneous.py
This commit is contained in:
parent
20d1ef19b1
commit
a2b3020e6b
1 changed files with 7 additions and 0 deletions
|
@ -2,10 +2,12 @@ import discord
|
||||||
import asyncio
|
import asyncio
|
||||||
import telnet
|
import telnet
|
||||||
import time
|
import time
|
||||||
|
import events
|
||||||
|
|
||||||
from datetime import datetime
|
from datetime import datetime
|
||||||
from discord.ext import commands
|
from discord.ext import commands
|
||||||
from checks import *
|
from checks import *
|
||||||
|
from functions import *
|
||||||
|
|
||||||
class Miscellaneous(commands.Cog):
|
class Miscellaneous(commands.Cog):
|
||||||
def __init__(self, bot):
|
def __init__(self, bot):
|
||||||
|
@ -36,7 +38,12 @@ class Miscellaneous(commands.Cog):
|
||||||
em.colour = 0x00FF00
|
em.colour = 0x00FF00
|
||||||
elif args[0] == 'name':
|
elif args[0] == 'name':
|
||||||
try:
|
try:
|
||||||
|
self.bot.telnet_object.session.close()
|
||||||
self.bot.telnet_object.connect(args[1])
|
self.bot.telnet_object.connect(args[1])
|
||||||
|
events.telnet_username = self.bot.telnet_object.username
|
||||||
|
config = read_json('config')
|
||||||
|
config['TELNET_USERNAME'] = self.bot.telnet_object.username
|
||||||
|
write_json('config', config)
|
||||||
except Exception as e:
|
except Exception as e:
|
||||||
em.description = f'Failed config edit: {e}'
|
em.description = f'Failed config edit: {e}'
|
||||||
em.colour = 0xFF0000
|
em.colour = 0xFF0000
|
||||||
|
|
Loading…
Reference in a new issue