mirror of
https://github.com/SpiceBot/SpiceBot.git
synced 2026-11-13 06:59:53 -05:00
Channels: Code Cleanup
This commit is contained in:
parent
c6258cfbab
commit
020ff76f54
@ -184,91 +184,22 @@ def nickname_comand_chanstats(bot, trigger):
|
|||||||
bot.osd("Topic for {}: {}".format(channel, topic))
|
bot.osd("Topic for {}: {}".format(channel, topic))
|
||||||
return
|
return
|
||||||
|
|
||||||
# OP list
|
if commandused.upper() == ['OP', 'HOP', 'VOICE', 'OWNER', 'ADMIN']:
|
||||||
if commandused == 'op':
|
if not len(triggerargs):
|
||||||
channel = spicemanip.main(triggerargs, 1)
|
if trigger.is_privmsg:
|
||||||
if not inlist(bot, channel.lower(), bot.memory['SpiceBot_Channels']['channels'].keys()):
|
bot.osd("Channel name required.")
|
||||||
bot.osd("Channel name {} not valid.".format(channel))
|
return
|
||||||
return
|
else:
|
||||||
if not inlist(bot, channel.lower(), bot.channels.keys()):
|
channel = trigger.sender
|
||||||
bot.osd("I need to be in {} to see nick privileges.".format(channel))
|
|
||||||
return
|
|
||||||
privlist = channel_privs(bot, channel, commandused.upper())
|
|
||||||
dispmsg = []
|
|
||||||
if not len(privlist):
|
|
||||||
dispmsg.append("There are no Channel " + commandused.upper() + "s for " + str(channel))
|
|
||||||
else:
|
else:
|
||||||
oplist = spicemanip.main(privlist, 'andlist')
|
channel = spicemanip.main(triggerargs, 1)
|
||||||
dispmsg.append("Channel " + commandused.upper() + "s for " + str(channel) + " are: " + oplist)
|
if not inlist(bot, channel.lower(), bot.memory['SpiceBot_Channels']['channels'].keys()):
|
||||||
bot.osd(dispmsg, trigger.nick, 'notice')
|
bot.osd("Channel name {} not valid.".format(channel))
|
||||||
return
|
return
|
||||||
|
if not inlist(bot, channel.lower(), bot.channels.keys()):
|
||||||
|
bot.osd("I need to be in {} to see nick privileges.".format(channel))
|
||||||
|
return
|
||||||
|
|
||||||
# HOP list
|
|
||||||
if commandused == 'hop':
|
|
||||||
channel = spicemanip.main(triggerargs, 1)
|
|
||||||
if not inlist(bot, channel.lower(), bot.memory['SpiceBot_Channels']['channels'].keys()):
|
|
||||||
bot.osd("Channel name {} not valid.".format(channel))
|
|
||||||
return
|
|
||||||
if not inlist(bot, channel.lower(), bot.channels.keys()):
|
|
||||||
bot.osd("I need to be in {} to see nick privileges.".format(channel))
|
|
||||||
return
|
|
||||||
privlist = channel_privs(bot, channel, commandused.upper())
|
|
||||||
dispmsg = []
|
|
||||||
if not len(privlist):
|
|
||||||
dispmsg.append("There are no Channel " + commandused.upper() + "s for " + str(channel))
|
|
||||||
else:
|
|
||||||
oplist = spicemanip.main(privlist, 'andlist')
|
|
||||||
dispmsg.append("Channel " + commandused.upper() + "s for " + str(channel) + " are: " + oplist)
|
|
||||||
bot.osd(dispmsg, trigger.nick, 'notice')
|
|
||||||
return
|
|
||||||
|
|
||||||
# Voice List
|
|
||||||
if commandused == 'voice':
|
|
||||||
channel = spicemanip.main(triggerargs, 1)
|
|
||||||
if not inlist(bot, channel.lower(), bot.memory['SpiceBot_Channels']['channels'].keys()):
|
|
||||||
bot.osd("Channel name {} not valid.".format(channel))
|
|
||||||
return
|
|
||||||
if not inlist(bot, channel.lower(), bot.channels.keys()):
|
|
||||||
bot.osd("I need to be in {} to see nick privileges.".format(channel))
|
|
||||||
return
|
|
||||||
privlist = channel_privs(bot, channel, commandused.upper())
|
|
||||||
dispmsg = []
|
|
||||||
if not len(privlist):
|
|
||||||
dispmsg.append("There are no Channel " + commandused.upper() + "s for " + str(channel))
|
|
||||||
else:
|
|
||||||
oplist = spicemanip.main(privlist, 'andlist')
|
|
||||||
dispmsg.append("Channel " + commandused.upper() + "s for " + str(channel) + " are: " + oplist)
|
|
||||||
bot.osd(dispmsg, trigger.nick, 'notice')
|
|
||||||
return
|
|
||||||
|
|
||||||
# owner List
|
|
||||||
if commandused == 'owner':
|
|
||||||
channel = spicemanip.main(triggerargs, 1)
|
|
||||||
if not inlist(bot, channel.lower(), bot.memory['SpiceBot_Channels']['channels'].keys()):
|
|
||||||
bot.osd("Channel name {} not valid.".format(channel))
|
|
||||||
return
|
|
||||||
if not inlist(bot, channel.lower(), bot.channels.keys()):
|
|
||||||
bot.osd("I need to be in {} to see nick privileges.".format(channel))
|
|
||||||
return
|
|
||||||
privlist = channel_privs(bot, channel, commandused.upper())
|
|
||||||
dispmsg = []
|
|
||||||
if not len(privlist):
|
|
||||||
dispmsg.append("There are no Channel " + commandused.upper() + "s for " + str(channel))
|
|
||||||
else:
|
|
||||||
oplist = spicemanip.main(privlist, 'andlist')
|
|
||||||
dispmsg.append("Channel " + commandused.upper() + "s for " + str(channel) + " are: " + oplist)
|
|
||||||
bot.osd(dispmsg, trigger.nick, 'notice')
|
|
||||||
return
|
|
||||||
|
|
||||||
# admin List
|
|
||||||
if commandused == 'admin':
|
|
||||||
channel = spicemanip.main(triggerargs, 1)
|
|
||||||
if not inlist(bot, channel.lower(), bot.memory['SpiceBot_Channels']['channels'].keys()):
|
|
||||||
bot.osd("Channel name {} not valid.".format(channel))
|
|
||||||
return
|
|
||||||
if not inlist(bot, channel.lower(), bot.channels.keys()):
|
|
||||||
bot.osd("I need to be in {} to see nick privileges.".format(channel))
|
|
||||||
return
|
|
||||||
privlist = channel_privs(bot, channel, commandused.upper())
|
privlist = channel_privs(bot, channel, commandused.upper())
|
||||||
dispmsg = []
|
dispmsg = []
|
||||||
if not len(privlist):
|
if not len(privlist):
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user