First command for pi and update .gitignore to remove pi.txt (too big)
This commit is contained in:
parent
e18c54baee
commit
c1241e3734
3
.gitignore
vendored
3
.gitignore
vendored
@ -108,3 +108,6 @@ venv.bak/
|
|||||||
|
|
||||||
# FoBot config
|
# FoBot config
|
||||||
foBot_config/*
|
foBot_config/*
|
||||||
|
|
||||||
|
# Pi file (too big)
|
||||||
|
modules/pi/pi.txt
|
@ -1,11 +1,24 @@
|
|||||||
|
import os
|
||||||
|
|
||||||
|
|
||||||
class MainClass:
|
class MainClass:
|
||||||
name = "pi"
|
name = "pi"
|
||||||
|
|
||||||
def __init__(self, guild):
|
def __init__(self, guild):
|
||||||
self.guild = guild
|
self.guild = guild
|
||||||
|
self.pi_file = "D:\\Users\\louis chauvet\\Documents\\GitHub\\foBot\\modules\\pi\\pi1.txt"
|
||||||
|
|
||||||
async def pi(self, msg, command, args):
|
async def pi(self, msg, command, args):
|
||||||
pass
|
start=0
|
||||||
|
if len(args) == 1:
|
||||||
|
try:
|
||||||
|
start = int(args[0])
|
||||||
|
except ValueError:
|
||||||
|
await msg.channel.send("Vous devez spwcifier un nombre imferieur a 100000")
|
||||||
|
with open(self.pi_file) as pi_file:
|
||||||
|
pi_file.read(start)
|
||||||
|
txt = pi_file.read(1900)
|
||||||
|
await msg.channel.send("3."+txt)
|
||||||
|
|
||||||
async def pi_search(self, msg, command, args):
|
async def pi_search(self, msg, command, args):
|
||||||
pass
|
pass
|
||||||
@ -14,5 +27,5 @@ class MainClass:
|
|||||||
if msg.content.startswith(self.guild.config["prefix"]):
|
if msg.content.startswith(self.guild.config["prefix"]):
|
||||||
command, *args = msg.content.lstrip(self.guild.config["prefix"]).split(" ")
|
command, *args = msg.content.lstrip(self.guild.config["prefix"]).split(" ")
|
||||||
if command == "pi":
|
if command == "pi":
|
||||||
self.pi(msg, command, args)
|
await self.pi(msg, command, args)
|
||||||
return
|
return
|
||||||
|
File diff suppressed because one or more lines are too long
Loading…
Reference in New Issue
Block a user