Remaining updates
This commit is contained in:
		
							parent
							
								
									1494e0e023
								
							
						
					
					
						commit
						c27595bb84
					
				| @ -13,16 +13,16 @@ class SCP: | ||||
|         """Look up SCP articles. | ||||
| 
 | ||||
|         Warning: Some of them may be too creepy or gruesome. | ||||
|         Reminder: You must specify a number between 1 and 3999. | ||||
|         Reminder: You must specify a number between 1 and 4999. | ||||
|         """ | ||||
| 
 | ||||
|         # Thanks Shigbeard and Redjumpman for helping me! | ||||
| 
 | ||||
|         if 0 < num <= 3999: | ||||
|         if 0 < num <= 4999: | ||||
|             msg = "http://www.scp-wiki.net/scp-{:03}".format(num) | ||||
|             c = discord.Color.green() | ||||
|         else: | ||||
|             msg = "You must specify a number between 1 and 3999." | ||||
|             msg = "You must specify a number between 1 and 4999." | ||||
|             c = discord.Color.red() | ||||
| 
 | ||||
|         if ctx.embed_requested(): | ||||
|  | ||||
							
								
								
									
										5
									
								
								unicode/__init__.py
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										5
									
								
								unicode/__init__.py
									
									
									
									
									
										Normal file
									
								
							| @ -0,0 +1,5 @@ | ||||
| from .unicode import Unicode | ||||
| 
 | ||||
| 
 | ||||
| def setup(bot): | ||||
|     bot.add_cog(Unicode(bot)) | ||||
| @ -1,11 +1,21 @@ | ||||
| { | ||||
|   "AUTHOR": "SnappyDragon", | ||||
|   "INSTALL_MSG": "\u0048\u0065\u006c\u006c\u006f\u0021 \u0054\u0068\u0069\u0073 \u006d\u0065\u0073\u0073\u0061\u0067\u0065 \u0077\u0061\u0073 \u0077\u0072\u0069\u0074\u0074\u0065\u006e \u0069\u006e \u0055\u004e\u0049\u0043\u004f\u0044\u0045\u002e", | ||||
|   "NAME": "Unicode", | ||||
|   "SHORT": "Encode/Decode Unicode characters!", | ||||
|   "DESCRIPTION": "Encode/Decode a Unicode character!", | ||||
|   "TAGS": [ | ||||
|   "author": [ | ||||
|     "Bobloy", | ||||
|     "SnappyDragon" | ||||
|   ], | ||||
|   "bot_version": [ | ||||
|     3, | ||||
|     0, | ||||
|     0 | ||||
|   ], | ||||
|   "description": "Encode/Decode Unicode characters!", | ||||
|   "hidden": false, | ||||
|   "install_msg": "\u0048\u0065\u006c\u006c\u006f\u0021 \u0054\u0068\u0069\u0073 \u006d\u0065\u0073\u0073\u0061\u0067\u0065 \u0077\u0061\u0073 \u0077\u0072\u0069\u0074\u0074\u0065\u006e \u0069\u006e \u0055\u004e\u0049\u0043\u004f\u0044\u0045\u002e", | ||||
|   "requirements": [], | ||||
|   "short": "Encode/Decode Unicode characters!", | ||||
|   "tags": [ | ||||
|     "bobloy", | ||||
|     "utility", | ||||
|     "utlities" | ||||
|     "tools" | ||||
|   ] | ||||
| } | ||||
| @ -1,7 +1,7 @@ | ||||
| import codecs as c | ||||
| 
 | ||||
| import discord | ||||
| from discord.ext import commands | ||||
| from redbot.core import commands | ||||
| 
 | ||||
| 
 | ||||
| class Unicode: | ||||
| @ -11,13 +11,13 @@ class Unicode: | ||||
|         self.bot = bot | ||||
| 
 | ||||
|     @commands.group(name='unicode', pass_context=True) | ||||
|     async def unicode(self, context): | ||||
|     async def unicode(self, ctx): | ||||
|         """Encode/Decode a Unicode character.""" | ||||
|         if context.invoked_subcommand is None: | ||||
|             await self.bot.send_cmd_help(context) | ||||
|         if ctx.invoked_subcommand is None: | ||||
|             pass | ||||
| 
 | ||||
|     @unicode.command() | ||||
|     async def decode(self, character): | ||||
|     async def decode(self, ctx: commands.Context, character): | ||||
|         """Decode a Unicode character.""" | ||||
|         try: | ||||
|             data = 'U+{:04X}'.format(ord(character[0])) | ||||
| @ -26,10 +26,10 @@ class Unicode: | ||||
|             data = '<unknown>' | ||||
|             color = discord.Color.red() | ||||
|         em = discord.Embed(title=character, description=data, color=color) | ||||
|         await self.bot.say(embed=em) | ||||
|         await ctx.send(embed=em) | ||||
| 
 | ||||
|     @unicode.command() | ||||
|     async def encode(self, character): | ||||
|     async def encode(self, ctx:commands.Context, character): | ||||
|         """Encode an Unicode character.""" | ||||
|         try: | ||||
|             if character[:2] == '\\u': | ||||
| @ -46,8 +46,4 @@ class Unicode: | ||||
|             data = '<unknown>' | ||||
|             color = discord.Color.red() | ||||
|         em = discord.Embed(title=character, description=data, color=color) | ||||
|         await self.bot.say(embed=em) | ||||
| 
 | ||||
| 
 | ||||
| def setup(bot): | ||||
|     bot.add_cog(Unicode(bot)) | ||||
|         await ctx.send(embed=em) | ||||
|  | ||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user
	 bobloy
						bobloy