Package: linelib
LINELIB v2.2The All-in-One LINE Bot Integration Solution.InstallationUse the following, or clone this repository.$pipinstall-Ulinelib🔑 Features.✨ Optimized Source Code.Cleaner source code is beneficial because it is easier to read, understand, and maintain. It's easier for you to add new features, fix bugs, and understand how the code works. Clean code is also more efficient, as it is optimized for performance and is less likely to contain errors or bugs. It is also more reusable, allowing you to use it in other projects without having to rewrite it.🧩 With Extensions.With LINELIB, you can easily and efficiently integrate various LINE services into your projects and applications, all with just a few lines of code.LINELIB simplifies the process of working with LINE services, making it more accessible and streamlined for developers of all skill levels. Whether you're looking to add messaging functionality, connect with LINE's social media platform, or utilize other LINE services, LINELIB makes it simple to do so with minimal code requirements.LINELIB currently supports these LINE services:LINE Messaging APILINE NotifyLINE Social Plugins💪 More advanced.Create text commands like a pro.Linelib helps you to quickly and efficiently create text commands by organizing them inside cogs!Ready to give it a shot?Oh my goodness, you're here! I'm hyped to see that you're willing to give it a go.Anyways, here are some helpful links that can get you around with LINELIB:🚀 See More Examples📖 Documentation🎉 Examples."Don't just talk. Show me some examples!" I hear you say...1: Quick ExamplefromlinelibimportClientclient=Client('channel secret','channel access token')@client.event('ready')asyncdefready():print('I am ready!')client.run()2: LINE Notify ExamplefromlinelibimportClientfromlinelib.notifyimportNotifyclient=Client('channel secret','channel access token')notify=Notify("access token")@client.event('ready')asyncdefready():awaitnotify.notify("Daily News:\nLinelib version 2 has released!!11!")client.run()3: Simple Command CogThis is a simple cog with the command "hello", which requires one argument (times) in order to work.User:hello 10Bot:You greeted me 10 times!fromlinelibimportClientfromlinelib.extimportcommandsclient=Client('channel secret','channel access token')classMyCog(commands.Cog):@commands.cog_command(name="hello")asyncdefgreet_command(self,ctx,times:int):# "self" is required!awaitctx.reply(f"You greeted me{times}times!")client.load_cog(MyCog())client.run()4: Advanced Command CogThis is a more advanced command cog with command rules, and rule rejection handlers.The command (say) requires one argument "text", but you should add a "*" in thegreet_commandcoroutine function to tell linelib to pass the rest of the message content into the argument ("text").User:say I love chocolate!Bot:I love chocolate!1 second later...User:say I still love it.Bot:The cooldown is 10 seconds long! Please wait.fromlinelibimportClientfromlinelib.extimportcommands,ruleclient=Client('channel secret','channel access token')classMyCog(commands.Cog):@commands.cog_command(name="say",rule=rule.CommandRule(rule="cooldown",seconds=10))asyncdefgreet_command(self,ctx,*,text):# "self" is required!awaitctx.reply(text)@greet_command.rule_rejectasyncdefrejected(self,ctx):awaitctx.reply('The cooldown is 10 seconds long! Please wait.')client.load_cog(MyCog())client.run()5: Custom Rule (Advanced)Custom rules must have a function named "handler". The handler must return a valid boolean (TrueorFalse).Truerepresents that the user is able to use the command, vice versa.fromlinelib.extimportruleclassMyRule(rule.CommandRule):defhandler(self,ctx):# ... your awesome codereturnTrue# must return True or FalseMyRule(rule="based.custom")# Now, it's a valid command rule.