Added guid functionality to random_number.py
This commit is contained in:
parent
dc0babe599
commit
ae9d715e55
1 changed files with 7 additions and 1 deletions
|
@ -1,10 +1,13 @@
|
||||||
import random
|
import random, uuid
|
||||||
|
|
||||||
class Module(object):
|
class Module(object):
|
||||||
|
_name = "Random"
|
||||||
def __init__(self, bot):
|
def __init__(self, bot):
|
||||||
bot.events.on("received").on("command").on("random",
|
bot.events.on("received").on("command").on("random",
|
||||||
"rand").hook(self.random, help="Get a random number",
|
"rand").hook(self.random, help="Get a random number",
|
||||||
usage="[start] [end]")
|
usage="[start] [end]")
|
||||||
|
bot.events.on("received").on("command").on("guid"
|
||||||
|
).hook(self.guid, help="Get a random guid")
|
||||||
|
|
||||||
def random(self, event):
|
def random(self, event):
|
||||||
start, end = "1", "100"
|
start, end = "1", "100"
|
||||||
|
@ -24,3 +27,6 @@ class Module(object):
|
||||||
else:
|
else:
|
||||||
event["stderr"].write(
|
event["stderr"].write(
|
||||||
"Both start and end must be valid integers")
|
"Both start and end must be valid integers")
|
||||||
|
|
||||||
|
def guid(self, event):
|
||||||
|
event["stdout"].write(str(uuid.uuid4()))
|
||||||
|
|
Loading…
Reference in a new issue