mirror of
https://github.com/Mikaela/Limnoria.git
synced 2024-11-07 19:49:23 +01:00
Changed random.sample(seq, 1)[0] to random.choice. Completely forgot the name of the choice function.
This commit is contained in:
parent
b497acbc43
commit
644fd692fa
@ -125,9 +125,9 @@ class Babelfish(callbacks.Privmsg):
|
|||||||
is provided, will include English in the list of possible languages.
|
is provided, will include English in the list of possible languages.
|
||||||
"""
|
"""
|
||||||
allowEnglish = privmsgs.getArgs(args, needed=0, optional=1)
|
allowEnglish = privmsgs.getArgs(args, needed=0, optional=1)
|
||||||
language = random.sample(babelfish.available_languages, 1)[0]
|
language = random.choice(babelfish.available_languages)
|
||||||
while not allowEnglish and language == 'English':
|
while not allowEnglish and language == 'English':
|
||||||
language = random.sample(babelfish.available_languages, 1)[0]
|
language = random.choice(babelfish.available_languages, 1)
|
||||||
irc.reply(msg, language)
|
irc.reply(msg, language)
|
||||||
|
|
||||||
|
|
||||||
|
@ -104,7 +104,7 @@ class Dict(callbacks.Privmsg):
|
|||||||
|
|
||||||
Returns a random valid dictionary.
|
Returns a random valid dictionary.
|
||||||
"""
|
"""
|
||||||
irc.reply(msg, random.sample(list(self.dictdbs), 1)[0])
|
irc.reply(msg, random.choice(list(self.dictdbs)))
|
||||||
|
|
||||||
def dict(self, irc, msg, args):
|
def dict(self, irc, msg, args):
|
||||||
"""[<dictionary>] <word>
|
"""[<dictionary>] <word>
|
||||||
|
@ -45,15 +45,11 @@ import new
|
|||||||
import md5
|
import md5
|
||||||
import sha
|
import sha
|
||||||
import time
|
import time
|
||||||
import math
|
|
||||||
import cmath
|
|
||||||
import getopt
|
|
||||||
import socket
|
import socket
|
||||||
import string
|
import string
|
||||||
import random
|
import random
|
||||||
import urllib
|
import urllib
|
||||||
import inspect
|
import inspect
|
||||||
import textwrap
|
|
||||||
import telnetlib
|
import telnetlib
|
||||||
import threading
|
import threading
|
||||||
import mimetypes
|
import mimetypes
|
||||||
@ -599,7 +595,7 @@ class FunCommands(callbacks.Privmsg):
|
|||||||
|
|
||||||
Asks the magic eightball a question.
|
Asks the magic eightball a question.
|
||||||
"""
|
"""
|
||||||
irc.reply(msg, random.sample(self._eightballs, 1)[0])
|
irc.reply(msg, random.choice(self._eightballs))
|
||||||
|
|
||||||
|
|
||||||
_these = [str(s) for s in this.s.decode('rot13').splitlines() if s]
|
_these = [str(s) for s in this.s.decode('rot13').splitlines() if s]
|
||||||
@ -609,7 +605,7 @@ class FunCommands(callbacks.Privmsg):
|
|||||||
|
|
||||||
Returns one of the zen of Python statements.
|
Returns one of the zen of Python statements.
|
||||||
"""
|
"""
|
||||||
irc.reply(msg, random.sample(self._these, 1)[0])
|
irc.reply(msg, random.choice(self._these))
|
||||||
|
|
||||||
def dns(self, irc, msg, args):
|
def dns(self, irc, msg, args):
|
||||||
"""<host|ip>
|
"""<host|ip>
|
||||||
|
Loading…
Reference in New Issue
Block a user